##// END OF EJS Templates
Make the email notifications for adding/updating issues more readable/clear (#23978)....
Jean-Philippe Lang -
r15705:e8e92ca054af
parent child
Show More
@@ -295,23 +295,31 module IssuesHelper
295 295 users
296 296 end
297 297
298 def email_issue_attributes(issue, user)
298 def email_issue_attributes(issue, user, html)
299 299 items = []
300 300 %w(author status priority assigned_to category fixed_version).each do |attribute|
301 301 unless issue.disabled_core_fields.include?(attribute+"_id")
302 items << "#{l("field_#{attribute}")}: #{issue.send attribute}"
302 if html
303 items << content_tag('strong', "#{l("field_#{attribute}")}: ") + (issue.send attribute)
304 else
305 items << "#{l("field_#{attribute}")}: #{issue.send attribute}"
306 end
303 307 end
304 308 end
305 309 issue.visible_custom_field_values(user).each do |value|
306 items << "#{value.custom_field.name}: #{show_value(value, false)}"
310 if html
311 items << content_tag('strong', "#{value.custom_field.name}: ") + show_value(value, false)
312 else
313 items << "#{value.custom_field.name}: #{show_value(value, false)}"
314 end
307 315 end
308 316 items
309 317 end
310 318
311 319 def render_email_issue_attributes(issue, user, html=false)
312 items = email_issue_attributes(issue, user)
320 items = email_issue_attributes(issue, user, html)
313 321 if html
314 content_tag('ul', items.map{|s| content_tag('li', s)}.join("\n").html_safe)
322 content_tag('ul', items.map{|s| content_tag('li', s)}.join("\n").html_safe, :class => "details")
315 323 else
316 324 items.map{|s| "* #{s}"}.join("\n")
317 325 end
@@ -38,6 +38,7 pre {
38 38 overflow-x: auto;
39 39 overflow-y: hidden;
40 40 }
41 ul.details {color:#959595; margin-bottom: 1.5em;}
41 42 </style>
42 43 </head>
43 44 <body>
@@ -2,8 +2,9
2 2 (<%= l(:field_private_notes) %>)
3 3 <% end %>
4 4 <%= l(:text_issue_updated, :id => link_to("##{@issue.id}", @issue_url), :author => h(@journal.user)).html_safe %>
5 <hr />
5 6
6 <ul>
7 <ul class="details">
7 8 <% details_to_strings(@journal_details, false, :only_path => false).each do |string| %>
8 9 <li><%= string %></li>
9 10 <% end %>
General Comments 0
You need to be logged in to leave comments. Login now