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

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



commit ed618906bb08785075953ae9a47928c7f600207d
Author: hiro <hiro@xxxxxxxxxxxxxx>
Date:   Thu Sep 12 18:09:00 2019 +0200

    Update to breadcrumbs
---
 templates/macros/parent.html | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/templates/macros/parent.html b/templates/macros/parent.html
index 7215499..8447725 100644
--- a/templates/macros/parent.html
+++ b/templates/macros/parent.html
@@ -1,11 +1,20 @@
 {% macro render_parents(item) %}
-
+  {% set vars = {'parent': item.parent, 'item': item } %}
   {% if item.parent %}
     {% for _ in range(1, 5) %}
-      {% set parent = item.parent %}
-      {{ parent }}
-      {{ item }}
-      {% set item = item.parent %}
+      {% if vars.update({'parent': item.parent}) %} {% endif %}
+      {% if vars.parent %}
+        {% if vars.parentvars.parentvars.parent.path == "/" %}
+          {# break #}
+        {% else %}
+          <li class="breadcrumb-item active" aria-current="page">
+            <a href="{{ vars.parent.path|url }}">
+              {{ vars.parentvars.parent.title }}
+            </a>
+          </li>
+        {% endif %}
+      {% endif %}
+      {% if vars.update({'item': vars.parent}) %} {% endif %}
     {% endfor %}
   {% endif %}
 {% endmacro %}

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