# HG changeset patch # User David Douard # Date 1399281959 -7200 # Node ID 3d7e500a020227458e9d170c2fa9b022ff4cefad # Parent 78ab2b14048a6f6f79813163c24ded5eecf5f6ca [views] use icons for user menu and login (header) (closes #3803684) - use icons from the embedded pictograms font for: - authenticated user menu (userActionsBox) - login (CookieLoginComponent) - do not display "anonymous" when not logged in diff -r 78ab2b14048a -r 3d7e500a0202 web/views/basecomponents.py --- a/web/views/basecomponents.py Thu Dec 04 11:37:18 2014 +0100 +++ b/web/views/basecomponents.py Mon May 05 11:25:59 2014 +0200 @@ -119,8 +119,8 @@ & configuration_values('auth-mode', 'cookie')) context = 'header-right' loginboxid = 'popupLoginBox' - _html = u"""[%s]""" + _html = u"""%s""" def render(self, w): # XXX bw compat, though should warn about subclasses redefining call @@ -128,6 +128,7 @@ self.call() def call(self): + self._cw.add_css('cubicweb.pictograms.css') self.w(self._html % (self._cw._('login / password'), self.loginboxid, self._cw._('i18n_login_popup'))) self._cw.view('logform', rset=self.cw_rset, id=self.loginboxid, @@ -160,17 +161,17 @@ order = HeaderComponent.order - 10 def render(self, w): - w(u'%s' % self._cw._('anonymous')) - + pass class AuthenticatedUserStatus(AnonUserStatusLink): __select__ = authenticated_user() def render(self, w): # display useractions and siteactions + self._cw.add_css('cubicweb.pictograms.css') actions = self._cw.vreg['actions'].possible_actions(self._cw, rset=self.cw_rset) box = MenuWidget('', 'userActionsBox', _class='', islist=False) - menu = PopupBoxMenu(self._cw.user.login, isitem=False) + menu = PopupBoxMenu(self._cw.user.login, isitem=False, link_class='icon-user') box.append(menu) for action in actions.get('useractions', ()): menu.append(self.action_link(action))