Defect #21074 » 0001-do-not-display-default-values-that-aren-t-actually-s.patch
| app/helpers/issues_helper.rb | ||
|---|---|---|
| 239 | 239 |
r.to_html |
| 240 | 240 |
end |
| 241 | 241 | |
| 242 |
# wrapper around show_value that prevents unsaved defaults to be shown |
|
| 243 |
def show_value_for_reading(value) |
|
| 244 |
if value.customized.custom_values.where(custom_field_id: value.custom_field.id).any? |
|
| 245 |
show_value value |
|
| 246 |
end |
|
| 247 |
end |
|
| 248 | ||
| 242 | 249 |
def render_half_width_custom_fields_rows(issue) |
| 243 | 250 |
values = issue.visible_custom_field_values.reject {|value| value.custom_field.full_width_layout?}
|
| 244 | 251 |
return if values.empty? |
| ... | ... | |
| 247 | 254 |
values.each_with_index do |value, i| |
| 248 | 255 |
css = "cf_#{value.custom_field.id}"
|
| 249 | 256 |
m = (i < half ? :left : :right) |
| 250 |
rows.send m, custom_field_name_tag(value.custom_field), show_value(value), :class => css |
|
| 257 |
rows.send m, custom_field_name_tag(value.custom_field), show_value_for_reading(value), :class => css
|
|
| 251 | 258 |
end |
| 252 | 259 |
end |
| 253 | 260 |
end |
| ... | ... | |
| 258 | 265 | |
| 259 | 266 |
s = ''.html_safe |
| 260 | 267 |
values.each_with_index do |value, i| |
| 261 |
attr_value = show_value(value) |
|
| 268 |
attr_value = show_value_for_reading(value)
|
|
| 262 | 269 |
next if attr_value.blank? |
| 263 | 270 | |
| 264 | 271 |
if value.custom_field.text_formatting == 'full' |