Mercurial > moin-mandarin
changeset 38:c192c696da5d
get back the pagepath span
| author | sheep@ghostwheel |
|---|---|
| date | Fri, 09 Oct 2009 23:55:51 +0200 |
| parents | ac99dd4dd30b |
| children | 20f99d203b42 |
| files | mandarin.py |
| diffstat | 1 files changed, 23 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/mandarin.py Fri Oct 09 23:39:30 2009 +0200 +++ b/mandarin.py Fri Oct 09 23:55:51 2009 +0200 @@ -248,6 +248,9 @@ found[pagename] = 1 return u'<ul class="gotobar">%s<li class="clear"></li></ul>' % u' '.join(items) + def pagepath(self, d): + + def title(self, d): """ Assemble the title (now using breadcrumbs) @@ -256,14 +259,8 @@ @return: title html """ _ = self.request.getText - content = [] - if d['title_text'] == d['page'].split_title(): # just showing a page, no action - curpage = '' - segments = d['page_name'].split('/') # was: title_text - for s in segments[:-1]: - curpage += s - content.append(Page(self.request, curpage).link_to(self.request, s)) - curpage += '/' + if d['title_text'] == d['page'].split_title(): + # just showing a page, no action link_text = segments[-1] link_title = _('Click to do a full-text search for this title') link_query = { @@ -272,14 +269,25 @@ 'context': '180', } # we dont use d['title_link'] any more, but make it ourselves: - link = d['page'].link_to(self.request, link_text, querystr=link_query, title=link_title, css_class='backlink', rel='nofollow') - content.append(link) + link = d['page'].link_to(self.request, link_text, + querystr=link_query, title=link_title, + css_class='backlink', rel='nofollow') + content = [] + curpage = '' + segments = d['page_name'].split('/') # was: title_text + if len(segments) <= 1: + html = link + else: + for s in segments[:-1]: + curpage += s + content.append(Page(self.request, + curpage).link_to(self.request, s)) + curpage += '/' + path_html = u'<span class="sep">/</span>'.join(content) + html = '<span class="pagepath">%s</span><span class="sep">/</span>' % (path_html, link) else: - content.append(wikiutil.escape(d['title_text'])) - - location_html = u'<span class="sep">/</span>'.join(content) - html = u'<span id="pagelocation">%s</span>' % location_html - return html + html = wikiutil.escape(d['title_text']) + return u'<span id="pagelocation">%s</span>' % html def html_stylesheets(self, d): try:
