diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-04-06 05:44:48 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-04-06 05:44:48 +0000 |
commit | f277f127c6e17743a2875344a62d758ac400e325 (patch) | |
tree | c0565773a7f6b74dfe5ea04856821946b85cc146 /app | |
parent | b88586b56d301fc347644f8538e6bd1b00ee67b0 (diff) | |
download | redmine-f277f127c6e17743a2875344a62d758ac400e325.tar.gz redmine-f277f127c6e17743a2875344a62d758ac400e325.zip |
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
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/issues_helper.rb | 11 |
1 files 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 |