From 7056649a4be931a315fd4b4ad2be79ed8b9850e4 Mon Sep 17 00:00:00 2001 From: Etienne Massip Date: Mon, 27 Feb 2012 18:42:03 +0000 Subject: Override @#url_for@ in AM to force generation of absolute links (#10251). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9022 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/mailer.rb | 5 +++++ app/views/mailer/_issue.html.erb | 2 +- app/views/mailer/document_added.html.erb | 2 +- app/views/mailer/issue_edit.html.erb | 2 +- app/views/mailer/message_posted.html.erb | 2 +- app/views/mailer/news_added.html.erb | 2 +- app/views/mailer/news_comment_added.html.erb | 2 +- app/views/mailer/reminder.html.erb | 2 +- 8 files changed, 12 insertions(+), 7 deletions(-) (limited to 'app') diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 2502ce2e0..5bb4f7e2c 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -30,6 +30,11 @@ 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 3d851d442..c649e44c9 100644 --- a/app/views/mailer/_issue.html.erb +++ b/app/views/mailer/_issue.html.erb @@ -12,4 +12,4 @@ <% end %> -<%= textilizable(issue, :description, :only_path => false) %> +<%= textilizable(issue, :description) %> diff --git a/app/views/mailer/document_added.html.erb b/app/views/mailer/document_added.html.erb index 8606dd784..be18e400d 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, :only_path => false) %> +<%= textilizable(@document, :description) %> diff --git a/app/views/mailer/issue_edit.html.erb b/app/views/mailer/issue_edit.html.erb index 07288e379..da406f999 100644 --- a/app/views/mailer/issue_edit.html.erb +++ b/app/views/mailer/issue_edit.html.erb @@ -6,6 +6,6 @@ <% end %> -<%= textilizable(@journal, :notes, :only_path => false) %> +<%= textilizable(@journal, :notes) %>
<%= 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 f43a8cf0f..a8ccd2622 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, :only_path => false) %> +<%= textilizable(@message, :content) %> diff --git a/app/views/mailer/news_added.html.erb b/app/views/mailer/news_added.html.erb index 758ebccb8..9a024c09e 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, :only_path => false) %> +<%= textilizable(@news, :description) %> diff --git a/app/views/mailer/news_comment_added.html.erb b/app/views/mailer/news_comment_added.html.erb index ef2be0f65..b96de1489 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, :only_path => false %> +<%= textilizable @comment, :comments %> diff --git a/app/views/mailer/reminder.html.erb b/app/views/mailer/reminder.html.erb index f011da3e8..cfe8c977d 100644 --- a/app/views/mailer/reminder.html.erb +++ b/app/views/mailer/reminder.html.erb @@ -2,7 +2,7 @@ -- cgit v1.2.3