summaryrefslogtreecommitdiffstats
path: root/app/helpers/issues_helper.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-02-12 11:52:20 +0000
committerGo MAEDA <maeda@farend.jp>2019-02-12 11:52:20 +0000
commit82b707109f950abe285ef5d5409985590d3984e2 (patch)
tree5a131769a6e8a7762fe93427cdd94e788a5ef5fc /app/helpers/issues_helper.rb
parentb6592a73e89958858e6378649b3aafa6cf4583f2 (diff)
downloadredmine-82b707109f950abe285ef5d5409985590d3984e2.tar.gz
redmine-82b707109f950abe285ef5d5409985590d3984e2.zip
Refactor custom field value tag for custom fields with full text formatting enabled (#29712).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@17859 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/issues_helper.rb')
-rw-r--r--app/helpers/issues_helper.rb16
1 files changed, 4 insertions, 12 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 14d43f98e..6bd8e2927 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -244,12 +244,8 @@ module IssuesHelper
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
@@ -260,17 +256,13 @@ module IssuesHelper
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