changeset 1221:578b70ffc60b

Check the check_exists flag for every endpoint and removed duplicate 'frontend.rename_item' from a list. Fixes #108
author Julian Brost <julian.brost@googlemail.com>
date Sun, 08 Jan 2012 03:09:12 +0100
parents cb16a89fcd49
children e96932c3a557
files MoinMoin/config/default.py MoinMoin/templates/itemviews.html
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/config/default.py	Sat Jan 07 23:53:45 2012 +0100
+++ b/MoinMoin/config/default.py	Sun Jan 08 03:09:12 2012 +0100
@@ -370,8 +370,8 @@
         ('special.comments', L_('Comments'), L_('Switch showing comments on or off'), True, ),
         ('frontend.highlight_item', L_('Highlight'), L_('Show with Syntax-Highlighting'), True, ),
         ('frontend.show_item_meta', L_('Meta'), L_('Display Metadata'), True, ),
-        ('frontend.quicklink_item', None, L_('Create or remove a navigation link to this item'), True, ),
-        ('frontend.subscribe_item', None, L_('Switch notifications about item changes on or off'), True, ),
+        ('frontend.quicklink_item', None, L_('Create or remove a navigation link to this item'), False, ),
+        ('frontend.subscribe_item', None, L_('Switch notifications about item changes on or off'), False, ),
         ('frontend.rename_item', L_('Rename'), L_('Rename this item'), True, ),
         ('frontend.delete_item', L_('Delete'), L_('Delete this item'), True, ),
         ('frontend.destroy_item', L_('Destroy'), L_('Completely destroy this item'), True, ),
--- a/MoinMoin/templates/itemviews.html	Sat Jan 07 23:53:45 2012 +0100
+++ b/MoinMoin/templates/itemviews.html	Sun Jan 08 03:09:12 2012 +0100
@@ -1,7 +1,8 @@
 {% set exists = storage.has_item(item_name) %}
 <ul class="moin-itemviews">
     {% for endpoint, label, title, check_exists in cfg.item_views if not endpoint in cfg.endpoints_excluded %}
-        {% if (not check_exists or check_exists and exists) and endpoint in [
+      {% if not check_exists or check_exists and exists %}
+        {% if endpoint in [
                'frontend.show_item', 'frontend.index',
                'frontend.highlight_item', 'frontend.show_item_meta', 'frontend.download_item',
                'frontend.history', 'frontend.backrefs', 'frontend.sitemap',
@@ -14,7 +15,7 @@
         {%- endif %}
 
 		{% if endpoint in [
-            'frontend.modify_item', 'frontend.rename_item', 'frontend.delete_item', 'frontend.rename_item'
+            'frontend.modify_item', 'frontend.rename_item', 'frontend.delete_item'
            ] and user.may.write(item_name) -%}
             <li>
             <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow"> {{ label }}</a>
@@ -77,5 +78,6 @@
                 {%- endif %}
             {%- endfor -%}
         {%- endif %}
+      {% endif %}
     {% endfor %}
 </ul>