comparison 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
comparison
equal deleted inserted replaced
2447:3ea4fb4d4a6f 2448:7fb6bff63aa0
113 navtabs.append((endpoint, href, maincls, iconcls, title, label)) 113 navtabs.append((endpoint, href, maincls, iconcls, title, label))
114 return navtabs 114 return navtabs
115 115
116 def get_local_panel(self, item_name): 116 def get_local_panel(self, item_name):
117 user_actions_endpoints = ['frontend.quicklink_item', 'frontend.subscribe_item', ] 117 user_actions_endpoints = ['frontend.quicklink_item', 'frontend.subscribe_item', ]
118 item_navigation_endpoints = ['frontend.index', 'frontend.sitemap', ] 118 item_navigation_endpoints = ['frontend.index', 'frontend.sitemap', 'special.supplementation']
119 item_actions_endpoints = ['frontend.rename_item', 'frontend.delete_item', 'frontend.destroy_item', 119 item_actions_endpoints = ['frontend.rename_item', 'frontend.delete_item', 'frontend.destroy_item',
120 'frontend.similar_names', 'frontend.download_item', 120 'frontend.similar_names', 'frontend.download_item',
121 'frontend.copy_item', 'special.supplementation'] if self.user.may.write(item_name) else [] 121 'frontend.copy_item',] if self.user.may.write(item_name) else []
122 122
123 user_actions = [] 123 user_actions = []
124 item_navigation = [] 124 item_navigation = []
125 item_actions = [] 125 item_actions = []
126 126
149 149
150 elif endpoint in item_actions_endpoints: 150 elif endpoint in item_actions_endpoints:
151 151
152 iconcls = icon[endpoint] 152 iconcls = icon[endpoint]
153 153
154 href = url_for(endpoint, item_name=item_name)
155 item_actions.append((endpoint, href, iconcls, label, title))
156
157 elif endpoint in item_navigation_endpoints:
158
159 iconcls = icon[endpoint]
160
154 if endpoint == 'special.supplementation': 161 if endpoint == 'special.supplementation':
155 for sub_item_name in app.cfg.supplementation_item_names: 162 for sub_item_name in app.cfg.supplementation_item_names:
156 current_sub = item_name.rsplit('/', 1)[-1] 163 current_sub = item_name.rsplit('/', 1)[-1]
157 if current_sub not in app.cfg.supplementation_item_names: 164 if current_sub not in app.cfg.supplementation_item_names:
158 supp_name = '%s/%s' % (item_name, sub_item_name) 165 supp_name = '%s/%s' % (item_name, sub_item_name)
159 if flaskg.storage.has_item(supp_name) or flaskg.user.may.write(supp_name): 166 if flaskg.storage.has_item(supp_name) or flaskg.user.may.write(supp_name):
160 href = url_for('frontend.show_item', item_name=supp_name) 167 href = url_for('frontend.show_item', item_name=supp_name)
161 label = _(sub_item_name) 168 label = _(sub_item_name)
162 title = None 169 title = None
163 170
164 item_actions.append((endpoint, href, iconcls, label, title)) 171 item_navigation.append((endpoint, href, iconcls, label, title))
165 else: 172 else:
166 href = url_for(endpoint, item_name=item_name) 173 href = url_for(endpoint, item_name=item_name)
167 item_actions.append((endpoint, href, iconcls, label, title)) 174 item_navigation.append((endpoint, href, iconcls, label, title))
168
169 elif endpoint in item_navigation_endpoints:
170
171 iconcls = icon[endpoint]
172 href = url_for(endpoint, item_name=item_name)
173
174 item_navigation.append((endpoint, href, iconcls, label, title))
175 175
176 return user_actions, item_navigation, item_actions 176 return user_actions, item_navigation, item_actions
177 177
178 def get_endpoint_iconmap(self): 178 def get_endpoint_iconmap(self):
179 icon = {'frontend.quicklink_item' : "icon-star-empty", 179 icon = {'frontend.quicklink_item' : "icon-star-empty",