Commit 2d31b9f7 authored by maeda's avatar maeda

Show full width layout custom fields as block columns in issue listing (#26081).

Patch by Marius BALTEANU.


git-svn-id: https://svn.redmine.org/redmine/trunk@17865 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 047516f6
......@@ -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
......
......@@ -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 %>
......
......@@ -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%;}
......
......@@ -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!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment