diff -r 5b75fd66c80e -r d7a270f50f54 web/views/basecomponents.py
--- a/web/views/basecomponents.py Sun Nov 08 21:53:18 2009 +0100
+++ b/web/views/basecomponents.py Fri Nov 20 19:35:54 2009 +0100
@@ -215,23 +215,30 @@
self.w(u' | '.join(html))
self.w(u'')
-class PdfViewComponent(component.Component):
+
+class PdfViewComponent(component.EntityVComponent):
__regid__ = 'pdfview'
__select__ = yes()
- context = 'header'
- cw_property_defs = {
- _('visible'): dict(type='Boolean', default=True,
- help=_('display the pdf icon or not')),
- }
+ context = 'ctxtoolbar'
- def call(self, vid):
- entity = self.entity(0,0)
- url = entity.absolute_url(vid=vid, __template='pdf-main-template')
- self.w(u'
' %
- (xml_escape(url), self._cw._('download page as pdf')))
+ def cell_call(self, row, col, view):
+ entity = self.entity(row, col)
+ url = entity.absolute_url(vid=view.id, __template='pdf-main-template')
+ iconurl = self.req.build_url('data/pdf_icon.gif')
+ label = self.req._('Download page as pdf')
+ self.w(u'
' %
+ (xml_escape(url), label, iconurl, label))
+class MetaDataComponent(component.EntityVComponent):
+ id = 'metadata'
+ context = 'navbottom'
+ order = 1
+
+ def cell_call(self, row, col, view=None):
+ self.wview('metadata', self.rset, row=row, col=col)
+
def registration_callback(vreg):
vreg.register_all(globals().values(), __name__, (SeeAlsoVComponent,))