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
This commit is contained in:
Toshi MARUYAMA 2012-04-06 05:44:48 +00:00
parent b88586b56d
commit f277f127c6
1 changed files with 9 additions and 2 deletions

View File

@ -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