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