changeset 2459:a66fcc5ce02b

fixes doubleclick to edit, adds linkcls to navtabs for rendering a class for the hyperlink
author sharky93 <rishabhr123@gmail.com>
date Mon, 09 Sep 2013 06:10:58 +0530
parents 898964d397c7
children 3cb8898fd743
files MoinMoin/themes/__init__.py MoinMoin/themes/basic/templates/itemviews.html
diffstat 2 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/themes/__init__.py	Mon Sep 09 06:02:01 2013 +0530
+++ b/MoinMoin/themes/__init__.py	Mon Sep 09 06:10:58 2013 +0530
@@ -98,7 +98,8 @@
                     if endpoint in navtabs_endpoints:
 
                         iconcls = icon[endpoint]
-
+                        linkcls = None
+                        
                         if endpoint == 'special.comments':
                             maincls = "moin-toggle-comments-button"
                             href = "#"
@@ -109,12 +110,12 @@
                             maincls = None
                             # special case for modify item link, this depends on the double click to edit JS
                             if endpoint == 'frontend.modify_item':
-                                maincls = "moin-modify-button"
+                                linkcls = "moin-modify-button"
                             href = url_for(endpoint, item_name=item_name)
                             if endpoint == current_endpoint or (endpoint, current_endpoint) in spl_active:
-                                maincls = maincls + " active" if maincls else "active" 
+                                maincls = "active"
 
-                        navtabs.append((endpoint, href, maincls, iconcls, title, label))
+                        navtabs.append((endpoint, href, maincls, iconcls, linkcls, title, label))
         return navtabs
 
     def get_local_panel(self, item_name):
--- a/MoinMoin/themes/basic/templates/itemviews.html	Mon Sep 09 06:02:01 2013 +0530
+++ b/MoinMoin/themes/basic/templates/itemviews.html	Mon Sep 09 06:10:58 2013 +0530
@@ -6,9 +6,9 @@
 {% block views %}
 
     <ul class="moin-nav nav-tabs moin-shadow">
-      {% for endpoint, href, maincls, iconcls, title, label in navtabs %}
-        <li {% if maincls %}class="{{ maincls }}" {% endif %}>
-            <a href="{{ href }}" title="{{ title }}" rel="nofollow">
+      {% for endpoint, href, maincls, iconcls, linkcls, title, label in navtabs %}
+        <li {% if maincls %}class="{{ maincls }}"{% endif %}>
+            <a {% if linkcls %}class="{{ linkcls }}"{% endif %} href="{{ href }}" title="{{ title }}" rel="nofollow">
               <span class="{{ iconcls }}"></span>
                 {{ label }}
             </a>