changeset 2457:17a40164f8b4

fixes rendering of class in tabs, adds markup support for double click to edit JS
author sharky93 <rishabhr123@gmail.com>
date Mon, 09 Sep 2013 05:56:26 +0530
parents 059b439bea9e
children 898964d397c7
files MoinMoin/themes/__init__.py MoinMoin/themes/basic/templates/itemviews.html MoinMoin/themes/basic/templates/show.html
diffstat 3 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/themes/__init__.py	Mon Sep 09 05:29:54 2013 +0530
+++ b/MoinMoin/themes/__init__.py	Mon Sep 09 05:56:26 2013 +0530
@@ -107,9 +107,12 @@
                             href = "#"
                         else:
                             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"
                             href = url_for(endpoint, item_name=item_name)
                             if endpoint == current_endpoint or (endpoint, current_endpoint) in spl_active:
-                                maincls = "active"
+                                maincls = maincls + " active" if maincls else "active" 
 
                         navtabs.append((endpoint, href, maincls, iconcls, title, label))
         return navtabs
--- a/MoinMoin/themes/basic/templates/itemviews.html	Mon Sep 09 05:29:54 2013 +0530
+++ b/MoinMoin/themes/basic/templates/itemviews.html	Mon Sep 09 05:56:26 2013 +0530
@@ -7,7 +7,7 @@
 
     <ul class="moin-nav nav-tabs moin-shadow">
       {% for endpoint, href, maincls, iconcls, title, label in navtabs %}
-        <li class={% if maincls %} "{{ maincls }}" {% endif %}>
+        <li {% if maincls %} class="{{ maincls }}" {% endif %}>
             <a href="{{ href }}" title="{{ title }}" rel="nofollow">
               <span class="{{ iconcls }}"></span>
                 {{ label }}
--- a/MoinMoin/themes/basic/templates/show.html	Mon Sep 09 05:29:54 2013 +0530
+++ b/MoinMoin/themes/basic/templates/show.html	Mon Sep 09 05:56:26 2013 +0530
@@ -63,6 +63,9 @@
 {% endblock %}
 
 {% block options_for_javascript %}
+{%- if item_name and user.edit_on_doubleclick and user.may.write(item_name) -%}
+    <br id="moin-edit-on-doubleclick" />
+{%- endif %}
 {%- if user.show_comments -%}
     <br id="moin-show-comments" />
 {%- endif %}