[tor-commits] [lego/develop] Update to breadcrumbs

hiro at torproject.org hiro at torproject.org
Tue Apr 7 16:13:24 UTC 2020


commit 2efff734ab17d359115fe18688198d56fa8bb5c9
Author: hiro <hiro at torproject.org>
Date:   Thu Sep 12 17:19:20 2019 +0200

    Update to breadcrumbs
---
 templates/breadcrumb.html | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/templates/breadcrumb.html b/templates/breadcrumb.html
index 210cb03..ecb9f88 100644
--- a/templates/breadcrumb.html
+++ b/templates/breadcrumb.html
@@ -1,12 +1,18 @@
 <nav aria-label="breadcrumb">
   <ol class="breadcrumb">
-    {% if this.parent %}
-      <li class="breadcrumb-item active" aria-current="page">
-        <a href="{{ this.parent.path|url }}">
-          {{ this.parent.title }}
-        </a>
-      </li>
-    {% endif %}
+    {% set parent = this.parent %}
+    {% for _ in range(1, 10) %}
+      {% if  parent.path == "/" %}
+        {% break %}
+      {% else %}
+        <li class="breadcrumb-item active" aria-current="page">
+          <a href="{{ parent.path|url }}">
+            {{ parent.title }}
+          </a>
+        </li>
+        {% set parent = parent.parent %}
+      {% endif %}
+    {% endfor %}
     <li class="breadcrumb-item active" aria-current="page">{{ this.title }}</li>
   </ol>
 </nav>





More information about the tor-commits mailing list