web/views/boxes.py
changeset 143 c4f11f70b75e
parent 142 0425ee84cfa6
child 185 9fc69c46e5e7
equal deleted inserted replaced
142:0425ee84cfa6 143:c4f11f70b75e
   181             box.append(menu)
   181             box.append(menu)
   182         if not box.is_empty():
   182         if not box.is_empty():
   183             box.render(self.w)
   183             box.render(self.w)
   184 
   184 
   185 
   185 
       
   186         
   186 class RSSIconBox(ExtResourcesBoxTemplate):
   187 class RSSIconBox(ExtResourcesBoxTemplate):
   187     """just display the RSS icon on uniform result set"""
   188     """just display the RSS icon on uniform result set"""
   188     __selectors__ = ExtResourcesBoxTemplate.__selectors__ + (appobject_selectable('components', 'rss_feed_url'),)
   189     __selectors__ = ExtResourcesBoxTemplate.__selectors__ + (appobject_selectable('components', 'rss_feed_url'),)
   189     
   190     
   190     id = 'rss'
   191     id = 'rss'
   196         urlgetter = self.vreg.select_component('rss_feed_url', self.req, self.rset)
   197         urlgetter = self.vreg.select_component('rss_feed_url', self.req, self.rset)
   197         url = urlgetter.feed_url()
   198         url = urlgetter.feed_url()
   198         rss = self.req.external_resource('RSS_LOGO')
   199         rss = self.req.external_resource('RSS_LOGO')
   199         self.w(u'<a href="%s"><img src="%s" border="0" /></a>\n' % (html_escape(url), rss))
   200         self.w(u'<a href="%s"><img src="%s" border="0" /></a>\n' % (html_escape(url), rss))
   200 
   201 
   201 class EntityRSSIconBox(RSSIconBox):
       
   202     """just display the RSS icon on uniform result set for a single entity"""
       
   203     __selectors__ = RSSIconBox.__selectors__ + (onelinerset_selector,)
       
   204 
       
   205     def call(self, **kwargs):
       
   206         entity = self.entity(0, 0)
       
   207         url = entity.rss_feed_url()
       
   208         eid = entity.eid
       
   209         rss = self.req.external_resource('RSS_LOGO')
       
   210         self.w(u'<a href="%s"><img src="%s" border="0" /></a>\n' %
       
   211                (html_escape(url), rss))
       
   212 
   202 
   213 ## warning("schemabox ne marche plus pour le moment")
   203 ## warning("schemabox ne marche plus pour le moment")
   214 ## class SchemaBox(BoxTemplate):
   204 ## class SchemaBox(BoxTemplate):
   215 ##     """display a box containing link to list of entities by type"""
   205 ##     """display a box containing link to list of entities by type"""
   216 ##     id = 'schema_box'
   206 ##     id = 'schema_box'