Index: app/helpers/issues_helper.rb
===================================================================
--- app/helpers/issues_helper.rb (révision 14015)
+++ app/helpers/issues_helper.rb (copie de travail)
@@ -181,24 +181,59 @@
def render_custom_fields_rows(issue)
values = issue.visible_custom_field_values
return if values.empty?
+
+ #Don't take long text fields
+ non_longtext_values = []
+ values.compact.each do |value|
+ if !(value.custom_field.format.is_a?(Redmine::FieldFormat::TextFormat)) then
+ non_longtext_values << value
+ end
+ end
+
ordered_values = []
- half = (values.size / 2.0).ceil
+ half = (non_longtext_values.size / 2.0).ceil
half.times do |i|
- ordered_values << values[i]
- ordered_values << values[i + half]
+ ordered_values << non_longtext_values[i]
+ ordered_values << non_longtext_values[i + half]
end
s = "
\n"
n = 0
ordered_values.compact.each do |value|
css = "cf_#{value.custom_field.id}"
s << "
\n\n" if n > 0 && (n % 2) == 0
- s << "\t#{ h(value.custom_field.name) }: | #{ h(show_value(value)) } | \n"
+ s << "\t#{ h(value.custom_field.name) }: | #{ h(show_value(value)) } | \n"
n += 1
end
s << "
\n"
s.html_safe
end
+
+ def render_custom_fields_long_text_rows(issue)
+ values = issue.visible_custom_field_values
+ return if values.empty?
+
+ #Only take long text fields
+ longtext_values = []
+ values.compact.each do |value|
+ if value.custom_field.format.is_a?(Redmine::FieldFormat::TextFormat) then
+ longtext_values << value
+ end
+ end
+
+ s = "\n
\n"
+ longtext_values.compact.each do |value|
+ css = "cf_#{value.custom_field.id}"
+ s << "\n | \n
\n"
+ s << "\n\t#{ h(value.custom_field.name) }: | \n
\n"
+ s << "\n\t#{ h(show_value(value)) } | \n
\n"
+ s << "\n | \n
\n"
+ end
+ s << "\n
\n"
+ s.html_safe
+ end
+
+
# Returns the path for updating the issue form
# with project as the current project
def update_issue_form_path(project, issue)
Index: app/views/issues/show.html.erb
===================================================================
--- app/views/issues/show.html.erb (révision 14015)
+++ app/views/issues/show.html.erb (copie de travail)
@@ -83,6 +83,11 @@
<%= textilizable @issue, :description, :attachments => @issue.attachments %>
+
+
+<%= render_custom_fields_long_text_rows(@issue) %>
+
+
<% end %>
<%= link_to_attachments @issue, :thumbnails => true %>
<% end -%>