changeset 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 130276d62314
children 97bd2f295376
files MoinMoin/theme/__init__.py MoinMoin/theme/modernized.py
diffstat 2 files changed, 34 insertions(+), 34 deletions(-) [+]
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
 
--- a/MoinMoin/theme/modernized.py	Wed Oct 07 19:29:45 2009 +0200
+++ b/MoinMoin/theme/modernized.py	Wed Oct 07 19:53:29 2009 +0200
@@ -96,7 +96,7 @@
             self.username(d),
             u'<h1 id="locationline">',
             self.interwiki(d),
-            self.title(d),
+            self.title_with_separators(d),
             u'</h1>',
             self.trail(d),
             self.navibar(d),
@@ -170,39 +170,6 @@
             ]
         return u'\n'.join(html)
 
-    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'].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