##// END OF EJS Templates
Use #issue_fields_rows to render custom fields values....
Jean-Philippe Lang -
r14464:2350bc29f417
parent child
Show More
@@ -200,7 +200,7 module IssuesHelper
200 end
200 end
201
201
202 def cells(label, text, options={})
202 def cells(label, text, options={})
203 content_tag('th', "#{label}:", options) + content_tag('td', text, options)
203 content_tag('th', label + ":", options) + content_tag('td', text, options)
204 end
204 end
205 end
205 end
206
206
@@ -213,22 +213,14 module IssuesHelper
213 def render_custom_fields_rows(issue)
213 def render_custom_fields_rows(issue)
214 values = issue.visible_custom_field_values
214 values = issue.visible_custom_field_values
215 return if values.empty?
215 return if values.empty?
216 ordered_values = []
217 half = (values.size / 2.0).ceil
216 half = (values.size / 2.0).ceil
218 half.times do |i|
217 issue_fields_rows do |rows|
219 ordered_values << values[i]
218 values.each_with_index do |value, i|
220 ordered_values << values[i + half]
221 end
222 s = "<tr>\n"
223 n = 0
224 ordered_values.compact.each do |value|
225 css = "cf_#{value.custom_field.id}"
219 css = "cf_#{value.custom_field.id}"
226 s << "</tr>\n<tr>\n" if n > 0 && (n % 2) == 0
220 m = (i < half ? :left : :right)
227 s << "\t<th class=\"#{css}\">#{ custom_field_name_tag(value.custom_field) }:</th><td class=\"#{css}\">#{ h(show_value(value)) }</td>\n"
221 rows.send m, custom_field_name_tag(value.custom_field), show_value(value), :class => css
228 n += 1
222 end
229 end
223 end
230 s << "</tr>\n"
231 s.html_safe
232 end
224 end
233
225
234 # Returns the path for updating the issue form
226 # Returns the path for updating the issue form
General Comments 0
You need to be logged in to leave comments. Login now