[index page] use 'New xxx' generated labels, 'add a xxx' labels are only generated according to inlined form configuration and with an associated context stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 21 Jul 2011 11:16:32 +0200
branchstable
changeset 7681 32c4c9bab046
parent 7680 b195b0c003ac
child 7682 07b592a62be3
[index page] use 'New xxx' generated labels, 'add a xxx' labels are only generated according to inlined form configuration and with an associated context
web/views/startup.py
--- a/web/views/startup.py	Thu Jul 21 11:15:24 2011 +0200
+++ b/web/views/startup.py	Thu Jul 21 11:16:32 2011 +0200
@@ -127,16 +127,16 @@
         for etype in self.add_etype_links:
             eschema = self._cw.vreg.schema.eschema(etype)
             if eschema.has_perm(self._cw, 'add'):
+                url = self._cw.vreg["etypes"].etype_class(etype).cw_create_url(self._cw)
                 self.w(u'<li><a href="%s">%s</a></li>' % (
-                        self._cw.build_url('add/%s' % eschema),
-                        self._cw.__('add a %s' % eschema).capitalize()))
+                        url, self._cw.__('New %s' % eschema).capitalize()))
         self.w(u'</ul>')
 
     def add_entity_link(self, etype):
         """creates a [+] link for adding an entity"""
         url = self._cw.vreg["etypes"].etype_class(etype).cw_create_url(self._cw)
         return u'[<a href="%s" title="%s">+</a>]' % (
-            xml_escape(url), self._cw.__('add a %s' % etype))
+            xml_escape(url), self._cw.__('New %s' % etype))
 
     @deprecated('[3.11] display_folders method is deprecated, backport it if needed')
     def display_folders(self):