summaryrefslogtreecommitdiffstats
path: root/app/helpers/custom_fields_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/custom_fields_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/custom_fields_helper.rb')
-rw-r--r--app/helpers/custom_fields_helper.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/helpers/custom_fields_helper.rb b/app/helpers/custom_fields_helper.rb
index e0ca4529b..54573c763 100644
--- a/app/helpers/custom_fields_helper.rb
+++ b/app/helpers/custom_fields_helper.rb
@@ -129,6 +129,17 @@ module CustomFieldsHelper
: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)