[idownloadable] use the optional title parameter if specified in the download view stable
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Tue, 23 Jun 2009 10:54:46 +0200
branchstable
changeset 2136 ffd6c68bc485
parent 2135 55fc8b488907
child 2139 8969443bd21c
[idownloadable] use the optional title parameter if specified in the download view
web/views/idownloadable.py
--- a/web/views/idownloadable.py	Tue Jun 23 10:53:57 2009 +0200
+++ b/web/views/idownloadable.py	Tue Jun 23 10:54:46 2009 +0200
@@ -125,7 +125,7 @@
         """the secondary view is a link to download the file"""
         entity = self.entity(row, col)
         url = html_escape(entity.absolute_url())
-        name = html_escape(entity.download_file_name())
+        name = html_escape(title or entity.download_file_name())
         durl = html_escape(entity.download_url())
         self.w(u'<a href="%s">%s</a> [<a href="%s">%s</a>]' %
                (url, name, durl, self.req._('download')))