]> git.ipfire.org Git - ipfire.org.git/commitdiff
dnsbl: Create a separate page that lists all lists
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 Dec 2025 12:51:52 +0000 (12:51 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 Dec 2025 12:51:52 +0000 (12:51 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/templates/base.html
src/templates/dnsbl/index.html
src/templates/dnsbl/lists.html [new file with mode: 0644]
src/web/__init__.py
src/web/dnsbl.py

index b2496c2200a5198e09d3eda69db2e2dc297dc493..f35176958b00219e37f95c86d9fc1240784fe038 100644 (file)
@@ -185,7 +185,8 @@ templates_blog_modulesdir = $(templates_blogdir)/modules
 
 templates_dnsbl_DATA = \
        src/templates/dnsbl/index.html \
-       src/templates/dnsbl/list.html
+       src/templates/dnsbl/list.html \
+       src/templates/dnsbl/lists.html
 
 templates_dnsbldir = $(templatesdir)/dnsbl
 
index f7f21b9a1a6a7e77e68043664d92ef365280f3c5..060c3c70897fe662697febc5ad829ea417ac35bc 100644 (file)
 
                                                                {# DNSBL #}
                                                                {% if request.path.startswith("/dnsbl") %}
+                                                                       <a class="navbar-item is-tab
+                                                                                       {% if request.path.startswith("/dnsbl/lists") %}is-active{% end %}"
+                                                                                       href="/dnsbl/lists">
+                                                                               {{ _("Lists") }}
+                                                                       </a>
+
                                                                        <a class="navbar-item is-tab
                                                                                        {% if request.path.startswith("/dnsbl/how-to-use") %}is-active{% end %}"
                                                                                        href="/dnsbl/how-to-use">
index f51bce51a0d00720c16f2fdd446683f135d3fe19..94a531da5c388241a64df873dbce0c73ec1ae689 100644 (file)
                        </div>
                </div>
        </section>
-
-       <section class="hero">
-               <div class="hero-body">
-                       <div class="container">
-                               {% module DNSBLLists(lists) %}
-                       </div>
-               </div>
-       </section>
 {% end block %}
diff --git a/src/templates/dnsbl/lists.html b/src/templates/dnsbl/lists.html
new file mode 100644 (file)
index 0000000..7c78b96
--- /dev/null
@@ -0,0 +1,37 @@
+{% extends "../base.html" %}
+
+{% block head %}
+       {% module OpenGraph(
+               title=_("IPFire DNSBL - Lists"),
+       ) %}
+{% end block %}
+
+{% block title %}{{ _("IPFire DNSBL") }} - {{ _("Lists") }}{% end block %}
+
+{% block container %}
+       <section class="hero">
+               <div class="hero-body">
+                       <div class="container">
+                               <nav class="breadcrumb" aria-label="breadcrumbs">
+                                       <ul>
+                                               <li>
+                                                       <a href="/dnsbl">
+                                                               {{ _("IPFire DNSBL") }}
+                                                       </a>
+                                               </li>
+
+                                               <li class="is-active">
+                                                       <a href="#" aria-current="page">{{ _("Lists") }}</a>
+                                               </li>
+                                       </ul>
+                               </nav>
+                       </div>
+               </div>
+       </section>
+
+       <section>
+               <div class="container">
+                       {% module DNSBLLists(lists) %}
+               </div>
+       </section>
+{% end block %}
index 67b25f08ad733f3004aff713a3de5014cecea844..f80678f71483c472597769aa6bce2345d85c6275 100644 (file)
@@ -214,7 +214,8 @@ class Application(tornado.web.Application):
                        (r"/location/lookup/(.+)", location.LookupHandler),
 
                        # DNSBL
-                       (r"/dnsbl/?", dnsbl.IndexHandler),
+                       (r"/dnsbl/?", StaticHandler, { "template" : "dnsbl/index.html" }),
+                       (r"/dnsbl/lists", dnsbl.ListsHandler),
                        (r"/dnsbl/lists/(\w+)", dnsbl.ListHandler),
                        (r"/dnsbl/report", dnsbl.SubmitReportHandler),
                        (r"/dnsbl/reports/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})", dnsbl.ReportHandler),
index f66e74961d127457ce88964f69f44b19fab82b0f..c1131b21119d833eadbed4679257682158382c5d 100644 (file)
@@ -12,13 +12,13 @@ class BaseHandler(base.BaseHandler):
                return await self.backend.dnsbl.get_list(slug)
 
 
-class IndexHandler(base.AnalyticsMixin, BaseHandler):
+class ListsHandler(base.AnalyticsMixin, BaseHandler):
        async def get(self):
                # Fetch all lists
                lists = await self.backend.dnsbl.get_lists()
 
                # Render the page
-               self.render("dnsbl/index.html", lists=lists)
+               self.render("dnsbl/lists.html", lists=lists)
 
 
 class ListHandler(base.AnalyticsMixin, BaseHandler):