diff app/helpers/issues_helper.rb @ 1517:dffacf8a6908 redmine-2.5

Update to Redmine SVN revision 13367 on 2.5-stable branch
author Chris Cannam
date Tue, 09 Sep 2014 09:29:00 +0100
parents e248c7af89ec
children
line wrap: on
line diff
--- a/app/helpers/issues_helper.rb	Tue Sep 09 09:28:31 2014 +0100
+++ b/app/helpers/issues_helper.rb	Tue Sep 09 09:29:00 2014 +0100
@@ -171,8 +171,9 @@
     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>#{ h(value.custom_field.name) }:</th><td>#{ simple_format_without_paragraph(h(show_value(value))) }</td>\n"
+      s << "\t<th class=\"#{css}\">#{ h(value.custom_field.name) }:</th><td class=\"#{css}\">#{ h(show_value(value)) }</td>\n"
       n += 1
     end
     s << "</tr>\n"
@@ -239,7 +240,7 @@
       end
     end
     issue.visible_custom_field_values(user).each do |value|
-      items << "#{value.custom_field.name}: #{show_value(value)}"
+      items << "#{value.custom_field.name}: #{show_value(value, false)}"
     end
     items
   end
@@ -324,8 +325,8 @@
       if custom_field
         multiple = custom_field.multiple?
         label = custom_field.name
-        value = format_value(detail.value, custom_field.field_format) if detail.value
-        old_value = format_value(detail.old_value, custom_field.field_format) if detail.old_value
+        value = format_value(detail.value, custom_field) if detail.value
+        old_value = format_value(detail.old_value, custom_field) if detail.old_value
       end
     when 'attachment'
       label = l(:label_attachment)
@@ -339,7 +340,8 @@
         old_value = rel_issue.nil? ? "#{l(:label_issue)} ##{detail.old_value}" :
                           (no_html ? rel_issue : link_to_issue(rel_issue, :only_path => options[:only_path]))
       end
-      label = l(detail.prop_key.to_sym)
+      relation_type = IssueRelation::TYPES[detail.prop_key]
+      label = l(relation_type[:name]) if relation_type
     end
     call_hook(:helper_issues_show_detail_after_setting,
               {:detail => detail, :label => label, :value => value, :old_value => old_value })