From 466b65e6df0870d911d37eafe01063fbbdb34db0 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Roland=20H=C3=A4der?= <roland@mxchange.org>
Date: Sat, 24 Jun 2023 21:00:14 +0200
Subject: [PATCH] Continued: - some CSS beautifications - scoreboard navigation
 is now a list not just links with <br />

---
 templates/base.html             |  9 ++++--
 templates/views/index.html      | 56 +++++++++++++++++++++------------
 templates/views/scoreboard.html |  2 +-
 templates/views/top.html        |  4 +--
 4 files changed, 46 insertions(+), 25 deletions(-)

diff --git a/templates/base.html b/templates/base.html
index 629c135..55d3023 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -40,7 +40,8 @@
             padding-bottom: 4px;
         }
 
-        table tr:nth-of-type(2n), thead {
+        table.with-rows > tbody > tr:nth-of-type(2n),
+        table.with-rows > thead {
             background-color: #eaeaea;
         }
 
@@ -118,6 +119,10 @@
             background-color: #eaeaea;
             border-radius: 5px;
         }
+        ul.nav > li {
+            margin: 2px;
+            display: inline;
+        }
     </style>
 </head>
 
@@ -127,7 +132,7 @@
     </div>
 
     <div id="content">
-        {% block content %}{% endblock %}
+        {% block content %}Page has no content!{% endblock %}
     </div>
 
     <div id="footer">
diff --git a/templates/views/index.html b/templates/views/index.html
index 94ff6eb..2e32527 100644
--- a/templates/views/index.html
+++ b/templates/views/index.html
@@ -27,27 +27,43 @@
     </form>
 
     <h2>Scoreboards:</h2>
-    <p>
-        <a href="{{base_url}}/scoreboard?mode=blocker&amp;amount=50">top 50 defederating</a> /
-        <a href="{{base_url}}/scoreboard?mode=blocked&amp;amount=50">defederated instances</a> /
-        <a href="{{base_url}}/scoreboard?mode=reference&amp;amount=50">referencing instances</a> /
-        <a href="{{base_url}}/scoreboard?mode=software&amp;amount=50">used software</a> /
-        <a href="{{base_url}}/scoreboard?mode=command&amp;amount=10">commands</a> /
-        <a href="{{base_url}}/scoreboard?mode=error_code&amp;amount=30">error codes</a> /
-        <a href="{{base_url}}/scoreboard?mode=detection_mode&amp;amount=10">detection modes</a> /
-        <a href="{{base_url}}/scoreboard?mode=avg_peers&amp;amount=30">average peers</a> /
-        <a href="{{base_url}}/scoreboard?mode=obfuscator&amp;amount=30">obfuscating software</a> /
-        <a href="{{base_url}}/scoreboard?mode=obfuscation&amp;amount=10">obfuscation statistics</a> /
-        <a href="{{base_url}}/scoreboard?mode=block_level&amp;amount=20">block level statistics</a>
-    </p>
+    <ul class="nav">
+        <li><a href="{{base_url}}/scoreboard?mode=blocker&amp;amount=50">Defederating instances</a></li>
+        <li><a href="{{base_url}}/scoreboard?mode=blocked&amp;amount=50">Defederated instances</a></li>
+        <li><a href="{{base_url}}/scoreboard?mode=reference&amp;amount=50">Referencing instances</a></li>
+        <li><a href="{{base_url}}/scoreboard?mode=software&amp;amount=50">Used software</a></li>
+        <li><a href="{{base_url}}/scoreboard?mode=command&amp;amount=10">Commands</a></li>
+        <li><a href="{{base_url}}/scoreboard?mode=error_code&amp;amount=30">Error codes</a></li>
+        <li><a href="{{base_url}}/scoreboard?mode=detection_mode&amp;amount=10">Detection modes</a></li>
+        <li><a href="{{base_url}}/scoreboard?mode=avg_peers&amp;amount=30">Average peers</a></li>
+        <li><a href="{{base_url}}/scoreboard?mode=obfuscator&amp;amount=30">Obfuscating software</a></li>
+        <li><a href="{{base_url}}/scoreboard?mode=obfuscation&amp;amount=10">Obfuscation statistics</a></li>
+        <li><a href="{{base_url}}/scoreboard?mode=block_level&amp;amount=20">Block level statistics</a></li>
+    </ul>
 {% endblock %}
 {% block footer %}
-    <h2>Infos:</h2>
-    <p>
-        known instances: {{info.known_instances}}<br/>
-        supported instances: {{info.supported_instances}}<br/>
-        blocks recorded: {{info.blocks_recorded}}<br/>
-        erroneous instances: {{info.erroneous_instances}}<br/>
-    </p>
+    <div class="notice">
+        <h3>Infos:</h3>
+        <table>
+        <thead>
+            <tr>
+                <th>Known instances:</th>
+                <th>Supported instances:</th>
+                <th>Blocks recorded:</th>
+                <th>Erroneous instances:</th>
+           </tr>
+       </thead>
+
+       <tbody>
+           <tr>
+               <td>{{info.known_instances}}</td>
+               <td>{{info.supported_instances}}</td>
+               <td>{{info.blocks_recorded}}</td>
+               <td>{{info.erroneous_instances}}</td>
+           </tr>
+        </tbody>
+        </table>
+        </div>
+    </div>
     {{ super() }}
 {% endblock %}
diff --git a/templates/views/scoreboard.html b/templates/views/scoreboard.html
index 15d698d..662ab4e 100644
--- a/templates/views/scoreboard.html
+++ b/templates/views/scoreboard.html
@@ -30,7 +30,7 @@
 
 {% block content %}
     <div class="scoreboard">
-        <table>
+        <table class="with-rows">
             <thead>
                 <th>№</th>
                 <th>{% if mode in ('software', 'avg_peers', 'obfuscator') %}Software{% elif mode == 'obfuscation' %}Obfuscation status{% elif mode == 'detection_mode' %}Detection mode{% elif mode == 'error_code' %}Error code{% else %}Instance{% endif %}</th>
diff --git a/templates/views/top.html b/templates/views/top.html
index 49a64a9..204db6e 100644
--- a/templates/views/top.html
+++ b/templates/views/top.html
@@ -33,9 +33,9 @@
     {% endif %}
 
     {% for block_level in blocklist %}
-        <div class="block_level" id="{{block_level}}">
+        <div class="block_level">
             <h2>{{block_level}} ({{blocklist[block_level]|length}})</h2>
-            <table>
+            <table class="with-rows">
                 <thead>
                     <th>Blocker</th>
                     <th>{% if block_level == 'accept' %}Accepted{% else %}Blocked{% endif %}</th>
-- 
2.39.5