[ui] display author name in box instead of login (closes #1529147) stable
authorArthur Lutz <arthur.lutz@logilab.fr>
Wed, 23 May 2012 11:00:29 +0200
branchstable
changeset 8416 e7f06e562a27
parent 8415 ae9310e4c2b3
child 8417 24409e9c7c66
[ui] display author name in box instead of login (closes #1529147)
web/views/baseviews.py
--- a/web/views/baseviews.py	Wed May 23 10:52:42 2012 +0200
+++ b/web/views/baseviews.py	Wed May 23 11:00:29 2012 +0200
@@ -613,18 +613,18 @@
     def group_key(self, entity, **kwargs):
         value = super(AuthorView, self).group_key(entity, **kwargs)
         if value:
-            return value.login
-        return value
+            return (value.name(), value.login)
+        return (None, None)
 
     def index_link(self, basepath, key, items):
-        label = u'%s [%s]' % (key, len(items))
+        label = u'%s [%s]' % (key[0], len(items))
         etypes = set(entity.__regid__ for entity in items)
         vtitle = self._cw._('%(etype)s by %(author)s') % {
             'etype': ', '.join(display_name(self._cw, etype, 'plural')
                                for etype in etypes),
             'author': label}
-        url = self.index_url(basepath, key, vtitle=vtitle)
-        title = self._cw._('archive for %(author)s') % {'author': key}
+        url = self.index_url(basepath, key[1], vtitle=vtitle)
+        title = self._cw._('archive for %(author)s') % {'author': key[0]}
         return tags.a(label, href=url, title=title)