comparison MoinMoin/theme/modernized.py @ 5192:6af8509c5917

move title_with_separators() from Modernized theme to ThemeBase
author Radomir Dopieralski <moindev@sheep.art.pl>
date Wed, 07 Oct 2009 19:53:29 +0200
parents e22cd9105e37
children 75a6d38791e6
comparison
equal deleted inserted replaced
5190:130276d62314 5192:6af8509c5917
94 self.searchform(d), 94 self.searchform(d),
95 self.logo(), 95 self.logo(),
96 self.username(d), 96 self.username(d),
97 u'<h1 id="locationline">', 97 u'<h1 id="locationline">',
98 self.interwiki(d), 98 self.interwiki(d),
99 self.title(d), 99 self.title_with_separators(d),
100 u'</h1>', 100 u'</h1>',
101 self.trail(d), 101 self.trail(d),
102 self.navibar(d), 102 self.navibar(d),
103 #u'<hr id="pageline">', 103 #u'<hr id="pageline">',
104 u'<div id="pageline"><hr style="display:none;"></div>', 104 u'<div id="pageline"><hr style="display:none;"></div>',
167 167
168 # Post footer custom html 168 # Post footer custom html
169 self.emit_custom_html(self.cfg.page_footer2), 169 self.emit_custom_html(self.cfg.page_footer2),
170 ] 170 ]
171 return u'\n'.join(html) 171 return u'\n'.join(html)
172
173 def title(self, d):
174 """ Assemble the title (now using breadcrumbs)
175
176 @param d: parameter dictionary
177 @rtype: string
178 @return: title html
179 """
180 _ = self.request.getText
181 content = []
182 if d['title_text'] == d['page'].split_title(): # just showing a page, no action
183 curpage = ''
184 segments = d['page_name'].split('/') # was: title_text
185 for s in segments[:-1]:
186 curpage += s
187 content.append(Page(self.request, curpage).link_to(self.request, s))
188 curpage += '/'
189 link_text = segments[-1]
190 link_title = _('Click to do a full-text search for this title')
191 link_query = {
192 'action': 'fullsearch',
193 'value': 'linkto:"%s"' % d['page_name'],
194 'context': '180',
195 }
196 # we dont use d['title_link'] any more, but make it ourselves:
197 link = d['page'].link_to(self.request, link_text, querystr=link_query, title=link_title, css_class='backlink', rel='nofollow')
198 content.append(link)
199 else:
200 content.append(wikiutil.escape(d['title_text']))
201
202 location_html = u'<span class="sep">/</span>'.join(content)
203 html = u'<span id="pagelocation">%s</span>' % location_html
204 return html
205 172
206 def username(self, d): 173 def username(self, d):
207 """ Assemble the username / userprefs link 174 """ Assemble the username / userprefs link
208 175
209 @param d: parameter dictionary 176 @param d: parameter dictionary