[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit 97194ff8adaa0c9f9a59515a016215b87c7550e7
Author: hiro <hiro@xxxxxxxxxxxxxx>
Date:   Thu Sep 12 17:36:58 2019 +0200

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

diff --git a/templates/breadcrumb.html b/templates/breadcrumb.html
index ecb9f88..bf6ca88 100644
--- a/templates/breadcrumb.html
+++ b/templates/breadcrumb.html
@@ -1,18 +1,22 @@
 <nav aria-label="breadcrumb">
   <ol class="breadcrumb">
-    {% 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 %}
+    {% if this.parent %}
+      {% set parent = this.parent %}
+      {% for _ in range(1, 5) %}
+        {% if parent %}
+          {% 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 %}
+        {% endif %}
+      {% endfor %}
+    {% endif %}
     <li class="breadcrumb-item active" aria-current="page">{{ this.title }}</li>
   </ol>
 </nav>

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits