1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-03-11 03:33:07 +00:00

Merged r17634 from trunk to 3.4-stable (#30027).

git-svn-id: http://svn.redmine.org/redmine/branches/3.4-stable@17635 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2018-11-26 02:13:52 +00:00
parent fad54d02b8
commit f7c9ba30a8
2 changed files with 24 additions and 1 deletions

View File

@ -246,8 +246,12 @@ 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), show_value(value), :class => css
rows.send m, custom_field_name_tag(value.custom_field), attr_value, :class => css
end
end
end

View File

@ -2093,6 +2093,25 @@ class IssuesControllerTest < Redmine::ControllerTest
assert_select "div.description ~ div.attribute.cf_#{field.id} div.value", :text => 'This is a long text'
end
def test_show_custom_fields_with_full_text_formatting_should_be_rendered_using_wiki_class
half_field = IssueCustomField.create!(:name => 'Half width field', :field_format => 'text', :tracker_ids => [1],
:is_for_all => true, :text_formatting => 'full')
full_field = IssueCustomField.create!(:name => 'Full width field', :field_format => 'text', :full_width_layout => '1',
:tracker_ids => [1], :is_for_all => true, :text_formatting => 'full')
issue = Issue.find(1)
issue.custom_field_values = {full_field.id => 'This is a long text', half_field.id => 'This is a short text'}
issue.save!
get :show, :params => {
:id => 1
}
assert_response :success
assert_select "div.attribute.cf_#{half_field.id} div.value div.wiki", 1
assert_select "div.attribute.cf_#{full_field.id} div.value div.wiki", 1
end
def test_show_with_multi_user_custom_field
field = IssueCustomField.create!(:name => 'Multi user', :field_format => 'user', :multiple => true,
:tracker_ids => [1], :is_for_all => true)