equal
deleted
inserted
replaced
27 |
27 |
28 |
28 |
29 class ExternalTemplate(basetemplates.TheMainTemplate): |
29 class ExternalTemplate(basetemplates.TheMainTemplate): |
30 """template embeding an external web pages into CubicWeb web interface |
30 """template embeding an external web pages into CubicWeb web interface |
31 """ |
31 """ |
32 id = 'external' |
32 __regid__ = 'external' |
33 |
33 |
34 def call(self, body): |
34 def call(self, body): |
35 # XXX fallback to HTML 4 mode when embeding ? |
35 # XXX fallback to HTML 4 mode when embeding ? |
36 self.set_request_content_type() |
36 self.set_request_content_type() |
37 self.req.search_state = ('normal',) |
37 self.req.search_state = ('normal',) |
42 self.content_footer() |
42 self.content_footer() |
43 self.template_footer() |
43 self.template_footer() |
44 |
44 |
45 |
45 |
46 class EmbedController(Controller): |
46 class EmbedController(Controller): |
47 id = 'embed' |
47 __regid__ = 'embed' |
48 template = 'external' |
48 template = 'external' |
49 |
49 |
50 def publish(self, rset=None): |
50 def publish(self, rset=None): |
51 req = self.req |
51 req = self.req |
52 if 'custom_css' in req.form: |
52 if 'custom_css' in req.form: |
90 |
90 |
91 class EmbedAction(Action): |
91 class EmbedAction(Action): |
92 """display an 'embed' link on entity implementing `embeded_url` method |
92 """display an 'embed' link on entity implementing `embeded_url` method |
93 if the returned url match embeding configuration |
93 if the returned url match embeding configuration |
94 """ |
94 """ |
95 id = 'embed' |
95 __regid__ = 'embed' |
96 __select__ = (one_line_rset() & match_search_state('normal') |
96 __select__ = (one_line_rset() & match_search_state('normal') |
97 & implements(IEmbedable) |
97 & implements(IEmbedable) |
98 & score_entity(entity_has_embedable_url)) |
98 & score_entity(entity_has_embedable_url)) |
99 |
99 |
100 title = _('embed') |
100 title = _('embed') |