changeset 3541:8ff53b14fc44

UP icon is back in the iconbar for themes not using clickable title navigation
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 27 Apr 2008 14:36:07 +0200
parents 7bf83cd8da79
children ed8531bc87da
files MoinMoin/config/multiconfig.py MoinMoin/theme/__init__.py docs/CHANGES
diffstat 3 files changed, 25 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/config/multiconfig.py	Sun Apr 27 00:48:03 2008 +0200
+++ b/MoinMoin/config/multiconfig.py	Sun Apr 27 14:36:07 2008 +0200
@@ -452,20 +452,21 @@
     # These icons will show in this order in the iconbar, unless they
     # are not relevant, e.g email icon when the wiki is not configured
     # for email.
-    page_iconbar = ["edit", "view", "diff", "info", "subscribe", "raw", "print", ]
+    page_iconbar = ["up", "edit", "view", "diff", "info", "subscribe", "raw", "print", ]
 
     # Standard buttons in the iconbar
     page_icons_table = {
-        # key           querystr dict, title, icon-key
-        'diff':        ({'action': 'diff'}, _("Diffs"), "diff"),
-        'info':        ({'action': 'info'}, _("Info"), "info"),
-        'edit':        ({'action': 'edit'}, _("Edit"), "edit"),
-        'unsubscribe': ({'action': 'unsubscribe'}, _("UnSubscribe"), "unsubscribe"),
-        'subscribe':   ({'action': 'subscribe'}, _("Subscribe"), "subscribe"),
-        'raw':         ({'action': 'raw'}, _("Raw"), "raw"),
-        'xml':         ({'action': 'show', 'mimetype': 'text/xml'}, _("XML"), "xml"),
-        'print':       ({'action': 'print'}, _("Print"), "print"),
-        'view':        ({}, _("View"), "view"),
+        # key           pagekey, querystr dict, title, icon-key
+        'diff':        ('page', {'action': 'diff'}, _("Diffs"), "diff"),
+        'info':        ('page', {'action': 'info'}, _("Info"), "info"),
+        'edit':        ('page', {'action': 'edit'}, _("Edit"), "edit"),
+        'unsubscribe': ('page', {'action': 'unsubscribe'}, _("UnSubscribe"), "unsubscribe"),
+        'subscribe':   ('page', {'action': 'subscribe'}, _("Subscribe"), "subscribe"),
+        'raw':         ('page', {'action': 'raw'}, _("Raw"), "raw"),
+        'xml':         ('page', {'action': 'show', 'mimetype': 'text/xml'}, _("XML"), "xml"),
+        'print':       ('page', {'action': 'print'}, _("Print"), "print"),
+        'view':        ('page', {}, _("View"), "view"),
+        'up':          ('page_parent_page', {}, _("Up"), "up"),
         }
 
 
--- a/MoinMoin/theme/__init__.py	Sun Apr 27 00:48:03 2008 +0200
+++ b/MoinMoin/theme/__init__.py	Sun Apr 27 14:36:07 2008 +0200
@@ -545,7 +545,7 @@
         @return: html link tag
         """
         qs = {}
-        querystr, title, icon = self.cfg.page_icons_table[which]
+        pagekey, querystr, title, icon = self.cfg.page_icons_table[which]
         qs.update(querystr) # do not modify the querystr dict in the cfg!
         d['icon-alt-text'] = d['title'] = title % d
         d['i18ntitle'] = self.request.getText(d['title'])
@@ -554,7 +554,11 @@
         if rev and which in ['raw', 'print', ]:
             qs['rev'] = str(rev)
         attrs = {'rel': 'nofollow', 'title': d['i18ntitle'], }
-        page = d['page']
+        page = d[pagekey]
+        if isinstance(page, unicode):
+            # e.g. d['page_parent_page'] is just the unicode pagename
+            # while d['page'] will give a page object
+            page = Page(self.request, page)
         return page.link_to_raw(self.request, text=img_src, querystr=qs, **attrs)
 
     def msg(self, d):
--- a/docs/CHANGES	Sun Apr 27 00:48:03 2008 +0200
+++ b/docs/CHANGES	Sun Apr 27 14:36:07 2008 +0200
@@ -28,6 +28,13 @@
     and improving it and after having made a backup with some other, proven
     method. USE BOTH ON YOUR OWN RISK!
 
+Version 1.6.current:
+  Fixes:
+    * The iconbar "up" icon (known from 1.5) is back. Although it is not too
+      useful if you use themes that have the navigation in the page title,
+      it is useful for themes not using that kind of navigation.
+
+
   * For the jabber notification bot, you need a development version 
     of pyxmpp, 1.0 won't work. You can get it directly from svn repository: