Project

General

Profile

Patch #8970 ยป 0001-Show-URL-to-attached-file-in-plain-text-issue-email.patch

Alex Shulgin, 2011-08-02 14:10

View differences:

app/helpers/application_helper.rb
text = options.delete(:text) || attachment.filename
action = options.delete(:download) ? 'download' : 'show'
link_to(h(text), {:controller => 'attachments', :action => action, :id => attachment, :filename => attachment.filename }, options)
link_to(h(text), route_to_attachment(attachment, action), options)
end
def route_to_attachment(attachment, action = 'show')
{ :controller => 'attachments', :action => action, :id => attachment, :filename => attachment.filename }
end
# Generates a link to a SCM revision
app/helpers/issues_helper.rb
l(:text_journal_set_to, :label => label, :value => value)
end
when 'attachment'
l(:text_journal_added, :label => label, :value => value)
s = l(:text_journal_added, :label => label, :value => value)
if no_html && !value.blank? && a = Attachment.find_by_id(detail.prop_key)
s << ": " + url_for(route_to_attachment(a).merge(:only_path => false))
end
s
end
else
l(:text_journal_deleted, :label => label, :old => old_value)
    (1-1/1)