equal
deleted
inserted
replaced
1 """Specific views for cards |
|
2 |
|
3 :organization: Logilab |
|
4 :copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
|
5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
|
6 """ |
|
7 __docformat__ = "restructuredtext en" |
|
8 |
|
9 from cubicweb.selectors import implements |
|
10 from cubicweb.web.views import baseviews |
|
11 from logilab.mtconverter import html_escape |
|
12 |
|
13 _ = unicode |
|
14 |
|
15 class CardPrimaryView(baseviews.PrimaryView): |
|
16 __select__ = implements('Card') |
|
17 skip_attrs = baseviews.PrimaryView.skip_attrs + ('title', 'synopsis', 'wikiid') |
|
18 show_attr_label = False |
|
19 |
|
20 def content_title(self, entity): |
|
21 return html_escape(entity.dc_title()) |
|
22 |
|
23 def summary(self, entity): |
|
24 return html_escape(entity.dc_description()) |
|
25 |
|
26 |
|
27 class CardInlinedView(CardPrimaryView): |
|
28 """hide card title and summary""" |
|
29 id = 'inlined' |
|
30 title = _('inlined view') |
|
31 main_related_section = False |
|
32 |
|
33 def render_entity_title(self, entity): |
|
34 pass |
|
35 |
|
36 def render_entity_metadata(self, entity): |
|
37 pass |
|