changeset 133:df2368d50468

added location breadcrumbs imported from: moin--main--1.5--patch-135
author Thomas Waldmann <tw@waldmann-edv.de>
date Sun, 23 Oct 2005 14:20:39 +0000
parents 88acc9c18b90
children 95dd6aa5f3e5
files MoinMoin/theme/__init__.py docs/CHANGES
diffstat 2 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/theme/__init__.py	Sun Oct 23 12:59:10 2005 +0000
+++ b/MoinMoin/theme/__init__.py	Sun Oct 23 14:20:39 2005 +0000
@@ -154,14 +154,23 @@
         @return: title html
         """
         _ = self.request.getText
+
         if d['title_link']:
-            content = ('<a title="%(title)s" href="%(href)s">%(text)s</a>') % {
+            content = curpage = ''
+            segments = d['title_text'].split('/')
+            for s in segments[:-1]:
+                curpage += s
+                content = "%s%s/" % (content, Page(self.request, curpage).link_to(self.request, s))
+                curpage += '/'
+
+            content += ('<a class="backlink" title="%(title)s" href="%(href)s">%(text)s</a>') % {
                 'title': _('Click to do a full-text search for this title'),
                 'href': d['title_link'],
-                'text': wikiutil.escape(d['title_text']),
+                'text': wikiutil.escape(segments[-1]),
                 }
         else:
             content = wikiutil.escape(d['title_text'])
+
         html = '''
 <h1 id="title">%s</h1>
 ''' % content
--- a/docs/CHANGES	Sun Oct 23 12:59:10 2005 +0000
+++ b/docs/CHANGES	Sun Oct 23 14:20:39 2005 +0000
@@ -141,6 +141,9 @@
   Other changes/new features:
     * Added PackageInstaller and unzipping support (see HelpOnActions/AttachFile for further details). 
      * Added an PackagePages action to simplify the package creation.
+    * Added location breadcrumbs - when you are on some subpage, the page
+      title parts link to the corresponding parent pages, the last part does
+      the usual reverse linking.
     * added WSGI server support, thanks to Anakim Border, see:
       wiki/server/moinwsgi.py (moin as WSGI app, uses the flup WSGI server,
                                see http://www.saddi.com/software/flup/)