changeset 1683:964fa7d0de32

action menu propagates rev parameter, simplify revision display
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 19 Nov 2006 22:38:41 +0100
parents 30116d7d098a
children aadc8b0e11cf
files MoinMoin/action/info.py MoinMoin/theme/__init__.py docs/CHANGES
diffstat 3 files changed, 18 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/info.py	Sun Nov 19 20:44:41 2006 +0100
+++ b/MoinMoin/action/info.py	Sun Nov 19 22:38:41 2006 +0100
@@ -123,14 +123,8 @@
                 size = page.size(rev=rev)
                 if count == 0: # latest page
                     actions.append(render_action(_('view'), {'action': 'show'}))
-                    actions.append(render_action(_('raw'), {'action': 'raw'}))
-                    actions.append(render_action(_('print'), {'action': 'print'}))
                 else:
                     actions.append(render_action(_('view'), {'action': 'recall', 'rev': '%d' % rev}))
-                    actions.append(render_action(_('raw'), {'action': 'raw', 'rev': '%d' % rev}))
-                    actions.append(render_action(_('print'), {'action': 'print', 'rev': '%d' % rev}))
-                    if may_revert and size: # you can only revert to nonempty revisions
-                        actions.append(render_action(_('revert'), {'action': 'revert', 'rev': '%d' % rev}))
                 if count == 0:
                     rchecked = ' checked="checked"'
                     lchecked = ''
--- a/MoinMoin/theme/__init__.py	Sun Nov 19 20:44:41 2006 +0100
+++ b/MoinMoin/theme/__init__.py	Sun Nov 19 22:38:41 2006 +0100
@@ -2,7 +2,7 @@
 """
     MoinMoin - Theme Package
 
-    @copyright: 2003-2005 by Thomas Waldmann (MoinMoin:ThomasWaldmann)
+    @copyright: 2003-2006 by MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
 """
 
@@ -869,6 +869,7 @@
         """
         request = self.request
         _ = request.getText
+        rev = request.rev
 
         menu = [
             'raw',
@@ -887,6 +888,7 @@
             'SubscribeUser',
             '__separator__',
             'Despam',
+            'revert',
             'PackagePages',
             ]
 
@@ -906,6 +908,7 @@
             'MyPages': _('My Pages', formatted=False),
             'SubscribeUser': _('Subscribe User', formatted=False),
             'Despam': _('Remove Spam', formatted=False),
+            'revert': _('Revert to this revision', formatted=False),
             'PackagePages': _('Package Pages', formatted=False),
             'RenderAsDocbook': _('Render as Docbook', formatted=False),
             }
@@ -962,9 +965,9 @@
         data = {
             'label': titles['__title__'],
             'options': '\n'.join(options),
+            'rev_field': rev and '<input type="hidden" name="rev" value="%d">' % rev or '',
             'do_button': _("Do")
             }
-
         html = '''
 <form class="actionsmenu" method="get" action="">
 <div>
@@ -978,6 +981,7 @@
         %(options)s
     </select>
     <input type="submit" value="%(do_button)s">
+    %(rev_field)s
 </div>
 <script type="text/javascript">
 <!--// Init menu
--- a/docs/CHANGES	Sun Nov 19 20:44:41 2006 +0100
+++ b/docs/CHANGES	Sun Nov 19 22:38:41 2006 +0100
@@ -169,6 +169,18 @@
       acls, speedup Page.get_rev and reading the page local edit-log.
 
   New Features:
+    * The action menu now calls the actions for the revision of the page you
+      are currently viewing. If you are viewing the current page revision, you
+      get the same behaviour as in moin 1.5, but if you are viewing an old
+      page revision, action "raw" will now show you the raw text of this OLD
+      revision (not of the current revision as moin 1.5 did it).
+      Note that not every action does evaluate the rev=XX parameter it gets.
+      Also please note that the edit, info, ... links in the editbar do NOT
+      use the rev parameter, but operate on the latest page revision (as
+      they did in moin 1.5).
+    * Info action lost the links for "raw", "print" and "revert" actions,
+      because you can now just view an old revision and select those actions
+      from the menu there.
     * The standalone server script moved to the toplevel directory. This makes
       it possible to directly start moin.py without additional configuration
       to run a MoinMoin DesktopEdition like wiki setup.