<a> doesn't have alt attribute stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 31 Aug 2009 18:12:29 +0200
branchstable
changeset 3065 694c03f7d72f
parent 3064 3fbcdf220ce9
child 3070 b1c3626ce20a
<a> doesn't have alt attribute
web/views/idownloadable.py
--- a/web/views/idownloadable.py	Mon Aug 31 17:38:38 2009 +0200
+++ b/web/views/idownloadable.py	Mon Aug 31 18:12:29 2009 +0200
@@ -147,17 +147,17 @@
     def cell_call(self, row, col, width=None, height=None, link=False):
         entity = self.entity(row, col)
         #if entity.data_format.startswith('image/'):
-        imgtag = u'<img src="%s" alt="%s" ' % (xml_escape(entity.download_url()),
-                                               xml_escape(entity.download_file_name()))
+        imgtag = u'<img src="%s" alt="%s" ' % (
+            xml_escape(entity.download_url()),
+            (self.req._('download %s')  % xml_escape(entity.download_file_name())))
         if width:
             imgtag += u'width="%i" ' % width
         if height:
             imgtag += u'height="%i" ' % height
         imgtag += u'/>'
         if link:
-            self.w(u'<a href="%s" alt="%s">%s</a>' % (entity.absolute_url(vid='download'),
-                                                      self.req._('download image'),
-                                                      imgtag))
+            self.w(u'<a href="%s">%s</a>' % (entity.absolute_url(vid='download'),
+                                             imgtag))
         else:
             self.w(imgtag)