# HG changeset patch # User Aurelien Campeas # Date 1250785818 -7200 # Node ID 36b11249014ef2b6a89bbfc7415183347ad4ca57 # Parent f35b64718d02bb87490149a0e773b71efbf199e8 [pdf] (ugly) pdf icon, component diff -r f35b64718d02 -r 36b11249014e web/data/cubicweb.css --- a/web/data/cubicweb.css Thu Aug 20 17:52:21 2009 +0200 +++ b/web/data/cubicweb.css Thu Aug 20 18:30:18 2009 +0200 @@ -838,4 +838,13 @@ border: 1px solid #edecd2; border-color:#edecd2 #cfceb7 #cfceb7 #edecd2; background: #fffff8 url("button.png") bottom left repeat-x; -} \ No newline at end of file +} + + +/********************************/ +/* placement of alt. view icons */ +/********************************/ + +.otherView { + float: right; +} diff -r f35b64718d02 -r 36b11249014e web/data/pdf_icon.gif Binary file web/data/pdf_icon.gif has changed diff -r f35b64718d02 -r 36b11249014e web/views/basecomponents.py --- a/web/views/basecomponents.py Thu Aug 20 17:52:21 2009 +0200 +++ b/web/views/basecomponents.py Thu Aug 20 18:30:18 2009 +0200 @@ -2,6 +2,7 @@ * the rql input form * the logged user link +* pdf view link :organization: Logilab :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. @@ -214,6 +215,23 @@ self.w(u' | '.join(html)) self.w(u'') +class PdfViewComponent(component.Component): + id = 'pdfview' + __select__ = yes() + + context = 'header' + property_defs = { + _('visible'): dict(type='Boolean', default=True, + help=_('display the pdf icon or not')), + } + + def call(self, vid): + self.req.add_css('cubes.confman.css') + entity = self.entity(0,0) + self.w(u'' % + (xml_escape(entity.absolute_url() + '?vid=%s&__template=pdf-main-template' % vid))) + + def registration_callback(vreg): vreg.register_all(globals().values(), __name__, (SeeAlsoVComponent,))