equal
deleted
inserted
replaced
13 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
13 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
14 # details. |
14 # details. |
15 # |
15 # |
16 # You should have received a copy of the GNU Lesser General Public License along |
16 # You should have received a copy of the GNU Lesser General Public License along |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
18 """overrides some base views for cubicweb on google appengine |
18 """overrides some base views for cubicweb on google appengine""" |
19 |
19 |
20 """ |
|
21 __docformat__ = "restructuredtext en" |
20 __docformat__ = "restructuredtext en" |
22 |
21 |
23 from logilab.mtconverter import xml_escape |
22 from logilab.mtconverter import xml_escape |
24 |
23 |
25 from cubicweb import typed_eid |
24 from cubicweb import typed_eid |
86 etype = eschema.type |
85 etype = eschema.type |
87 label = display_name(req, etype, 'plural') |
86 label = display_name(req, etype, 'plural') |
88 view = self.vreg.select('views', 'list', req, req.etype_rset(etype)) |
87 view = self.vreg.select('views', 'list', req, req.etype_rset(etype)) |
89 url = view.url() |
88 url = view.url() |
90 etypelink = u' <a href="%s">%s</a>' % (xml_escape(url), label) |
89 etypelink = u' <a href="%s">%s</a>' % (xml_escape(url), label) |
91 yield (label, etypelink, self.add_entity_link(eschema, req)) |
90 if eschema.has_perm(req, 'add'): |
|
91 yield (label, etypelink, self.add_entity_link(etype)) |
92 |
92 |
93 ManageView.entity_types = entity_types_no_count |
93 ManageView.entity_types = entity_types_no_count |
94 |
94 |
95 |
95 |
96 from cubicweb.web.views.basecontrollers import SendMailController |
96 from cubicweb.web.views.basecontrollers import SendMailController |