[images] add link around main image
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Sat, 17 Jul 2010 09:55:29 +0200
changeset 5986 8339d4739f7f
parent 5985 0dd582dfd257
child 5987 a9d508973433
[images] add link around main image
web/views/idownloadable.py
--- a/web/views/idownloadable.py	Fri Jul 16 16:37:20 2010 +0200
+++ b/web/views/idownloadable.py	Sat Jul 17 09:55:29 2010 +0200
@@ -94,6 +94,7 @@
     def last_modified(self):
         return self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0).modification_date
 
+
 class DownloadLinkView(EntityView):
     """view displaying a link to download the file"""
     __regid__ = 'downloadlink'
@@ -116,7 +117,8 @@
         adapter = entity.cw_adapt_to('IDownloadable')
         contenttype = adapter.download_content_type()
         if contenttype.startswith('image/'):
-            self.wview('image', entity.cw_rset, row=entity.cw_row)
+            self.wview('image', entity.cw_rset, row=entity.cw_row, col=entity.cw_col,
+                       link=True)
         else:
             self.wview('downloadlink', entity.cw_rset, title=self._cw._('download'), row=entity.cw_row)
             self.render_data(entity, contenttype, 'text/html')
@@ -136,6 +138,7 @@
             return True
         return False
 
+
 class IDownloadableLineView(baseviews.OneLineView):
     __select__ = adaptable('IDownloadable')