comparison MoinMoin/themes/__init__.py @ 150:d3deda1731fb

configure navi_bar using tuples saves us from first having to parse to stuff - faster it is also more flexible as one can easily link to any endpoint with any params move the global views from item_views to default navi_bar remove now wrong navi_bar docs
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 20 Mar 2011 22:06:11 +0100
parents 751ebb4ff42b
children e8f61cbd661b
comparison
equal deleted inserted replaced
149:601b8be0ced6 150:d3deda1731fb
202 202
203 :rtype: list 203 :rtype: list
204 :returns: list of tuples (css_class, url, link_text, title) 204 :returns: list of tuples (css_class, url, link_text, title)
205 """ 205 """
206 flaskg.clock.start('navibar') 206 flaskg.clock.start('navibar')
207 items = [] # navibar items
208 current = item_name 207 current = item_name
209
210 # Process config navi_bar 208 # Process config navi_bar
211 for text in self.cfg.navi_bar: 209 items = [(cls, url_for(endpoint, **args), link_text, title)
212 url, link_text, title = self.split_navilink(text) 210 for cls, endpoint, args, link_text, title in self.cfg.navi_bar]
213 items.append(('wikilink', url, link_text, title))
214 211
215 # Add user links to wiki links. 212 # Add user links to wiki links.
216 userlinks = self.user.getQuickLinks() 213 userlinks = self.user.getQuickLinks()
217 for text in userlinks: 214 for text in userlinks:
218 url, link_text, title = self.split_navilink(text) 215 url, link_text, title = self.split_navilink(text)