changeset 37:ac99dd4dd30b

use title() from gugiel theme
author sheep@ghostwheel
date Fri, 09 Oct 2009 23:39:30 +0200
parents 918f8c5fb15e
children c192c696da5d
files mandarin.py
diffstat 1 files changed, 17 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/mandarin.py	Fri Oct 24 14:32:22 2008 +0000
+++ b/mandarin.py	Fri Oct 09 23:39:30 2009 +0200
@@ -248,27 +248,24 @@
                 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)
+
+        @param d: parameter dictionary
+        @rtype: string
+        @return: title html
+        """
         _ = self.request.getText
         content = []
-        if d['title_text'] == d['page_name']: # just showing a page, no action
-            curpage = u''
-            segments = d['page_name'].split('/')
+        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))
-                content.append("/")
                 curpage += '/'
-        html = '<span class="pagepath">%s</span>' % "".join(content)
-        return html
-
-    def title(self, d):
-        title = d['title_text']
-        _ = self.request.getText
-        if title == d.get('page_name', ''):
-            html = self.pagepath(d)
-            link_text = title.split('/')[-1]
-            link_title = _('Click to do a full-text search for this title', formatted=False)
+            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'],
@@ -276,9 +273,12 @@
             }
             # 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')
-            html += link
+            content.append(link)
         else:
-            html = wikiutil.escape(title)
+            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
 
     def html_stylesheets(self, d):