From f277f127c6e17743a2875344a62d758ac400e325 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Fri, 6 Apr 2012 05:44:48 +0000 Subject: [PATCH] add a view link to note attachment file (#4774) git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9326 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/issues_helper.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 6844236cd..250775f62 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -249,9 +249,16 @@ module IssuesHelper label = content_tag('strong', label) old_value = content_tag("i", h(old_value)) if detail.old_value old_value = content_tag("strike", old_value) if detail.old_value and detail.value.blank? - if detail.property == 'attachment' && !value.blank? && a = Attachment.find_by_id(detail.prop_key) + if detail.property == 'attachment' && !value.blank? && atta = Attachment.find_by_id(detail.prop_key) # Link to the attachment if it has not been removed - value = link_to_attachment(a, :download => true, :only_path => options[:only_path]) + value = link_to_attachment(atta, :download => true, :only_path => options[:only_path]) + if atta.is_text? + value += link_to( + image_tag('magnifier.png'), + :controller => 'attachments', :action => 'show', + :id => atta, :filename => atta.filename + ) + end else value = content_tag("i", h(value)) if value end -- 2.39.5