diff MoinMoin/theme/__init__.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 3ff40732d217
children df9c332ed6a0
line wrap: on
line diff
--- a/MoinMoin/theme/__init__.py	Wed Oct 07 19:29:45 2009 +0200
+++ b/MoinMoin/theme/__init__.py	Wed Oct 07 19:53:29 2009 +0200
@@ -255,6 +255,39 @@
 ''' % "".join(content)
         return html
 
+    def title_with_separators(self, d):
+        """ Assemble the title using slashes, not <ul>
+
+        @param d: parameter dictionary
+        @rtype: string
+        @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 += '/'
+            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 = d['page'].link_to(self.request, link_text, querystr=link_query, title=link_title, css_class='backlink', rel='nofollow')
+            content.append(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
+
     def username(self, d):
         """ Assemble the username / userprefs link