web/views/cwsources.py
branchstable
changeset 7852 cb3f700399b2
parent 7847 7be550fb337b
child 7935 28fe0b91ad8a
--- 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))