changeset 2331:a641c863e177

Better variable name, more concise code, as per comments on commit #5d61b26
author sharky93 <rishabhr123@gmail.com>
date Thu, 18 Jul 2013 13:11:09 +0530
parents 8a9261986b6a
children 1e83a7aad10e
files MoinMoin/themes/basic/templates/layout.html
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/themes/basic/templates/layout.html	Tue Jul 16 23:36:47 2013 +0530
+++ b/MoinMoin/themes/basic/templates/layout.html	Thu Jul 18 13:11:09 2013 +0530
@@ -4,9 +4,9 @@
 {% set logo = snippets.logo() %}
 
 {% if item_name in ['@NONAMEGIVEN',''] %}
-{% set index = url_for(request.endpoint) %}
+{% set current_url = url_for(request.endpoint) %}
 {% else %}
-{% set index = url_for_item(endpoint = request.endpoint, item_name = item_name) %}
+{% set current_url = url_for_item(endpoint = request.endpoint, item_name = item_name) %}
 {% endif %}
 
 {% block layout %}
@@ -81,11 +81,7 @@
                         <li class="nav-header">Site Navigation</li>
                         {% for cls, url, text, title in navibar_items %}
                             {% if cls != 'userlink' %}
-                            {% if url == index %}
-                                <li class="{{ cls }} active">
-                            {% else %}
-                                <li class="{{ cls }}">
-                            {% endif %}
+                            <li class="{{ cls }}{% if url == current_url %} active{% endif %}">
                             <a href="{{ url }}" {% if title %}title="{{ title }}"{% endif %}>{{ text }}</a>
                             </li>
                             {% endif %}