web/views/basecomponents.py
changeset 3072 6fb42c53f6df
parent 3023 7864fee8b4ec
parent 3037 45de36c7d47c
child 3185 bd0126d17e83
equal deleted inserted replaced
3035:2e4a381ea5b7 3072:6fb42c53f6df
   224         _('visible'):  dict(type='Boolean', default=True,
   224         _('visible'):  dict(type='Boolean', default=True,
   225                             help=_('display the pdf icon or not')),
   225                             help=_('display the pdf icon or not')),
   226     }
   226     }
   227 
   227 
   228     def call(self, vid):
   228     def call(self, vid):
   229         self.req.add_css('cubes.confman.css')
       
   230         entity = self.entity(0,0)
   229         entity = self.entity(0,0)
   231         self.w(u'<a href="%s" class="otherView"><img src="data/pdf_icon.gif"/></a>' %
   230         url = entity.absolute_url(vid=vid, __template='pdf-main-template')
   232                (xml_escape(entity.absolute_url() + '?vid=%s&__template=pdf-main-template' % vid)))
   231         self.w(u'<a href="%s" class="otherView"><img src="data/pdf_icon.gif" alt="%s"/></a>' %
       
   232                (xml_escape(url), self.req._('download page as pdf')))
   233 
   233 
   234 
   234 
   235 
   235 
   236 def registration_callback(vreg):
   236 def registration_callback(vreg):
   237     vreg.register_all(globals().values(), __name__, (SeeAlsoVComponent,))
   237     vreg.register_all(globals().values(), __name__, (SeeAlsoVComponent,))