Project

General

Profile

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

Alex Shulgin, 2012-07-24 13:53

View differences:

app/helpers/application_helper.rb
opt_only_path = {}
opt_only_path[:only_path] = (options[:only_path] == false ? false : true)
options.delete(:only_path)
link_to(h(text),
{:controller => 'attachments', :action => action,
:id => attachment, :filename => attachment.filename}.merge(opt_only_path),
options)
link_to(h(text), route_to_attachment(attachment, action).merge(opt_only_path), 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).html_safe
end
when 'attachment'
l(:text_journal_added, :label => label, :value => value).html_safe
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.html_safe
end
else
l(:text_journal_deleted, :label => label, :old => old_value).html_safe
    (1-1/1)