Feature #29712 » 0002-Refactor-custom-field-value-tag-for-custom-fields-wi.patch
| app/helpers/custom_fields_helper.rb | ||
|---|---|---|
|
:class => "#{custom_field.field_format}_cf"
|
||
|
end
|
||
|
# Returns custom field value tag
|
||
|
def custom_field_value_tag(value)
|
||
|
attr_value = show_value(value)
|
||
|
if !attr_value.blank? && value.custom_field.full_text_formatting?
|
||
|
content_tag('div', attr_value, :class => 'wiki')
|
||
|
else
|
||
|
attr_value
|
||
|
end
|
||
|
end
|
||
|
# Return a string used to display a custom value
|
||
|
def show_value(custom_value, html=true)
|
||
|
format_object(custom_value, html)
|
||
| app/helpers/issues_helper.rb | ||
|---|---|---|
|
issue_fields_rows do |rows|
|
||
|
values.each_with_index do |value, i|
|
||
|
css = "cf_#{value.custom_field.id}"
|
||
|
attr_value = show_value(value)
|
||
|
if value.custom_field.text_formatting == 'full'
|
||
|
attr_value = content_tag('div', attr_value, class: 'wiki')
|
||
|
end
|
||
|
m = (i < half ? :left : :right)
|
||
|
rows.send m, custom_field_name_tag(value.custom_field), attr_value, :class => css
|
||
|
rows.send m, custom_field_name_tag(value.custom_field), custom_field_value_tag(value), :class => css
|
||
|
end
|
||
|
end
|
||
|
end
|
||
| ... | ... | |
|
s = ''.html_safe
|
||
|
values.each_with_index do |value, i|
|
||
|
attr_value = show_value(value)
|
||
|
next if attr_value.blank?
|
||
|
if value.custom_field.text_formatting == 'full'
|
||
|
attr_value = content_tag('div', attr_value, class: 'wiki')
|
||
|
end
|
||
|
attr_value_tag = custom_field_value_tag(value)
|
||
|
next if attr_value_tag.blank?
|
||
|
content =
|
||
|
content_tag('hr') +
|
||
|
content_tag('p', content_tag('strong', custom_field_name_tag(value.custom_field) )) +
|
||
|
content_tag('div', attr_value, class: 'value')
|
||
|
content_tag('div', attr_value_tag, class: 'value')
|
||
|
s << content_tag('div', content, class: "cf_#{value.custom_field.id} attribute")
|
||
|
end
|
||
|
s
|
||
- « Previous
- 1
- …
- 3
- 4
- 5
- Next »