diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f04d59e6d..2b0797614 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -99,7 +99,7 @@ module ApplicationHelper action = options.delete(:download) ? 'download' : 'show' link_to(h(text), {:controller => 'attachments', :action => action, - :id => attachment, :filename => attachment.filename }, + :id => attachment, :filename => attachment.filename }.merge(options), options) end diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 29444e703..66f0b003d 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -163,7 +163,8 @@ module IssuesHelper # Returns the textual representation of a journal details # as an array of strings - def details_to_strings(details, no_html=false) + def details_to_strings(details, no_html=false, options={}) + options[:only_path] = (options[:only_path] == false ? false : true) strings = [] values_by_field = {} details.each do |detail| @@ -181,23 +182,23 @@ module IssuesHelper next end end - strings << show_detail(detail, no_html) + strings << show_detail(detail, no_html, options) end values_by_field.each do |field_id, changes| detail = JournalDetail.new(:property => 'cf', :prop_key => field_id) if changes[:added].any? detail.value = changes[:added] - strings << show_detail(detail, no_html) + strings << show_detail(detail, no_html, options) elsif changes[:deleted].any? detail.old_value = changes[:deleted] - strings << show_detail(detail, no_html) + strings << show_detail(detail, no_html, options) end end strings end # Returns the textual representation of a single journal detail - def show_detail(detail, no_html=false) + def show_detail(detail, no_html=false, options={}) multiple = false case detail.property when 'attr' @@ -250,7 +251,7 @@ module IssuesHelper 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) # Link to the attachment if it has not been removed - value = link_to_attachment(a, :download => true) + value = link_to_attachment(a, :download => true, :only_path => options[:only_path]) else value = content_tag("i", h(value)) if value end @@ -260,7 +261,7 @@ module IssuesHelper s = l(:text_journal_changed_no_detail, :label => label) unless no_html diff_link = link_to 'diff', - {:controller => 'journals', :action => 'diff', :id => detail.journal_id, :detail_id => detail.id}, + {:controller => 'journals', :action => 'diff', :id => detail.journal_id, :detail_id => detail.id, :only_path => options[:only_path]}, :title => l(:label_view_diff) s << " (#{ diff_link })" end diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 5bb4f7e2c..2502ce2e0 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -30,11 +30,6 @@ class Mailer < ActionMailer::Base { :host => h, :protocol => Setting.protocol } end - def url_for(options) - options[:only_path] = false if options.is_a?(Hash) - super options - end - # Builds a tmail object used to email recipients of the added issue. # # Example: diff --git a/app/views/mailer/_issue.html.erb b/app/views/mailer/_issue.html.erb index c649e44c9..3d851d442 100644 --- a/app/views/mailer/_issue.html.erb +++ b/app/views/mailer/_issue.html.erb @@ -12,4 +12,4 @@ <% end %> -<%= textilizable(issue, :description) %> +<%= textilizable(issue, :description, :only_path => false) %> diff --git a/app/views/mailer/document_added.html.erb b/app/views/mailer/document_added.html.erb index be18e400d..8606dd784 100644 --- a/app/views/mailer/document_added.html.erb +++ b/app/views/mailer/document_added.html.erb @@ -1,3 +1,3 @@ <%= link_to(h(@document.title), @document_url) %> (<%=h @document.category.name %>)

-<%= textilizable(@document, :description) %> +<%= textilizable(@document, :description, :only_path => false) %> diff --git a/app/views/mailer/issue_edit.html.erb b/app/views/mailer/issue_edit.html.erb index da406f999..3aac5e44f 100644 --- a/app/views/mailer/issue_edit.html.erb +++ b/app/views/mailer/issue_edit.html.erb @@ -1,11 +1,11 @@ <%= l(:text_issue_updated, :id => "##{@issue.id}", :author => h(@journal.user)) %> -<%= textilizable(@journal, :notes) %> +<%= textilizable(@journal, :notes, :only_path => false) %>
<%= render :partial => "issue.html.erb", :locals => { :issue => @issue, :issue_url => @issue_url } %> diff --git a/app/views/mailer/message_posted.html.erb b/app/views/mailer/message_posted.html.erb index a8ccd2622..f43a8cf0f 100644 --- a/app/views/mailer/message_posted.html.erb +++ b/app/views/mailer/message_posted.html.erb @@ -1,4 +1,4 @@

<%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url) %>

<%=h @message.author %> -<%= textilizable(@message, :content) %> +<%= textilizable(@message, :content, :only_path => false) %> diff --git a/app/views/mailer/news_added.html.erb b/app/views/mailer/news_added.html.erb index 9a024c09e..758ebccb8 100644 --- a/app/views/mailer/news_added.html.erb +++ b/app/views/mailer/news_added.html.erb @@ -1,4 +1,4 @@

<%= link_to(h(@news.title), @news_url) %>

<%=h @news.author.name %> -<%= textilizable(@news, :description) %> +<%= textilizable(@news, :description, :only_path => false) %> diff --git a/app/views/mailer/news_comment_added.html.erb b/app/views/mailer/news_comment_added.html.erb index b96de1489..ef2be0f65 100644 --- a/app/views/mailer/news_comment_added.html.erb +++ b/app/views/mailer/news_comment_added.html.erb @@ -2,4 +2,4 @@

<%= l(:text_user_wrote, :value => h(@comment.author)) %>

-<%= textilizable @comment, :comments %> +<%= textilizable @comment, :comments, :only_path => false %> diff --git a/app/views/mailer/reminder.html.erb b/app/views/mailer/reminder.html.erb index cfe8c977d..f011da3e8 100644 --- a/app/views/mailer/reminder.html.erb +++ b/app/views/mailer/reminder.html.erb @@ -2,7 +2,7 @@