22 |
22 |
23 import hashlib |
23 import hashlib |
24 |
24 |
25 from logilab.mtconverter import xml_escape |
25 from logilab.mtconverter import xml_escape |
26 |
26 |
|
27 from cubicweb import tags |
27 from cubicweb.schema import display_name |
28 from cubicweb.schema import display_name |
28 from cubicweb.selectors import one_line_rset, is_instance, match_user_groups |
29 from cubicweb.selectors import one_line_rset, is_instance, match_user_groups |
29 from cubicweb.view import EntityView, StartupView |
30 from cubicweb.view import EntityView, StartupView |
30 from cubicweb.web import action, uicfg, formwidgets |
31 from cubicweb.web import action, uicfg, formwidgets |
31 from cubicweb.web.views import tabs, tableview, actions |
32 from cubicweb.web.views import tabs, tableview, actions |
200 display_name(self._cw, 'CWGroup', 'plural'), |
201 display_name(self._cw, 'CWGroup', 'plural'), |
201 display_name(self._cw, 'primary_email'), |
202 display_name(self._cw, 'primary_email'), |
202 display_name(self._cw, 'CWSource')) |
203 display_name(self._cw, 'CWSource')) |
203 super(CWUserTable, self).call( |
204 super(CWUserTable, self).call( |
204 paginate=True, displayfilter=True, |
205 paginate=True, displayfilter=True, |
205 cellvids={4: 'cw.user-table.group-cell'}, |
206 cellvids={0: 'cw.user.login', |
|
207 4: 'cw.user-table.group-cell'}, |
206 headers=headers, **kwargs) |
208 headers=headers, **kwargs) |
207 |
209 |
208 |
210 |
209 class CWUserGroupCell(EntityView): |
211 class CWUserGroupCell(EntityView): |
210 __regid__ = 'cw.user-table.group-cell' |
212 __regid__ = 'cw.user-table.group-cell' |
211 __select__ = is_instance('CWUser') |
213 __select__ = is_instance('CWUser') |
212 |
214 |
213 def cell_call(self, row, col, **kwargs): |
215 def cell_call(self, row, col, **kwargs): |
214 entity = self.cw_rset.get_entity(row, col) |
216 entity = self.cw_rset.get_entity(row, col) |
215 self.w(entity.view('reledit', rtype='in_group', role='subject')) |
217 self.w(entity.view('reledit', rtype='in_group', role='subject')) |
|
218 |
|
219 class CWUserLoginCell(EntityView): |
|
220 __regid__ = 'cw.user.login' |
|
221 __select__ = is_instance('CWUser') |
|
222 |
|
223 def cell_call(self, row, col, **kwargs): |
|
224 entity = self.cw_rset.get_entity(row, col) |
|
225 self.w(tags.a(entity.login, href=entity.absolute_url())) |