--- moin-theme-balanced-0.5/balanced.py 2009-12-31 13:41:47.428980923 +0000 +++ moin-theme-balanced-0.5/balanced.py 2009-12-31 13:42:47.209982944 +0000 @@ -233,25 +233,41 @@ """ request = self.request _ = request.getText - preferencesPage = wikiutil.getLocalizedPage(request, 'UserPreferences') helpPage = wikiutil.getLocalizedPage(request, 'HelpContents') userlinks = [] # Add username/homepage link for registered users. We don't care # if it exists, the user can create it. - if request.user.valid: - homepage = Page(request, request.user.name) - title = homepage.split_title(request) - homelink = homepage.link_to(request, text=title) - userlinks.append(homelink) - # Set pref page to localized Preferences page - title = preferencesPage.split_title(request) - userlinks.append(preferencesPage.link_to(request, text=title)) + if request.user.valid and request.user.name: + interwiki = wikiutil.getInterwikiHomePage(request) + name = request.user.name + aliasname = request.user.aliasname + 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", generated=True, *interwiki) + + request.formatter.text(name) + + request.formatter.interwikilink(0, title=title, id="userhome", *interwiki)) + userlinks.append(homelink) + # link to userprefs and logout actions + if 'userprefs' not in self.request.cfg.actions_excluded: + userlinks.append(d['page'].link_to(request, text=_('Settings'), + querystr={'action': 'userprefs'}, id='userprefs', rel='nofollow')) + if request.user.auth_method in request.cfg.auth_can_logout: + userlinks.append(d['page'].link_to(request, text=_('Logout'), + querystr={'action': 'logout', 'logout': 'logout'}, id='logout', rel='nofollow')) + userlinks.append(helpPage.link_to(request, text=_("Help"))) else: - # Add prefpage links with title: Login - userlinks.append(preferencesPage.link_to(request, text=_("Login"))) - + query = {'action': 'login'} + # special direct-login link if the auth methods want no input + if request.cfg.auth_login_inputs == ['special_no_input']: + query['login'] = '1' + if request.cfg.auth_have_login: + userlinks.append(d['page'].link_to(request, text=_("Login"), + querystr=query, id='login', rel='nofollow')) + userlinks = [u'