[ui] display author name in box instead of login (closes #1529147)

authorArthur Lutz <arthur.lutz@logilab.fr>
changesete7f06e562a27
branchstable
phasepublic
hiddenno
parent revision#ae9310e4c2b3 [doc] remove deprecated doc (wrong link) (closes #2329206)
child revision#24409e9c7c66 [views] enable paginate toggle on RsetTableView (closes #2200675)
files modified by this revision
web/views/baseviews.py
# HG changeset patch
# User Arthur Lutz <arthur.lutz@logilab.fr>
# Date 1337763629 -7200
# Wed May 23 11:00:29 2012 +0200
# Branch stable
# Node ID e7f06e562a27a38d9242414769ef94c0195b1c1c
# Parent ae9310e4c2b37e5139573f5833b466fbb7b45535
[ui] display author name in box instead of login (closes #1529147)

diff --git a/web/views/baseviews.py b/web/views/baseviews.py
@@ -611,22 +611,22 @@
1      entity_attribute = 'creator'
2 
3      def group_key(self, entity, **kwargs):
4          value = super(AuthorView, self).group_key(entity, **kwargs)
5          if value:
6 -            return value.login
7 -        return value
8 +            return (value.name(), value.login)
9 +        return (None, None)
10 
11      def index_link(self, basepath, key, items):
12 -        label = u'%s [%s]' % (key, len(items))
13 +        label = u'%s [%s]' % (key[0], len(items))
14          etypes = set(entity.__regid__ for entity in items)
15          vtitle = self._cw._('%(etype)s by %(author)s') % {
16              'etype': ', '.join(display_name(self._cw, etype, 'plural')
17                                 for etype in etypes),
18              'author': label}
19 -        url = self.index_url(basepath, key, vtitle=vtitle)
20 -        title = self._cw._('archive for %(author)s') % {'author': key}
21 +        url = self.index_url(basepath, key[1], vtitle=vtitle)
22 +        title = self._cw._('archive for %(author)s') % {'author': key[0]}
23          return tags.a(label, href=url, title=title)
24 
25 
26  # bw compat ####################################################################
27