Project

General

Profile

Defect #25726 » 0001-do-not-display-default-values-that-aren-t-actually-s.patch

patch against trunk (better than the one in #21074) - Jens Krämer, 2017-04-28 17:07

View differences:

app/helpers/issues_helper.rb
def render_half_width_custom_fields_rows(issue)
values = issue.visible_custom_field_values.reject {|value| value.custom_field.full_width_layout?}
return if values.empty?
existing_custom_field_ids = issue.custom_values.pluck(:custom_field_id)
half = (values.size / 2.0).ceil
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
if existing_custom_field_ids.include?(value.custom_field.id)
content = show_value(value)
end
rows.send m, custom_field_name_tag(value.custom_field), content, :class => css
end
end
end
......
values = issue.visible_custom_field_values.select {|value| value.custom_field.full_width_layout?}
return if values.empty?
existing_custom_field_ids = issue.custom_values.pluck(:custom_field_id)
s = ''.html_safe
values.each_with_index do |value, i|
attr_value = show_value(value)
if existing_custom_field_ids.include?(value.custom_field.id)
attr_value = show_value(value)
end
next if attr_value.blank?
if value.custom_field.text_formatting == 'full'
    (1-1/1)