changeset 2357:20ba81bbe10a

Adds active states to the horizontal nav-tabs
author sharky93 <rishabhr123@gmail.com>
date Fri, 26 Jul 2013 23:16:49 +0530
parents 92fb82ba5906
children 566c2adb1f36
files MoinMoin/themes/basic/templates/itemviews.html
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/themes/basic/templates/itemviews.html	Fri Jul 26 03:16:51 2013 +0530
+++ b/MoinMoin/themes/basic/templates/itemviews.html	Fri Jul 26 23:16:49 2013 +0530
@@ -1,4 +1,5 @@
 {% set exists = storage.has_item(item_name) %}
+{% set current_endpoint = request.endpoint %}
 
 {% block views %}
 
@@ -7,7 +8,7 @@
             {%- if not check_exists or check_exists and exists %}
 
                 {%- if endpoint == 'frontend.show_item' %}
-                    <li>
+                    <li {% if endpoint == current_endpoint %} class="active"{% endif %}>
                         <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                         <span class="icon-eye-open"></span>
                             {{ label }}
@@ -16,7 +17,7 @@
                 {%- endif %}
 
                 {%- if endpoint == 'frontend.modify_item' and user.may.write(item_name) %}
-                    <li>
+                    <li {% if endpoint == current_endpoint %} class="active"{% endif %}>
                         <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                          <span class="icon-pencil"></span>   {{ label }}
                         </a>
@@ -24,7 +25,7 @@
                 {%- endif %}
 
                 {%- if endpoint == 'frontend.history' %}
-                    <li>
+                    <li {% if endpoint == current_endpoint %} class="active"{% endif %}>
                         <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                         <span class="icon-time"></span>
                             {{ label }}
@@ -33,7 +34,7 @@
                 {%- endif %}
 
                 {%- if endpoint == 'frontend.show_item_meta' %}
-                    <li>
+                    <li {% if endpoint == current_endpoint %} class="active"{% endif %}>
                         <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                         <span class="icon-wrench"></span>
                             {{ label }}
@@ -42,7 +43,7 @@
                 {%- endif %}
 
                 {%- if endpoint == 'frontend.highlight_item' %}
-                    <li>
+                    <li {% if endpoint == current_endpoint %} class="active"{% endif %}>
                         <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                         <span class="icon-picture"></span>
                             {{ label }}
@@ -51,7 +52,7 @@
                 {%- endif %}
 
                 {%- if endpoint == 'frontend.backrefs' %}
-                    <li>
+                    <li {% if endpoint == current_endpoint %} class="active"{% endif %}>
                         <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                         <span class="icon-share"></span>
                             {{ label }}