From: Go MAEDA Date: Wed, 13 Feb 2019 14:06:10 +0000 (+0000) Subject: Show full width layout custom fields as block columns in issue listing (#26081). X-Git-Tag: 4.1.0~1118 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=489664df7e2e4d290079c7a4a6fbb776f82ad328;p=redmine.git Show full width layout custom fields as block columns in issue listing (#26081). Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@17865 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/query.rb b/app/models/query.rb index 73e280dd3..bfc6841c2 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -123,7 +123,7 @@ class QueryCustomFieldColumn < QueryColumn self.sortable = custom_field.order_statement || false self.groupable = custom_field.group_statement || false self.totalable = options.key?(:totalable) ? !!options[:totalable] : custom_field.totalable? - @inline = true + @inline = custom_field.full_width_layout? ? false : true @cf = custom_field end diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index d704a58bb..06abc3ea5 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -40,7 +40,7 @@ <% query.block_columns.each do |column| if (text = column_content(column, issue)) && text.present? -%> - + <% if query.block_columns.count > 1 %> <%= column.caption %> <% end %> diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 08ad6aa45..a9b1c6d73 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -264,8 +264,8 @@ tr.issue td.subject, tr.issue td.category, td.assigned_to, td.last_updated_by, t tr.issue td.relations { text-align: left; } tr.issue td.done_ratio table.progress { margin-left:auto; margin-right: auto;} tr.issue td.relations span {white-space: nowrap;} -table.issues td.description, table.issues td.last_notes {color:#777; font-size:90%; padding:4px 4px 4px 24px; text-align:left; white-space:normal;} -table.issues td.description pre, table.issues td.last_notes pre {white-space:normal;} +table.issues td.block_column {color:#777; font-size:90%; padding:4px 4px 4px 24px; text-align:left; white-space:normal;} +table.issues td.block_column pre {white-space:normal;} tr.issue.idnt td.subject {background: url(../images/arrow_right.png) no-repeat 2px 50%;} tr.issue.idnt-1 td.subject {padding-left: 24px; background-position: 8px 50%;} diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 0f433c318..047c98782 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -1398,6 +1398,23 @@ class IssuesControllerTest < Redmine::ControllerTest assert_select 'td.description[colspan="4"] span', :text => 'Description' end + def test_index_with_full_width_layout_custom_field_column_should_show_column_as_block_column + field = IssueCustomField.create!(:name => 'Long text', :field_format => 'text', :full_width_layout => '1', + :tracker_ids => [1], :is_for_all => true) + issue = Issue.find(1) + issue.custom_field_values = {field.id => 'This is a long text'} + issue.save! + + get :index, :params => { + :set_filter => 1, + :c => ['subject', 'description', "cf_#{field.id}"] + } + assert_response :success + + assert_select 'td.description[colspan="4"] span', :text => 'Description' + assert_select "td.cf_#{field.id} span", :text => 'Long text' + end + def test_index_with_parent_column Issue.delete_all parent = Issue.generate!