##// END OF EJS Templates
Mailer#url_for not called in views with Rails 3.1....
Jean-Philippe Lang -
r8903:e6b9ddad18fb
parent child
Show More
@@ -99,7 +99,7 module ApplicationHelper
99 99 action = options.delete(:download) ? 'download' : 'show'
100 100 link_to(h(text),
101 101 {:controller => 'attachments', :action => action,
102 :id => attachment, :filename => attachment.filename },
102 :id => attachment, :filename => attachment.filename }.merge(options),
103 103 options)
104 104 end
105 105
@@ -163,7 +163,8 module IssuesHelper
163 163
164 164 # Returns the textual representation of a journal details
165 165 # as an array of strings
166 def details_to_strings(details, no_html=false)
166 def details_to_strings(details, no_html=false, options={})
167 options[:only_path] = (options[:only_path] == false ? false : true)
167 168 strings = []
168 169 values_by_field = {}
169 170 details.each do |detail|
@@ -181,23 +182,23 module IssuesHelper
181 182 next
182 183 end
183 184 end
184 strings << show_detail(detail, no_html)
185 strings << show_detail(detail, no_html, options)
185 186 end
186 187 values_by_field.each do |field_id, changes|
187 188 detail = JournalDetail.new(:property => 'cf', :prop_key => field_id)
188 189 if changes[:added].any?
189 190 detail.value = changes[:added]
190 strings << show_detail(detail, no_html)
191 strings << show_detail(detail, no_html, options)
191 192 elsif changes[:deleted].any?
192 193 detail.old_value = changes[:deleted]
193 strings << show_detail(detail, no_html)
194 strings << show_detail(detail, no_html, options)
194 195 end
195 196 end
196 197 strings
197 198 end
198 199
199 200 # Returns the textual representation of a single journal detail
200 def show_detail(detail, no_html=false)
201 def show_detail(detail, no_html=false, options={})
201 202 multiple = false
202 203 case detail.property
203 204 when 'attr'
@@ -250,7 +251,7 module IssuesHelper
250 251 old_value = content_tag("strike", old_value) if detail.old_value and detail.value.blank?
251 252 if detail.property == 'attachment' && !value.blank? && a = Attachment.find_by_id(detail.prop_key)
252 253 # Link to the attachment if it has not been removed
253 value = link_to_attachment(a, :download => true)
254 value = link_to_attachment(a, :download => true, :only_path => options[:only_path])
254 255 else
255 256 value = content_tag("i", h(value)) if value
256 257 end
@@ -260,7 +261,7 module IssuesHelper
260 261 s = l(:text_journal_changed_no_detail, :label => label)
261 262 unless no_html
262 263 diff_link = link_to 'diff',
263 {:controller => 'journals', :action => 'diff', :id => detail.journal_id, :detail_id => detail.id},
264 {:controller => 'journals', :action => 'diff', :id => detail.journal_id, :detail_id => detail.id, :only_path => options[:only_path]},
264 265 :title => l(:label_view_diff)
265 266 s << " (#{ diff_link })"
266 267 end
@@ -30,11 +30,6 class Mailer < ActionMailer::Base
30 30 { :host => h, :protocol => Setting.protocol }
31 31 end
32 32
33 def url_for(options)
34 options[:only_path] = false if options.is_a?(Hash)
35 super options
36 end
37
38 33 # Builds a tmail object used to email recipients of the added issue.
39 34 #
40 35 # Example:
@@ -12,4 +12,4
12 12 <% end %>
13 13 </ul>
14 14
15 <%= textilizable(issue, :description) %>
15 <%= textilizable(issue, :description, :only_path => false) %>
@@ -1,3 +1,3
1 1 <%= link_to(h(@document.title), @document_url) %> (<%=h @document.category.name %>)<br />
2 2 <br />
3 <%= textilizable(@document, :description) %>
3 <%= textilizable(@document, :description, :only_path => false) %>
@@ -1,11 +1,11
1 1 <%= l(:text_issue_updated, :id => "##{@issue.id}", :author => h(@journal.user)) %>
2 2
3 3 <ul>
4 <% details_to_strings(@journal.details).each do |string| %>
4 <% details_to_strings(@journal.details, false, :only_path => false).each do |string| %>
5 5 <li><%= string %></li>
6 6 <% end %>
7 7 </ul>
8 8
9 <%= textilizable(@journal, :notes) %>
9 <%= textilizable(@journal, :notes, :only_path => false) %>
10 10 <hr />
11 11 <%= render :partial => "issue.html.erb", :locals => { :issue => @issue, :issue_url => @issue_url } %>
@@ -1,4 +1,4
1 1 <h1><%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url) %></h1>
2 2 <em><%=h @message.author %></em>
3 3
4 <%= textilizable(@message, :content) %>
4 <%= textilizable(@message, :content, :only_path => false) %>
@@ -1,4 +1,4
1 1 <h1><%= link_to(h(@news.title), @news_url) %></h1>
2 2 <em><%=h @news.author.name %></em>
3 3
4 <%= textilizable(@news, :description) %>
4 <%= textilizable(@news, :description, :only_path => false) %>
@@ -2,4 +2,4
2 2
3 3 <p><%= l(:text_user_wrote, :value => h(@comment.author)) %></p>
4 4
5 <%= textilizable @comment, :comments %>
5 <%= textilizable @comment, :comments, :only_path => false %>
@@ -2,7 +2,7
2 2
3 3 <ul>
4 4 <% @issues.each do |issue| -%>
5 <li><%=h issue.project %> - <%=link_to(h("#{issue.tracker} ##{issue.id}"), :controller => 'issues', :action => 'show', :id => issue)%>: <%=h issue.subject %></li>
5 <li><%=h issue.project %> - <%=link_to(h("#{issue.tracker} ##{issue.id}"), :controller => 'issues', :action => 'show', :id => issue, :only_path => false)%>: <%=h issue.subject %></li>
6 6 <% end -%>
7 7 </ul>
8 8
General Comments 0
You need to be logged in to leave comments. Login now