[schema, cleanup] one more case for add_etype_button stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 26 Sep 2011 09:31:44 +0200
branchstable
changeset 7852 cb3f700399b2
parent 7851 54e6abed520a
child 7853 69cbb780dc83
[schema, cleanup] one more case for add_etype_button
web/views/cwsources.py
--- a/web/views/cwsources.py	Mon Sep 26 09:31:09 2011 +0200
+++ b/web/views/cwsources.py	Mon Sep 26 09:31:44 2011 +0200
@@ -263,12 +263,8 @@
 
     def call(self, **kwargs):
         self.w('<h1>%s</h1>' % self._cw._(self.title))
-        eschema = self._cw.vreg.schema.eschema('CWSource')
-        if eschema.has_perm(self._cw, 'add'):
-            self.w(u'<a href="%s" class="addButton right">%s</a>' % (
-                self._cw.build_url('add/%s' % eschema),
-                self._cw._('add a CWSource')))
-            self.w(u'<div class="clear"></div>')
+        self.w(add_etype_button(self._cw, 'CWSource'))
+        self.w(u'<div class="clear"></div>')
         self.wview('table', self._cw.execute(self.rql), displaycols=range(4))