changeset 2372:8c42ddfa2581

Adds location breadcrumbs
author sharky93 <rishabhr123@gmail.com>
date Thu, 08 Aug 2013 19:30:00 +0530
parents 1422a4849787
children bc51dd4c686a
files MoinMoin/themes/basic/templates/show.html
diffstat 1 files changed, 33 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/themes/basic/templates/show.html	Thu Aug 08 17:45:49 2013 +0530
+++ b/MoinMoin/themes/basic/templates/show.html	Thu Aug 08 19:30:00 2013 +0530
@@ -8,6 +8,39 @@
 {% endblock %}
 
 {% block content %}
+    {% block location_breadcrumbs %}
+       {% for segment_name, segment_path, exists in theme_supp.location_breadcrumbs(item_name) -%}
+        {% set url = url_for('frontend.show_item', item_name=segment_path) %}
+        {% if loop.first -%}
+        <h4>
+            {% if url != current_url %}
+                <small>
+            {% endif %}
+            <a href="{{ url }}" {% if not exists %}class="moin-nonexistent"{% endif %}>
+                {{ segment_name|shorten_item_name }}
+            </a>
+            {% if url != current_url %}
+               </small>
+            {% endif %}
+        {% else %}
+            <span class="sep">/</span>
+            {% if title_name %}
+                {{ title_name }}
+            {% else %}
+                {% if url != current_url %}
+                    <small>
+                {% endif %}
+                <a href="{{ url }}" {% if not exists %}class="moin-nonexistent"{% endif %}>
+                    {{ segment_name|shorten_item_name }}
+                </a>
+                {% if url != current_url %}
+                    </small>
+                {% endif %}                
+            {%- endif %}
+        {%- endif %}
+       {% endfor %}
+        </h4>
+    {% endblock %}
 
     {% block content_data %}
         {% if data_rendered %}