mirror of
https://github.com/redmine/redmine.git
synced 2025-11-10 15:26:03 +01:00
Add CSS classes to column headers of issues and timelogs list (#26674).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@17176 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -195,7 +195,7 @@ module QueriesHelper
|
|||||||
else
|
else
|
||||||
content = column.caption
|
content = column.caption
|
||||||
end
|
end
|
||||||
content_tag('th', content)
|
content_tag('th', content, :class => column.css_classes)
|
||||||
end
|
end
|
||||||
|
|
||||||
def column_content(column, item)
|
def column_content(column, item)
|
||||||
|
|||||||
@@ -1012,7 +1012,12 @@ class IssuesControllerTest < Redmine::ControllerTest
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
|
|
||||||
# query should use specified columns + id and checkbox
|
# query should use specified columns + id and checkbox
|
||||||
assert_select 'table.issues thead th', columns.size + 2
|
assert_select 'table.issues thead' do
|
||||||
|
assert_select 'th', columns.size + 2
|
||||||
|
assert_select 'th.tracker'
|
||||||
|
assert_select 'th.subject'
|
||||||
|
assert_select 'th.assigned_to'
|
||||||
|
end
|
||||||
|
|
||||||
# columns should be stored in session
|
# columns should be stored in session
|
||||||
assert_kind_of Hash, session[:issue_query]
|
assert_kind_of Hash, session[:issue_query]
|
||||||
@@ -1073,7 +1078,10 @@ class IssuesControllerTest < Redmine::ControllerTest
|
|||||||
|
|
||||||
# query should use specified columns
|
# query should use specified columns
|
||||||
assert_equal ["#", "Tracker", "Subject", "Searchable field"], columns_in_issues_list
|
assert_equal ["#", "Tracker", "Subject", "Searchable field"], columns_in_issues_list
|
||||||
assert_select 'table.issues td.cf_2.string'
|
assert_select 'table.issues' do
|
||||||
|
assert_select 'th.cf_2.string'
|
||||||
|
assert_select 'td.cf_2.string'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_index_with_multi_custom_field_column
|
def test_index_with_multi_custom_field_column
|
||||||
@@ -1119,7 +1127,10 @@ class IssuesControllerTest < Redmine::ControllerTest
|
|||||||
:set_filter => 1,
|
:set_filter => 1,
|
||||||
:c => %w(start_date)
|
:c => %w(start_date)
|
||||||
}
|
}
|
||||||
assert_select "table.issues td.start_date", :text => '24/08/1987'
|
assert_select 'table.issues' do
|
||||||
|
assert_select 'th.start_date'
|
||||||
|
assert_select 'td.start_date', :text => '24/08/1987'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -721,6 +721,18 @@ class TimelogControllerTest < Redmine::ControllerTest
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
end
|
end
|
||||||
|
|
||||||
|
assert_select 'table.time-entries thead' do
|
||||||
|
assert_select 'th.spent_on'
|
||||||
|
assert_select 'th.issue'
|
||||||
|
assert_select 'th.user'
|
||||||
|
assert_select 'th.hours'
|
||||||
|
end
|
||||||
|
assert_select 'table.time-entries tbody' do
|
||||||
|
assert_select 'td.spent_on'
|
||||||
|
assert_select 'td.issue'
|
||||||
|
assert_select 'td.user'
|
||||||
|
assert_select 'td.hours'
|
||||||
|
end
|
||||||
assert_equal ['Date', 'Issue', 'User', 'Hours'], columns_in_list
|
assert_equal ['Date', 'Issue', 'User', 'Hours'], columns_in_list
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -947,6 +959,8 @@ class TimelogControllerTest < Redmine::ControllerTest
|
|||||||
:c => %w(project spent_on issue comments hours issue.status)
|
:c => %w(project spent_on issue comments hours issue.status)
|
||||||
}
|
}
|
||||||
assert_response :success
|
assert_response :success
|
||||||
|
|
||||||
|
assert_select 'th.issue-status'
|
||||||
assert_select 'td.issue-status', :text => issue.status.name
|
assert_select 'td.issue-status', :text => issue.status.name
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1059,7 +1073,7 @@ class TimelogControllerTest < Redmine::ControllerTest
|
|||||||
:sort => field_name
|
:sort => field_name
|
||||||
}
|
}
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_select "th a.sort", :text => 'String Field'
|
assert_select "th.cf_#{field.id} a.sort", :text => 'String Field'
|
||||||
|
|
||||||
# Make sure that values are properly sorted
|
# Make sure that values are properly sorted
|
||||||
values = css_select("td.#{field_name}").map(&:text).reject(&:blank?)
|
values = css_select("td.#{field_name}").map(&:text).reject(&:blank?)
|
||||||
|
|||||||
Reference in New Issue
Block a user