diff -r 7111bb64b58f -r aa30c665bd06 web/views/cwuser.py --- a/web/views/cwuser.py Fri Sep 16 17:10:33 2011 +0200 +++ b/web/views/cwuser.py Fri Sep 16 16:42:42 2011 +0200 @@ -29,7 +29,7 @@ from cubicweb.selectors import one_line_rset, is_instance, match_user_groups from cubicweb.view import EntityView, StartupView from cubicweb.web import action, uicfg, formwidgets -from cubicweb.web.views import tabs, tableview, actions +from cubicweb.web.views import tabs, tableview, actions, add_etype_button _pvs = uicfg.primaryview_section _pvs.tag_attribute(('CWUser', 'login'), 'hidden') @@ -182,12 +182,8 @@ def call(self, **kwargs): self.w('

%s

' % self._cw._(self.title)) - for etype in ('CWUser', 'CWGroup'): - eschema = self._cw.vreg.schema.eschema(etype) - if eschema.has_perm(self._cw, 'add'): - self.w(u'%s' % ( - self._cw.build_url('add/%s' % eschema), - self._cw.__('New %s' % etype).capitalize())) + self.w(add_etype_button(self._cw, 'CWUser')) + self.w(add_etype_button(self._cw, 'CWGroup')) self.w(u'
') self.wview('cw.user-table', self._cw.execute(self.rql))