changeset 42:0a757ec96d95

clean up the title function
author sheep@ghostwheel
date Sat, 10 Oct 2009 00:02:11 +0200
parents 313b54608b28
children b89bdf6201bd
files mandarin.py
diffstat 1 files changed, 6 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mandarin.py	Fri Oct 09 23:59:05 2009 +0200
+++ b/mandarin.py	Sat Oct 10 00:02:11 2009 +0200
@@ -258,30 +258,26 @@
         _ = self.request.getText
         if d['title_text'] == d['page'].split_title():
             # just showing a page, no action
-            content = []
-            curpage = ''
-            segments = d['page_name'].split('/') # was: title_text
+            segments = d['page_name'].split('/')
             link_text = segments[-1]
             link_title = _('Click to do a full-text search for this title')
-            link_query = {
-                'action': 'fullsearch',
-                'value': 'linkto:"%s"' % d['page_name'],
-                'context': '180',
-            }
-            # we dont use d['title_link'] any more, but make it ourselves:
+            link_query = { 'action': 'fullsearch', 'context': '180',
+                            'value': 'linkto:"%s"' % d['page_name'], }
             link = d['page'].link_to(self.request, link_text,
                                      querystr=link_query, title=link_title,
                                      css_class='backlink', rel='nofollow')
             if len(segments) <= 1:
                 html = link
             else:
+                content = []
+                curpage = ''
                 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>%s' % (path_html, link)
+                html = u'<span class="pagepath">%s</span><span class="sep">/</span>%s' % (path_html, link)
         else:
             html = wikiutil.escape(d['title_text'])
         return u'<span id="pagelocation">%s</span>' % html