changeset 2258:904c649f2746

Changed name to fqname in itemviews.html, updating links in the action bar.
author Ashutosh Singla <ashu1461@gmail.com>
date Wed, 11 Sep 2013 10:07:52 +0530
parents a39955ac972f
children d92720cc23c6
files MoinMoin/templates/itemviews.html
diffstat 1 files changed, 13 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/templates/itemviews.html	Fri Sep 06 01:07:03 2013 +0530
+++ b/MoinMoin/templates/itemviews.html	Wed Sep 11 10:07:52 2013 +0530
@@ -1,4 +1,4 @@
-{% set exists = storage.has_item(item_name) %}
+{% set exists = storage.get_item(**fqname.query) %}
 <ul class="moin-itemviews panel">
     {%- 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 %}
@@ -9,27 +9,26 @@
                 'frontend.similar_names', 'frontend.copy_item',
             ] %}
                 <li>
-                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">{{ label }}</a>
+                    <a href="{{ url_for(endpoint, item_name=fqname) }}" title="{{ title }}" rel="nofollow">{{ label }}</a>
                 </li>
             {%- endif %}
-
-            {%- if endpoint == 'frontend.modify_item' and user.may.write(item_name) %}
+            {%- if endpoint == 'frontend.modify_item' and user.may.write(fqname) %}
                 <li>
-                    <a class="moin-modify-button" href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">{{ label }}</a>
+                    <a class="moin-modify-button" href="{{ url_for(endpoint, item_name=fqname) }}" title="{{ title }}" rel="nofollow">{{ label }}</a>
                 </li>
             {%- endif %}
 
             {%- if endpoint in [
                 'frontend.rename_item', 'frontend.delete_item',
-            ] and user.may.write(item_name) %}
+            ] and user.may.write(fqname) %}
                 <li>
-                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">{{ label }}</a>
+                    <a href="{{ url_for(endpoint, item_name=fqname) }}" title="{{ title }}" rel="nofollow">{{ label }}</a>
                 </li>
             {%- endif %}
 
-            {%- if endpoint == 'frontend.destroy_item' and user.may.destroy(item_name) %}
+            {%- if endpoint == 'frontend.destroy_item' and user.may.destroy(fqname) %}
                 <li>
-                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">{{ label }}</a>
+                    <a href="{{ url_for(endpoint, item_name=fqname) }}" title="{{ title }}" rel="nofollow">{{ label }}</a>
                 </li>
             {%- endif %}
 
@@ -44,8 +43,8 @@
 
             {%- if endpoint == 'frontend.quicklink_item' and user.valid %}
                 <li>
-                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
-                        {%- if user.is_quicklinked_to([item_name]) %}
+                    <a href="{{ url_for(endpoint, item_name=fqname) }}" title="{{ title }}" rel="nofollow">
+                        {%- if user.is_quicklinked_to([fqname]) %}
                             {{ _('Remove Link') }}
                         {%- else %}
                             {{ _('Add Link') }}
@@ -56,8 +55,8 @@
 
             {%- if endpoint == 'frontend.subscribe_item' and user.valid %}
                 <li>
-                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
-                        {%- if user.is_subscribed_to([item_name]) %}
+                    <a href="{{ url_for(endpoint, item_name=fqname) }}" title="{{ title }}" rel="nofollow">
+                        {%- if user.is_subscribed_to([fqname]) %}
                             {{ _('Unsubscribe') }}
                         {%- else %}
                             {{ _('Subscribe') }}
@@ -82,7 +81,7 @@
                 {%- for sub_item_name in cfg.supplementation_item_names %}
                     {%- set current_sub = item_name.rsplit('/', 1)[-1] %}
                     {%- if not current_sub in cfg.supplementation_item_names %}
-                        {%- set supp_name = '%s/%s' % (item_name, sub_item_name) %}
+                        {%- set supp_name = '%s/%s/%s' % (fqname.namespace, item_name, sub_item_name) %}
                         {%- if storage.has_item(supp_name) or user.may.write(supp_name) %}
                             <li>
                                 <a href="{{ url_for('frontend.show_item', item_name=supp_name) }}" rel="nofollow">{{ _(sub_item_name) }}</a>