web/views/idownloadable.py
changeset 3072 6fb42c53f6df
parent 2789 39712da6f397
parent 3065 694c03f7d72f
child 3377 dd9d292b6a6d
equal deleted inserted replaced
3035:2e4a381ea5b7 3072:6fb42c53f6df
   145             self.w(u'</div>')
   145             self.w(u'</div>')
   146 
   146 
   147     def cell_call(self, row, col, width=None, height=None, link=False):
   147     def cell_call(self, row, col, width=None, height=None, link=False):
   148         entity = self.rset.get_entity(row, col)
   148         entity = self.rset.get_entity(row, col)
   149         #if entity.data_format.startswith('image/'):
   149         #if entity.data_format.startswith('image/'):
   150         imgtag = u'<img src="%s" alt="%s" ' % (xml_escape(entity.download_url()),
   150         imgtag = u'<img src="%s" alt="%s" ' % (
   151                                                xml_escape(entity.download_file_name()))
   151             xml_escape(entity.download_url()),
       
   152             (self.req._('download %s')  % xml_escape(entity.download_file_name())))
   152         if width:
   153         if width:
   153             imgtag += u'width="%i" ' % width
   154             imgtag += u'width="%i" ' % width
   154         if height:
   155         if height:
   155             imgtag += u'height="%i" ' % height
   156             imgtag += u'height="%i" ' % height
   156         imgtag += u'/>'
   157         imgtag += u'/>'
   157         if link:
   158         if link:
   158             self.w(u'<a href="%s" alt="%s">%s</a>' % (entity.absolute_url(vid='download'),
   159             self.w(u'<a href="%s">%s</a>' % (entity.absolute_url(vid='download'),
   159                                                       self.req._('download image'),
   160                                              imgtag))
   160                                                       imgtag))
       
   161         else:
   161         else:
   162             self.w(imgtag)
   162             self.w(imgtag)
   163 
   163 
   164 
   164