changeset 511:8ee8ced7dded

moved UserPreferences back to header, add Cancel button imported from: moin--main--1.5--patch-515
author Thomas Waldmann <tw@waldmann-edv.de>
date Sun, 26 Mar 2006 20:19:38 +0000
parents e1990b501b22
children 3ede5fa7001a
files ChangeLog MoinMoin/action/UserPreferences.py MoinMoin/action/userprefs.py MoinMoin/theme/__init__.py MoinMoin/userform.py docs/CHANGES
diffstat 6 files changed, 60 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Mar 26 18:52:11 2006 +0000
+++ b/ChangeLog	Sun Mar 26 20:19:38 2006 +0000
@@ -2,6 +2,27 @@
 # arch-tag: automatic-ChangeLog--arch@arch.thinkmo.de--2003-archives/moin--main--1.5
 #
 
+2006-03-26 21:19:38 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-515
+
+    Summary:
+      moved UserPreferences back to header, add Cancel button
+    Revision:
+      moin--main--1.5--patch-515
+
+    moved UserPreferences back to header, add Cancel button
+    
+
+    modified files:
+     ChangeLog MoinMoin/theme/__init__.py MoinMoin/userform.py
+     docs/CHANGES
+
+    renamed files:
+     MoinMoin/action/.arch-ids/UserPreferences.py.id
+       ==> MoinMoin/action/.arch-ids/userprefs.py.id
+     MoinMoin/action/UserPreferences.py
+       ==> MoinMoin/action/userprefs.py
+
+
 2006-03-26 19:52:11 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-514
 
     Summary:
--- a/MoinMoin/action/UserPreferences.py	Sun Mar 26 18:52:11 2006 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-# -*- coding: iso-8859-1 -*-
-"""
-    MoinMoin - UserPreferences action
-    
-    This is a simple plugin, that adds a "UserPreferences" action.
-    This action will display the UserPreferences page (or appropriate
-    page in the reader's language), so that the user can login, or
-    change his/her preferences.
-
-    However, as it is an action, the page that is displayed is not 
-    changed. After submitting the form, the user is presented the
-    same page he/she was seeing before, and the trail is not modified.
-
-    @copyright: 2006 by Radomir Dopieralski
-    @license: GNU GPL, see COPYING for details.
-"""
-
-from MoinMoin import wikiutil
-
-def execute(pagename, request):
-    page = wikiutil.getSysPage(request, 'UserPreferences')
-    page.send_page(request)
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/action/userprefs.py	Sun Mar 26 20:19:38 2006 +0000
@@ -0,0 +1,23 @@
+# -*- coding: iso-8859-1 -*-
+"""
+    MoinMoin - UserPreferences action
+    
+    This is a simple plugin, that adds a "UserPreferences" action.
+    This action will display the UserPreferences page (or appropriate
+    page in the reader's language), so that the user can login, or
+    change his/her preferences.
+
+    However, as it is an action, the page that is displayed is not 
+    changed. After submitting the form, the user is presented the
+    same page he/she was seeing before, and the trail is not modified.
+
+    @copyright: 2006 by Radomir Dopieralski
+    @license: GNU GPL, see COPYING for details.
+"""
+
+from MoinMoin import wikiutil
+
+def execute(pagename, request):
+    page = wikiutil.getSysPage(request, 'UserPreferences')
+    page.send_page(request)
+
--- a/MoinMoin/theme/__init__.py	Sun Mar 26 18:52:11 2006 +0000
+++ b/MoinMoin/theme/__init__.py	Sun Mar 26 20:19:38 2006 +0000
@@ -213,11 +213,15 @@
             if not aliasname:
                 aliasname = name
             title = "%s @ %s" % (aliasname, interwiki[0])
+            # link to (interwiki) user homepage
             homelink = (request.formatter.interwikilink(1, title=title, id="userhome", *interwiki) +
                         request.formatter.text(name) +
                         request.formatter.interwikilink(0))
             userlinks.append(homelink)        
-            
+            # link to userprefs action
+            userlinks.append(d['page'].link_to(request, text=_('User Preferences'),
+                                               querystr={'action': 'userprefs'}, id="userprefs"))
+           
         if request.cfg.show_login:
             if request.user.valid:
                 userlinks.append(d['page'].link_to(request, text=_('Logout', formatted=False),
@@ -892,7 +896,6 @@
             'RenamePage',
             'DeletePage',
             '__separator__',
-            'UserPreferences',
             'MyPages',
             'SubscribeUser',
             '__separator__',
@@ -913,7 +916,6 @@
             'DeletePage': _('Delete Page', formatted=False),
             'LikePages': _('Like Pages', formatted=False),
             'LocalSiteMap': _('Local Site Map', formatted=False),
-            'UserPreferences': _('User Preferences', formatted=False),
             'MyPages': _('My Pages', formatted=False),
             'SubscribeUser': _('Subscribe User', formatted=False),
             'Despam': _('Remove Spam', formatted=False),
--- a/MoinMoin/userform.py	Sun Mar 26 18:52:11 2006 +0000
+++ b/MoinMoin/userform.py	Sun Mar 26 20:19:38 2006 +0000
@@ -64,6 +64,9 @@
         _ = self._
         form = self.request.form
     
+        if form.has_key('cancel'):
+            return
+
         if form.has_key('account_sendmail'):
             if not self.cfg.mail_enabled:
                 return _("""This wiki is not enabled for mail processing.
@@ -488,7 +491,7 @@
             self.make_row('', button_cell)
             
         if self.request.user.valid and not create_only:
-            buttons = [('save', _('Save'))]
+            buttons = [('save', _('Save')), ('cancel', _('Cancel')), ]
             uf_remove = self.cfg.user_form_remove
             uf_disable = self.cfg.user_form_disable
             for attr in self.request.user.auth_attribs:
@@ -582,7 +585,8 @@
                 # IMPORTANT: login should be first to be the default
                 # button when a user hits ENTER.
                 #('login', _('Login')),  # we now have a Login macro
-                ("create", _('Create Profile')),
+                ('create', _('Create Profile')),
+                ('cancel', _('Cancel')),
             ]
             for key, label, type, length, textafter in self.cfg.user_form_fields:
                 if key in ('name', 'password', 'password2', 'email'):
--- a/docs/CHANGES	Sun Mar 26 18:52:11 2006 +0000
+++ b/docs/CHANGES	Sun Mar 26 20:19:38 2006 +0000
@@ -36,7 +36,11 @@
 Version 1.5.3-current:
   New Features:
     * modified SystemInfo macro to give human readable units and disk usage
-
+  
+  Other changes:
+    * moved back UserPreferences action link from menu to top of page,
+      added "Cancel" button to make it possible to return to the previous page
+      without saving preferences.
 
 Version 1.5.3-rc1: