Display calendar in vertical list layout on mobile screens (#33682).

Patch by Takashi Kato.


git-svn-id: https://svn.redmine.org/redmine/trunk@22283 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2023-08-27 06:40:59 +00:00
parent 6653f60d74
commit 4e0bb4990c
9 changed files with 229 additions and 192 deletions

View File

@@ -65,19 +65,17 @@ class CalendarsControllerTest < Redmine::ControllerTest
# Assert context menu on issues
assert_select 'form[data-cm-url=?]', '/issues/context_menu'
assert_select 'table.cal' do
assert_select 'tr' do
assert_select 'td' do
assert_select(
'div.issue.hascontextmenu.tooltip.starting',
:text => /Add ingredients categories/
) do
assert_select 'a.issue[href=?]', '/issues/2', :text => 'Feature request #2'
assert_select 'span.tip' do
assert_select 'img[class="gravatar"]'
end
assert_select 'input[name=?][type=?][value=?]', 'ids[]', 'checkbox', '2'
assert_select 'ul.cal' do
assert_select 'li' do
assert_select(
'div.issue.hascontextmenu.tooltip.starting',
:text => /Add ingredients categories/
) do
assert_select 'a.issue[href=?]', '/issues/2', :text => 'Feature request #2'
assert_select 'span.tip' do
assert_select 'img[class="gravatar"]'
end
assert_select 'input[name=?][type=?][value=?]', 'ids[]', 'checkbox', '2'
end
end
end
@@ -89,16 +87,14 @@ class CalendarsControllerTest < Redmine::ControllerTest
get(:show, :params => {:project_id => 1})
assert_response :success
assert_select 'table.cal' do
assert_select 'tr' do
assert_select 'td' do
assert_select(
'div.issue.hascontextmenu.tooltip.ending',
:text => /Cannot print recipes/
) do
assert_select 'a.issue[href=?]', '/issues/1', :text => 'Bug #1'
assert_select 'input[name=?][type=?][value=?]', 'ids[]', 'checkbox', '1'
end
assert_select 'ul.cal' do
assert_select 'li' do
assert_select(
'div.issue.hascontextmenu.tooltip.ending',
:text => /Cannot print recipes/
) do
assert_select 'a.issue[href=?]', '/issues/1', :text => 'Bug #1'
assert_select 'input[name=?][type=?][value=?]', 'ids[]', 'checkbox', '1'
end
end
end
@@ -120,24 +116,22 @@ class CalendarsControllerTest < Redmine::ControllerTest
)
assert_response :success
assert_select 'table.cal' do
assert_select 'tr' do
assert_select 'td' do
assert_select 'ul.cal' do
assert_select 'li' do
assert_select(
'div.issue.hascontextmenu.tooltip.starting.ending',
:text => /#{subject}/
) do
assert_select(
'div.issue.hascontextmenu.tooltip.starting.ending',
:text => /#{subject}/
) do
assert_select(
'a.issue[href=?]', "/issues/#{issue.id}",
:text => "Bug ##{issue.id}"
)
assert_select(
'input[name=?][type=?][value=?]',
'ids[]',
'checkbox',
issue.id.to_s
)
end
'a.issue[href=?]', "/issues/#{issue.id}",
:text => "Bug ##{issue.id}"
)
assert_select(
'input[name=?][type=?][value=?]',
'ids[]',
'checkbox',
issue.id.to_s
)
end
end
end
@@ -149,14 +143,12 @@ class CalendarsControllerTest < Redmine::ControllerTest
get(:show, :params => {:project_id => 1})
assert_response :success
assert_select 'table.cal' do
assert_select 'tr' do
assert_select 'td' do
assert_select(
'span.icon.icon-package'
) do
assert_select 'a[href=?]', '/versions/2', :text => '1.0'
end
assert_select 'ul.cal' do
assert_select 'li' do
assert_select(
'span.icon.icon-package'
) do
assert_select 'a[href=?]', '/versions/2', :text => '1.0'
end
end
end
@@ -179,16 +171,14 @@ class CalendarsControllerTest < Redmine::ControllerTest
get :show
assert_response :success
assert_select 'table.cal' do
assert_select 'tr' do
assert_select 'td' do
assert_select(
'div.issue.hascontextmenu.tooltip.starting',
:text => /eCookbook.*Add ingredients categories/m
) do
assert_select 'a.issue[href=?]', '/issues/2', :text => 'Feature request #2'
assert_select 'input[name=?][type=?][value=?]', 'ids[]', 'checkbox', '2'
end
assert_select 'ul.cal' do
assert_select 'li' do
assert_select(
'div.issue.hascontextmenu.tooltip.starting',
:text => /eCookbook.*Add ingredients categories/m
) do
assert_select 'a.issue[href=?]', '/issues/2', :text => 'Feature request #2'
assert_select 'input[name=?][type=?][value=?]', 'ids[]', 'checkbox', '2'
end
end
end
@@ -200,17 +190,15 @@ class CalendarsControllerTest < Redmine::ControllerTest
get :show
assert_response :success
assert_select 'table.cal' do
assert_select 'tr' do
assert_select 'td' do
assert_select 'ul.cal' do
assert_select 'li' do
assert_select(
'span.icon.icon-package'
) do
assert_select(
'span.icon.icon-package'
) do
assert_select(
'a[href=?]', '/versions/2',
:text => 'eCookbook - 1.0'
)
end
'a[href=?]', '/versions/2',
:text => 'eCookbook - 1.0'
)
end
end
end
@@ -228,16 +216,16 @@ class CalendarsControllerTest < Redmine::ControllerTest
assert_response :success
end
assert_select 'tr' do
assert_select 'td.week-number', :text => '53'
assert_select 'td.odd', :text => '27'
assert_select 'td.even', :text => '2'
assert_select 'ul' do
assert_select 'li.week-number:nth-of-type(2)', :text => /53$/
assert_select 'li.odd', :text => /^27/
assert_select 'li.even', :text => /^2/
end
assert_select 'tr' do
assert_select 'td.week-number', :text => '1'
assert_select 'td.odd', :text => '3'
assert_select 'td.even', :text => '9'
assert_select 'ul' do
assert_select 'li.week-number', :text => /1$/
assert_select 'li.odd', :text => /^3/
assert_select 'li.even', :text => /^9/
end
with_settings :start_of_week => 1 do
@@ -251,16 +239,16 @@ class CalendarsControllerTest < Redmine::ControllerTest
assert_response :success
end
assert_select 'tr' do
assert_select 'td.week-number', :text => '53'
assert_select 'td.even', :text => '28'
assert_select 'td.even', :text => '3'
assert_select 'ul' do
assert_select 'li.week-number:nth-of-type(2)', :text => /53$/
assert_select 'li.even', :text => /^28/
assert_select 'li.even', :text => /^3/
end
assert_select 'tr' do
assert_select 'td.week-number', :text => '1'
assert_select 'td.even', :text => '4'
assert_select 'td.even', :text => '10'
assert_select 'ul' do
assert_select 'li.week-number', :text => /1$/
assert_select 'li.even', :text => /^4/
assert_select 'li.even', :text => /^10/
end
end
@@ -296,12 +284,12 @@ class CalendarsControllerTest < Redmine::ControllerTest
)
assert_response :success
assert_select 'tr:nth-child(2)' do
assert_select 'td.week-number', :text => '49'
assert_select 'ul' do
assert_select 'li.week-number:nth-of-type(2)', :text => /48$/
# non working days should have "nwday" CSS class
assert_select 'td.nwday', 2
assert_select 'td.nwday', :text => '4'
assert_select 'td.nwday', :text => '10'
assert_select 'li.nwday', 10
assert_select 'li.nwday', :text => /^4/
assert_select 'li.nwday', :text => /^10/
end
end
end