# HG changeset patch # User Sylvain Thénault # Date 1304698826 -7200 # Node ID 72bb52edbb6b266ade97958f174edeefe0674c6c # Parent 5f7813ae9fb8e1274f47cc9f25ac9344f04ca1f4 [user mgmt] should show user login in first column in any case (e.g. application specific override) diff -r 5f7813ae9fb8 -r 72bb52edbb6b web/views/cwuser.py --- a/web/views/cwuser.py Fri May 06 11:28:42 2011 +0200 +++ b/web/views/cwuser.py Fri May 06 18:20:26 2011 +0200 @@ -24,6 +24,7 @@ from logilab.mtconverter import xml_escape +from cubicweb import tags from cubicweb.schema import display_name from cubicweb.selectors import one_line_rset, is_instance, match_user_groups from cubicweb.view import EntityView, StartupView @@ -202,7 +203,8 @@ display_name(self._cw, 'CWSource')) super(CWUserTable, self).call( paginate=True, displayfilter=True, - cellvids={4: 'cw.user-table.group-cell'}, + cellvids={0: 'cw.user.login', + 4: 'cw.user-table.group-cell'}, headers=headers, **kwargs) @@ -213,3 +215,11 @@ def cell_call(self, row, col, **kwargs): entity = self.cw_rset.get_entity(row, col) self.w(entity.view('reledit', rtype='in_group', role='subject')) + +class CWUserLoginCell(EntityView): + __regid__ = 'cw.user.login' + __select__ = is_instance('CWUser') + + def cell_call(self, row, col, **kwargs): + entity = self.cw_rset.get_entity(row, col) + self.w(tags.a(entity.login, href=entity.absolute_url()))