changeset 296:4e08178a630c

moving logout to a visible place imported from: moin--main--1.5--patch-300
author Thomas Waldmann <tw@waldmann-edv.de>
date Tue, 06 Dec 2005 22:00:52 +0000
parents 91d47ebee530
children fe57f191672e
files MoinMoin/theme/__init__.py MoinMoin/userform.py wiki/htdocs/classic/css/screen.css wiki/htdocs/modern/css/screen.css
diffstat 4 files changed, 46 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/theme/__init__.py	Tue Dec 06 16:50:42 2005 +0000
+++ b/MoinMoin/theme/__init__.py	Tue Dec 06 22:00:52 2005 +0000
@@ -222,10 +222,19 @@
             # Set pref page to localized Preferences page
             title = preferencesPage.split_title(request)
             userlinks.append(preferencesPage.link_to(request, text=title))
-        else:
-            # Add prefpage links with title: Login
-            userlinks.append(preferencesPage.link_to(request, text=_("Login")))
             
+        if 1: # XXX request.cfg.user_login_show:
+            if request.user.valid:
+                #loghtml = preferencesPage.link_to(request, text=_("Logout"))
+                userlinks.append("""\
+<form action="/" method="POST">
+<input type="hidden" name="action" value="userform">
+<input type="submit" name="logout" value="%(logout)s">
+</form>
+""" % { 'logout': _('Logout') }) # XXX add path instead of /
+            else:
+                userlinks.append(preferencesPage.link_to(request, text=_("Login")))
+
         userlinks = [u'<li>%s</li>\n' % link for link in userlinks]
         html = u'<ul id="username">\n%s</ul>' % ''.join(userlinks)
         return html
--- a/MoinMoin/userform.py	Tue Dec 06 16:50:42 2005 +0000
+++ b/MoinMoin/userform.py	Tue Dec 06 22:00:52 2005 +0000
@@ -137,9 +137,8 @@
             
             # Save the user and send a cookie
             self.request.user = theuser
-            self.request.setCookie()           
-        
-        
+            self.request.setCookie()
+
         elif (form.has_key('create') or
               form.has_key('create_only') or
               form.has_key('create_and_mail')):
@@ -496,8 +495,6 @@
 
         if self.request.user.valid and not create_only:
             buttons = [('save', _('Save'))]
-            if self.request.user.auth_method == 'moin_cookie':
-                buttons.append(('logout', _('Logout')))
             uf_remove = self.cfg.user_form_remove
             uf_disable = self.cfg.user_form_disable
             for attr in self.request.user.auth_attribs:
--- a/wiki/htdocs/classic/css/screen.css	Tue Dec 06 16:50:42 2005 +0000
+++ b/wiki/htdocs/classic/css/screen.css	Tue Dec 06 22:00:52 2005 +0000
@@ -83,29 +83,34 @@
 }
 
 #username {
-	margin: 0;
-	padding: 0.25em;
-	text-align: right;
-	font-size: 0.82em;
-	white-space: nowrap;
+    display: inline;
+    padding: 0;
+    text-align: right;
+    font-size: 0.82em;
+    white-space: nowrap;
 }
 
 *[dir="rtl"] #username {
-	text-align: left;
+    text-align: left;
 }
 
 #username li {
-	display: inline;
-	padding: 0 2px;
+    display: inline;
+    padding: 0 0.2em;
 }
 
-#username li:before {
-	content: "| ";
-	color: gray;
+#username form {
+    display: inline;
 }
 
-#username li:first-child:before {
-	content: "";
+#username input {
+    display: inline;
+    padding: 0;
+    margin: 0;
+    border: none;
+    background-color: white; /* inherit is broken on IE */
+    color: brown;
+    font-size: 0.82em;
 }
 
 #pagetrail {
--- a/wiki/htdocs/modern/css/screen.css	Tue Dec 06 16:50:42 2005 +0000
+++ b/wiki/htdocs/modern/css/screen.css	Tue Dec 06 22:00:52 2005 +0000
@@ -70,10 +70,10 @@
 }
 
 #username {
-    margin: 0 10px;
-    padding: 8px 0 0 0;
+    display: inline;
+    padding: 0;
     text-align: right;
-    font-size: 12px;
+    font-size: 0.82em;
     white-space: nowrap;
 }
 
@@ -83,16 +83,21 @@
 
 #username li {
     display: inline;
-    padding: 0 2px;
+    padding: 0 0.2em;
 }
 
-#username li:before {
-    content: "| ";
-    color: black;
+#username form {
+    display: inline;
 }
 
-#username li:first-child:before {
-    content: "";
+#username input {
+    display: inline;
+    padding: 0;
+    margin: 0;
+    border: none;
+    background: #E7E7E7; /* inherit doesnt work on IE */
+    color: blue;
+    font-size: 0.82em;
 }
 
 #searchform {