From 4596072ef820f7cf2ecedb2621e1276b66d819d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 22 Jun 2023 17:00:42 +0200 Subject: [PATCH] Continued: - moved links to "include" template and generalized them there --- templates/views/scoreboard.html | 5 +++-- templates/views/top.html | 10 ++++++---- templates/widgets/links.tpl | 3 +++ 3 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 templates/widgets/links.tpl diff --git a/templates/views/scoreboard.html b/templates/views/scoreboard.html index 46d5807..12fa8b6 100644 --- a/templates/views/scoreboard.html +++ b/templates/views/scoreboard.html @@ -37,8 +37,9 @@ {% elif entry['domain'] == None %} - {% else %} - {{entry['domain']}}  - ↗ + {% with domain=entry['domain'] %} + {% include "widgets/links.tpl" %} + {% endwith %} {% endif %} {{entry['score']}} diff --git a/templates/views/top.html b/templates/views/top.html index a395a89..0489ba4 100644 --- a/templates/views/top.html +++ b/templates/views/top.html @@ -38,12 +38,14 @@ {% for block in blocks[block_level] %} - {{block['blocker']}} - {% if reason or domain %}↘{% endif %} + {% with domain=block['blocker'] %} + {% include "widgets/links.tpl" %} + {% endwith %} - {{block['blocked']}} - {% if reason or reverse %}↘{% endif %} + {% with domain=block['blocked'] %} + {% include "widgets/links.tpl" %} + {% endwith %} {{block['reason']}} {{block['first_seen']}} diff --git a/templates/widgets/links.tpl b/templates/widgets/links.tpl new file mode 100644 index 0000000..f0499fa --- /dev/null +++ b/templates/widgets/links.tpl @@ -0,0 +1,3 @@ +{{domain}} +[D] +[R] -- 2.39.5