]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 22 Jun 2023 15:00:42 +0000 (17:00 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 22 Jun 2023 15:00:42 +0000 (17:00 +0200)
- moved links to "include" template and generalized them there

templates/views/scoreboard.html
templates/views/top.html
templates/widgets/links.tpl [new file with mode: 0644]

index 46d58076dbb8ab98761b22c609756333dca6f894..12fa8b6f5137da1ef36f3dace97c5fe37cf55377 100644 (file)
@@ -37,8 +37,9 @@
                         {% elif entry['domain'] == None %}
                             -
                         {% else %}
-                            <a href="{{base_url}}/top?{% if mode == 'blocker' %}reverse{% elif mode in('blocked', 'reference') %}domain{% endif %}={{entry['domain']}}" rel="nofollow noopener noreferrer">{{entry['domain']}}</a>&nbsp;
-                            <a class="listlink" href="https://{{entry['domain']}}" rel="external" target="_blank">↗</a>
+                            {% with domain=entry['domain'] %}
+                            {% include "widgets/links.tpl" %}
+                            {% endwith %}
                         {% endif %}
                     </td>
                     <td>{{entry['score']}}</td>
index a395a892bfb28f3c8e0ffc7f3d93ebb395883c1e..0489ba4ab53abb8e9dc8328ecc5d5ec44e57b936 100644 (file)
                 {% for block in blocks[block_level] %}
                     <tr>
                         <td>
-                            <a href="https://{{block['blocker']}}" rel="nofollow noopener noreferrer">{{block['blocker']}}</a>
-                            {% if reason or domain %}<a class="listlink" href="{{base_url}}/top?reverse={{block['blocker']}}">↘</a>{% endif %}
+                            {% with domain=block['blocker'] %}
+                            {% include "widgets/links.tpl" %}
+                            {% endwith %}
                         </td>
                         <td>
-                            <a href="https://{{domain or block['blocked']}}" rel="nofollow noopener noreferrer">{{block['blocked']}}</a>
-                            {% if reason or reverse %}<a class="listlink" href="{{base_url}}/top?domain={{domain or block['blocked']}}">↘</a>{% endif %}
+                            {% with domain=block['blocked'] %}
+                            {% include "widgets/links.tpl" %}
+                            {% endwith %}
                         </td>
                         <td>{{block['reason']}}</td>
                         <td>{{block['first_seen']}}</td>
diff --git a/templates/widgets/links.tpl b/templates/widgets/links.tpl
new file mode 100644 (file)
index 0000000..f0499fa
--- /dev/null
@@ -0,0 +1,3 @@
+<a href="https://{{domain}}" rel="nofollow noopener noreferrer">{{domain}}</a>
+[<a class="listlink" href="{{base_url}}/top?reverse={{domain}}" title="Search {{domain}}">D</a>]
+[<a class="listlink" href="{{base_url}}/top?reverse={{domain}}" title="Reverse search {{domain}}">R</a>]