Last active
August 29, 2015 14:08
-
-
Save Sylvain303/c288ed7153ad98dc93fc to your computer and use it in GitHub Desktop.
modified render_email_issue_attributes() redmine helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def render_email_issue_attributes(issue, user, html=false) | |
exclude = %w{category fixed_version} | |
items = email_issue_attributes(issue, user) | |
# filter items outputed | |
items = items.select {|i| ! exclude.include?(i) } | |
output = [] | |
# content_tag() will escape if it recieve string not block | |
items.each do |i| | |
if html | |
output << content_tag('li', i) | |
else | |
output << "* #{i}" | |
end | |
end | |
if html | |
output = content_tag('ul', output.join("\n").html_safe) if html | |
else | |
output = output.join("\n") | |
end | |
return output | |
end | |
# was | |
def render_email_issue_attributes(issue, user, html=false) | |
exclude = %w{category fixed_version} | |
items = email_issue_attributes(issue, user) | |
items = items.select {|i| ! exclude.include?(i) } | |
if html | |
content_tag('ul', items.map{|s| content_tag('li', s)}.join("\n").html_safe) | |
else | |
items.map{|s| "* #{s}"}.join("\n") | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment