]> source.dussan.org Git - redmine.git/commitdiff
Show full width layout custom fields as block columns in issue listing (#26081).
authorGo MAEDA <maeda@farend.jp>
Wed, 13 Feb 2019 14:06:10 +0000 (14:06 +0000)
committerGo MAEDA <maeda@farend.jp>
Wed, 13 Feb 2019 14:06:10 +0000 (14:06 +0000)
Patch by Marius BALTEANU.

git-svn-id: http://svn.redmine.org/redmine/trunk@17865 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/query.rb
app/views/issues/_list.html.erb
public/stylesheets/application.css
test/functional/issues_controller_test.rb

index 73e280dd326a32bfcb60c7071d5541d31d6833c7..bfc6841c2c9b82ee5746bf3ec7f2e885c7f2d187 100644 (file)
@@ -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
 
index d704a58bbf6e75f82afdc24870e3fea10e6a0e43..06abc3ea55ca66e47a2b53e649b6fa5ad113fd59 100644 (file)
@@ -40,7 +40,7 @@
   <% query.block_columns.each do |column|
        if (text = column_content(column, issue)) && text.present? -%>
   <tr class="<%= current_cycle %>">
-    <td colspan="<%= query.inline_columns.size + 2 %>" class="<%= column.css_classes %>">
+    <td colspan="<%= query.inline_columns.size + 2 %>" class="<%= column.css_classes %> block_column">
       <% if query.block_columns.count > 1 %>
         <span><%= column.caption %></span>
       <% end %>
index 08ad6aa45d91e730128eb90f9e0eb76de6caa8da..a9b1c6d737c7fa5264c76a48a55680ba42b03aca 100644 (file)
@@ -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%;}
index 0f433c3189acd9b98e31879dbaf4b745cea21bf7..047c98782b614caadb0d75325ef9455a0b9e2c9e 100644 (file)
@@ -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!