summaryrefslogtreecommitdiffstats
path: root/app/helpers/issues_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-11-08 10:35:52 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-11-08 10:35:52 +0000
commit2350bc29f4178645d69e1ecc40e3584e4d9d5ee8 (patch)
tree9d08e06f8301fcd1d4e8cf3781eced13aed6e316 /app/helpers/issues_helper.rb
parent093c80cd0981d6411a59cf145af1b2248c80bab0 (diff)
downloadredmine-2350bc29f4178645d69e1ecc40e3584e4d9d5ee8.tar.gz
redmine-2350bc29f4178645d69e1ecc40e3584e4d9d5ee8.zip
Use #issue_fields_rows to render custom fields values.
git-svn-id: http://svn.redmine.org/redmine/trunk@14846 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/issues_helper.rb')
-rw-r--r--app/helpers/issues_helper.rb22
1 files changed, 7 insertions, 15 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 42e93655b..9288db5ab 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -200,7 +200,7 @@ module IssuesHelper
end
def cells(label, text, options={})
- content_tag('th', "#{label}:", options) + content_tag('td', text, options)
+ content_tag('th', label + ":", options) + content_tag('td', text, options)
end
end
@@ -213,22 +213,14 @@ module IssuesHelper
def render_custom_fields_rows(issue)
values = issue.visible_custom_field_values
return if values.empty?
- ordered_values = []
half = (values.size / 2.0).ceil
- half.times do |i|
- ordered_values << values[i]
- ordered_values << values[i + half]
- end
- s = "<tr>\n"
- n = 0
- ordered_values.compact.each do |value|
- css = "cf_#{value.custom_field.id}"
- s << "</tr>\n<tr>\n" if n > 0 && (n % 2) == 0
- s << "\t<th class=\"#{css}\">#{ custom_field_name_tag(value.custom_field) }:</th><td class=\"#{css}\">#{ h(show_value(value)) }</td>\n"
- n += 1
+ issue_fields_rows do |rows|
+ values.each_with_index do |value, i|
+ css = "cf_#{value.custom_field.id}"
+ m = (i < half ? :left : :right)
+ rows.send m, custom_field_name_tag(value.custom_field), show_value(value), :class => css
+ end
end
- s << "</tr>\n"
- s.html_safe
end
# Returns the path for updating the issue form