equal
deleted
inserted
replaced
55 adaptable('IDownloadable') & ~has_mimetype('image/')) |
55 adaptable('IDownloadable') & ~has_mimetype('image/')) |
56 |
56 |
57 order = 10 |
57 order = 10 |
58 title = _('download') |
58 title = _('download') |
59 |
59 |
|
60 def init_rendering(self): |
|
61 self.items = [self.entity] |
|
62 |
60 def render_body(self, w): |
63 def render_body(self, w): |
61 w(u'<a href="%s"><img src="%s" alt="%s"/> %s</a>' |
64 for item in self.items: |
62 % (xml_escape(self.entity.cw_adapt_to('IDownloadable').download_url()), |
65 w(u'<a href="%s"><img src="%s" alt="%s"/> %s</a>' |
63 self._cw.uiprops['DOWNLOAD_ICON'], |
66 % (xml_escape(item.cw_adapt_to('IDownloadable').download_url()), |
64 self._cw._('download icon'), xml_escape(self.entity.dc_title()))) |
67 self._cw.uiprops['DOWNLOAD_ICON'], |
|
68 self._cw._('download icon'), xml_escape(item.dc_title()))) |
65 |
69 |
66 |
70 |
67 class DownloadView(EntityView): |
71 class DownloadView(EntityView): |
68 """this view is replacing the deprecated 'download' controller and allow |
72 """this view is replacing the deprecated 'download' controller and allow |
69 downloading of entities providing the necessary interface |
73 downloading of entities providing the necessary interface |