diff MoinMoin/themes/__init__.py @ 2448:7fb6bff63aa0

fixes #64, discussion moved under item_navigation
author sharky93 <rishabhr123@gmail.com>
date Sun, 08 Sep 2013 16:49:56 +0530
parents 10666a449e7b
children 1691455778f1
line wrap: on
line diff
--- a/MoinMoin/themes/__init__.py	Sun Sep 08 16:33:51 2013 +0530
+++ b/MoinMoin/themes/__init__.py	Sun Sep 08 16:49:56 2013 +0530
@@ -115,10 +115,10 @@
 
     def get_local_panel(self, item_name):
         user_actions_endpoints = ['frontend.quicklink_item', 'frontend.subscribe_item', ]
-        item_navigation_endpoints = ['frontend.index', 'frontend.sitemap', ]
+        item_navigation_endpoints = ['frontend.index', 'frontend.sitemap', 'special.supplementation']
         item_actions_endpoints = ['frontend.rename_item', 'frontend.delete_item', 'frontend.destroy_item',
                 'frontend.similar_names', 'frontend.download_item', 
-                'frontend.copy_item', 'special.supplementation'] if self.user.may.write(item_name) else []
+                'frontend.copy_item',] if self.user.may.write(item_name) else []
 
         user_actions = []
         item_navigation = []
@@ -151,6 +151,13 @@
 
                         iconcls = icon[endpoint]
 
+                        href = url_for(endpoint, item_name=item_name)
+                        item_actions.append((endpoint, href, iconcls, label, title))
+
+                    elif endpoint in item_navigation_endpoints:
+
+                        iconcls = icon[endpoint]
+                        
                         if endpoint == 'special.supplementation':
                             for sub_item_name in app.cfg.supplementation_item_names:
                                 current_sub = item_name.rsplit('/', 1)[-1]
@@ -161,17 +168,10 @@
                                         label = _(sub_item_name)
                                         title = None
 
-                                        item_actions.append((endpoint, href, iconcls, label, title))
+                                        item_navigation.append((endpoint, href, iconcls, label, title))
                         else:
-                            href = url_for(endpoint, item_name=item_name)
-                            item_actions.append((endpoint, href, iconcls, label, title))
-
-                    elif endpoint in item_navigation_endpoints:
-
-                        iconcls = icon[endpoint]
-                        href = url_for(endpoint, item_name=item_name)
-
-                        item_navigation.append((endpoint, href, iconcls, label, title))
+                            href = url_for(endpoint, item_name=item_name)   
+                            item_navigation.append((endpoint, href, iconcls, label, title))
 
         return user_actions, item_navigation, item_actions