Skip to content

Commit 7e3a4f9

Browse files
authored
Merge pull request #493 from TechnologyEnhancedLearning/Develop/Features/TD-4179-Conditionally-display-pagination-landmark
Display pagination landmark only when pagination show is enabled
2 parents 8761240 + aa0bb30 commit 7e3a4f9

10 files changed

+190
-175
lines changed

LearningHub.Nhs.WebUI/Views/Account/_AccountCreationGradePaging.cshtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
}
2525
}
2626

27-
27+
@if (showPaging == true)
28+
{
2829
<nav class="nhsuk-pagination" role="navigation" aria-label="Pagination">
2930
<ul class="nhsuk-list nhsuk-pagination__list">
3031

@@ -68,4 +69,5 @@
6869
}
6970
</ul>
7071
</nav>
72+
}
7173

LearningHub.Nhs.WebUI/Views/Account/_AccountCreationJobRolePaging.cshtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
}
2525
}
2626

27-
27+
@if (showPaging == true)
28+
{
2829
<nav class="nhsuk-pagination" role="navigation" aria-label="Pagination">
2930
<ul class="nhsuk-list nhsuk-pagination__list">
3031

@@ -68,4 +69,5 @@
6869
}
6970
</ul>
7071
</nav>
72+
}
7173

LearningHub.Nhs.WebUI/Views/Account/_AccountCreationRegionPaging.cshtml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@
2424
}
2525
}
2626

27-
27+
@if (showPaging == true)
28+
{
2829
<nav class="nhsuk-pagination" role="navigation" aria-label="Pagination">
29-
<ul class="nhsuk-list nhsuk-pagination__list">
30-
30+
<ul class="nhsuk-list nhsuk-pagination__list">
31+
3132
@if (pagingModel.CurrentPage <= 1)
3233
{
3334
<li class="nhsuk-pagination-item--previous">
@@ -68,4 +69,5 @@
6869
}
6970
</ul>
7071
</nav>
72+
}
7173

LearningHub.Nhs.WebUI/Views/Account/_AccountCreationSpecialtyPaging.cshtml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
}
2525
}
2626

27-
27+
@if (showPaging == true)
28+
{
2829
<nav class="nhsuk-pagination" role="navigation" aria-label="Pagination">
2930
<ul class="nhsuk-list nhsuk-pagination__list">
3031

@@ -68,4 +69,4 @@
6869
}
6970
</ul>
7071
</nav>
71-
72+
}

LearningHub.Nhs.WebUI/Views/Account/_AccountCreationWorkPlacePaging.cshtml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
}
2525
}
2626

27-
27+
@if (showPaging == true)
28+
{
2829
<nav class="nhsuk-pagination" role="navigation" aria-label="Pagination">
2930
<ul class="nhsuk-list nhsuk-pagination__list">
3031

@@ -68,4 +69,4 @@
6869
}
6970
</ul>
7071
</nav>
71-
72+
}

LearningHub.Nhs.WebUI/Views/MyAccount/_UserJobRolePaging.cshtml

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -22,48 +22,49 @@
2222
}
2323
}
2424

25+
@if (showPaging == true)
26+
{
27+
<nav class="nhsuk-pagination" role="navigation" aria-label="Pagination">
28+
<ul class="nhsuk-list nhsuk-pagination__list">
2529

26-
<nav class="nhsuk-pagination" role="navigation" aria-label="Pagination">
27-
<ul class="nhsuk-list nhsuk-pagination__list">
30+
@if (pagingModel.CurrentPage <= 1)
31+
{
32+
<li class="nhsuk-pagination-item--previous">
2833

29-
@if (pagingModel.CurrentPage <= 1)
30-
{
31-
<li class="nhsuk-pagination-item--previous">
32-
33-
</li>
34-
}
35-
else
36-
{
37-
<li class="nhsuk-pagination-item--previous">
38-
<a class="nhsuk-pagination__link nhsuk-pagination__link--prev" asp-action="ChangeCurrentRole" asp-route-currentPage="@(CurrentPageIndex - 1)" asp-route-filterText="@Context.Request.Query["filterText"]">
39-
<span class="nhsuk-pagination__title">Previous</span>
40-
<span class="nhsuk-u-visually-hidden">:</span>
41-
<span class="nhsuk-pagination__page">@previousMessage</span>
42-
<svg class="nhsuk-icon nhsuk-icon__arrow-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" width="34" height="34">
43-
<path d="M4.1 12.3l2.7 3c.2.2.5.2.7 0 .1-.1.1-.2.1-.3v-2h11c.6 0 1-.4 1-1s-.4-1-1-1h-11V9c0-.2-.1-.4-.3-.5h-.2c-.1 0-.3.1-.4.2l-2.7 3c0 .2 0 .4.1.6z"></path>
44-
</svg>
45-
</a>
46-
</li>
47-
}
48-
@if (pagingModel.CurrentPage == pagingModel.TotalPages)
49-
{
50-
<li class="nhsuk-pagination-item--next">
51-
52-
</li>
53-
}
54-
else
55-
{
56-
<li class="nhsuk-pagination-item--next">
57-
<a class="nhsuk-pagination__link nhsuk-pagination__link--next" asp-action="ChangeCurrentRole" asp-route-currentPage="@(CurrentPageIndex + 1)" asp-route-filterText="@Context.Request.Query["filterText"]">
58-
<span class="nhsuk-pagination__title">Next</span>
59-
<span class="nhsuk-u-visually-hidden">:</span>
60-
<span class="nhsuk-pagination__page">@nextMessage</span>
61-
<svg class="nhsuk-icon nhsuk-icon__arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" width="34" height="34">
62-
<path d="M19.6 11.66l-2.73-3A.51.51 0 0 0 16 9v2H5a1 1 0 0 0 0 2h11v2a.5.5 0 0 0 .32.46.39.39 0 0 0 .18 0 .52.52 0 0 0 .37-.16l2.73-3a.5.5 0 0 0 0-.64z"></path>
63-
</svg>
64-
</a>
65-
</li>
66-
}
67-
</ul>
68-
</nav>
34+
</li>
35+
}
36+
else
37+
{
38+
<li class="nhsuk-pagination-item--previous">
39+
<a class="nhsuk-pagination__link nhsuk-pagination__link--prev" asp-action="ChangeCurrentRole" asp-route-currentPage="@(CurrentPageIndex - 1)" asp-route-filterText="@Context.Request.Query["filterText"]">
40+
<span class="nhsuk-pagination__title">Previous</span>
41+
<span class="nhsuk-u-visually-hidden">:</span>
42+
<span class="nhsuk-pagination__page">@previousMessage</span>
43+
<svg class="nhsuk-icon nhsuk-icon__arrow-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" width="34" height="34">
44+
<path d="M4.1 12.3l2.7 3c.2.2.5.2.7 0 .1-.1.1-.2.1-.3v-2h11c.6 0 1-.4 1-1s-.4-1-1-1h-11V9c0-.2-.1-.4-.3-.5h-.2c-.1 0-.3.1-.4.2l-2.7 3c0 .2 0 .4.1.6z"></path>
45+
</svg>
46+
</a>
47+
</li>
48+
}
49+
@if (pagingModel.CurrentPage == pagingModel.TotalPages)
50+
{
51+
<li class="nhsuk-pagination-item--next">
6952

53+
</li>
54+
}
55+
else
56+
{
57+
<li class="nhsuk-pagination-item--next">
58+
<a class="nhsuk-pagination__link nhsuk-pagination__link--next" asp-action="ChangeCurrentRole" asp-route-currentPage="@(CurrentPageIndex + 1)" asp-route-filterText="@Context.Request.Query["filterText"]">
59+
<span class="nhsuk-pagination__title">Next</span>
60+
<span class="nhsuk-u-visually-hidden">:</span>
61+
<span class="nhsuk-pagination__page">@nextMessage</span>
62+
<svg class="nhsuk-icon nhsuk-icon__arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" width="34" height="34">
63+
<path d="M19.6 11.66l-2.73-3A.51.51 0 0 0 16 9v2H5a1 1 0 0 0 0 2h11v2a.5.5 0 0 0 .32.46.39.39 0 0 0 .18 0 .52.52 0 0 0 .37-.16l2.73-3a.5.5 0 0 0 0-.64z"></path>
64+
</svg>
65+
</a>
66+
</li>
67+
}
68+
</ul>
69+
</nav>
70+
}

LearningHub.Nhs.WebUI/Views/MyAccount/_UserPrimarySpecialtyPaging.cshtml

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -22,48 +22,50 @@
2222
}
2323
}
2424

25+
@if (showPaging == true)
26+
{
27+
<nav class="nhsuk-pagination" role="navigation" aria-label="Pagination">
28+
<ul class="nhsuk-list nhsuk-pagination__list">
2529

26-
<nav class="nhsuk-pagination" role="navigation" aria-label="Pagination">
27-
<ul class="nhsuk-list nhsuk-pagination__list">
30+
@if (pagingModel.CurrentPage <= 1)
31+
{
32+
<li class="nhsuk-pagination-item--previous">
2833

29-
@if (pagingModel.CurrentPage <= 1)
30-
{
31-
<li class="nhsuk-pagination-item--previous">
32-
33-
</li>
34-
}
35-
else
36-
{
37-
<li class="nhsuk-pagination-item--previous">
38-
<a class="nhsuk-pagination__link nhsuk-pagination__link--prev" asp-action="ChangePrimarySpecialty" asp-route-currentPage="@(CurrentPageIndex - 1)" asp-route-filterText="@Context.Request.Query["filterText"]">
39-
<span class="nhsuk-pagination__title">Previous</span>
40-
<span class="nhsuk-u-visually-hidden">:</span>
41-
<span class="nhsuk-pagination__page">@previousMessage</span>
42-
<svg class="nhsuk-icon nhsuk-icon__arrow-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" width="34" height="34">
43-
<path d="M4.1 12.3l2.7 3c.2.2.5.2.7 0 .1-.1.1-.2.1-.3v-2h11c.6 0 1-.4 1-1s-.4-1-1-1h-11V9c0-.2-.1-.4-.3-.5h-.2c-.1 0-.3.1-.4.2l-2.7 3c0 .2 0 .4.1.6z"></path>
44-
</svg>
45-
</a>
46-
</li>
47-
}
48-
@if (pagingModel.CurrentPage == pagingModel.TotalPages)
49-
{
50-
<li class="nhsuk-pagination-item--next">
34+
</li>
35+
}
36+
else
37+
{
38+
<li class="nhsuk-pagination-item--previous">
39+
<a class="nhsuk-pagination__link nhsuk-pagination__link--prev" asp-action="ChangePrimarySpecialty" asp-route-currentPage="@(CurrentPageIndex - 1)" asp-route-filterText="@Context.Request.Query["filterText"]">
40+
<span class="nhsuk-pagination__title">Previous</span>
41+
<span class="nhsuk-u-visually-hidden">:</span>
42+
<span class="nhsuk-pagination__page">@previousMessage</span>
43+
<svg class="nhsuk-icon nhsuk-icon__arrow-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" width="34" height="34">
44+
<path d="M4.1 12.3l2.7 3c.2.2.5.2.7 0 .1-.1.1-.2.1-.3v-2h11c.6 0 1-.4 1-1s-.4-1-1-1h-11V9c0-.2-.1-.4-.3-.5h-.2c-.1 0-.3.1-.4.2l-2.7 3c0 .2 0 .4.1.6z"></path>
45+
</svg>
46+
</a>
47+
</li>
48+
}
49+
@if (pagingModel.CurrentPage == pagingModel.TotalPages)
50+
{
51+
<li class="nhsuk-pagination-item--next">
5152

52-
</li>
53-
}
54-
else
55-
{
56-
<li class="nhsuk-pagination-item--next">
57-
<a class="nhsuk-pagination__link nhsuk-pagination__link--next" asp-action="ChangePrimarySpecialty" asp-route-currentPage="@(CurrentPageIndex + 1)" asp-route-filterText="@Context.Request.Query["filterText"]">
58-
<span class="nhsuk-pagination__title">Next</span>
59-
<span class="nhsuk-u-visually-hidden">:</span>
60-
<span class="nhsuk-pagination__page">@nextMessage</span>
61-
<svg class="nhsuk-icon nhsuk-icon__arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" width="34" height="34">
62-
<path d="M19.6 11.66l-2.73-3A.51.51 0 0 0 16 9v2H5a1 1 0 0 0 0 2h11v2a.5.5 0 0 0 .32.46.39.39 0 0 0 .18 0 .52.52 0 0 0 .37-.16l2.73-3a.5.5 0 0 0 0-.64z"></path>
63-
</svg>
64-
</a>
65-
</li>
66-
}
67-
</ul>
68-
</nav>
53+
</li>
54+
}
55+
else
56+
{
57+
<li class="nhsuk-pagination-item--next">
58+
<a class="nhsuk-pagination__link nhsuk-pagination__link--next" asp-action="ChangePrimarySpecialty" asp-route-currentPage="@(CurrentPageIndex + 1)" asp-route-filterText="@Context.Request.Query["filterText"]">
59+
<span class="nhsuk-pagination__title">Next</span>
60+
<span class="nhsuk-u-visually-hidden">:</span>
61+
<span class="nhsuk-pagination__page">@nextMessage</span>
62+
<svg class="nhsuk-icon nhsuk-icon__arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" width="34" height="34">
63+
<path d="M19.6 11.66l-2.73-3A.51.51 0 0 0 16 9v2H5a1 1 0 0 0 0 2h11v2a.5.5 0 0 0 .32.46.39.39 0 0 0 .18 0 .52.52 0 0 0 .37-.16l2.73-3a.5.5 0 0 0 0-.64z"></path>
64+
</svg>
65+
</a>
66+
</li>
67+
}
68+
</ul>
69+
</nav>
70+
}
6971

LearningHub.Nhs.WebUI/Views/MyAccount/_UserWorkPlacePaging.cshtml

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -22,48 +22,49 @@
2222
}
2323
}
2424

25+
@if (showPaging == true)
26+
{
27+
<nav class="nhsuk-pagination" role="navigation" aria-label="Pagination">
28+
<ul class="nhsuk-list nhsuk-pagination__list">
2529

26-
<nav class="nhsuk-pagination" role="navigation" aria-label="Pagination">
27-
<ul class="nhsuk-list nhsuk-pagination__list">
30+
@if (pagingModel.CurrentPage <= 1)
31+
{
32+
<li class="nhsuk-pagination-item--previous">
2833

29-
@if (pagingModel.CurrentPage <= 1)
30-
{
31-
<li class="nhsuk-pagination-item--previous">
32-
33-
</li>
34-
}
35-
else
36-
{
37-
<li class="nhsuk-pagination-item--previous">
38-
<a class="nhsuk-pagination__link nhsuk-pagination__link--prev" asp-action="ChangeWorkPlace" asp-route-currentPage="@(CurrentPageIndex - 1)" asp-route-filterText="@Context.Request.Query["filterText"]">
39-
<span class="nhsuk-pagination__title">Previous</span>
40-
<span class="nhsuk-u-visually-hidden">:</span>
41-
<span class="nhsuk-pagination__page">@previousMessage</span>
42-
<svg class="nhsuk-icon nhsuk-icon__arrow-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" width="34" height="34">
43-
<path d="M4.1 12.3l2.7 3c.2.2.5.2.7 0 .1-.1.1-.2.1-.3v-2h11c.6 0 1-.4 1-1s-.4-1-1-1h-11V9c0-.2-.1-.4-.3-.5h-.2c-.1 0-.3.1-.4.2l-2.7 3c0 .2 0 .4.1.6z"></path>
44-
</svg>
45-
</a>
46-
</li>
47-
}
48-
@if (pagingModel.CurrentPage == pagingModel.TotalPages)
49-
{
50-
<li class="nhsuk-pagination-item--next">
51-
52-
</li>
53-
}
54-
else
55-
{
56-
<li class="nhsuk-pagination-item--next">
57-
<a class="nhsuk-pagination__link nhsuk-pagination__link--next" asp-action="ChangeWorkPlace" asp-route-currentPage="@(CurrentPageIndex + 1)" asp-route-filterText="@Context.Request.Query["filterText"]">
58-
<span class="nhsuk-pagination__title">Next</span>
59-
<span class="nhsuk-u-visually-hidden">:</span>
60-
<span class="nhsuk-pagination__page">@nextMessage</span>
61-
<svg class="nhsuk-icon nhsuk-icon__arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" width="34" height="34">
62-
<path d="M19.6 11.66l-2.73-3A.51.51 0 0 0 16 9v2H5a1 1 0 0 0 0 2h11v2a.5.5 0 0 0 .32.46.39.39 0 0 0 .18 0 .52.52 0 0 0 .37-.16l2.73-3a.5.5 0 0 0 0-.64z"></path>
63-
</svg>
64-
</a>
65-
</li>
66-
}
67-
</ul>
68-
</nav>
34+
</li>
35+
}
36+
else
37+
{
38+
<li class="nhsuk-pagination-item--previous">
39+
<a class="nhsuk-pagination__link nhsuk-pagination__link--prev" asp-action="ChangeWorkPlace" asp-route-currentPage="@(CurrentPageIndex - 1)" asp-route-filterText="@Context.Request.Query["filterText"]">
40+
<span class="nhsuk-pagination__title">Previous</span>
41+
<span class="nhsuk-u-visually-hidden">:</span>
42+
<span class="nhsuk-pagination__page">@previousMessage</span>
43+
<svg class="nhsuk-icon nhsuk-icon__arrow-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" width="34" height="34">
44+
<path d="M4.1 12.3l2.7 3c.2.2.5.2.7 0 .1-.1.1-.2.1-.3v-2h11c.6 0 1-.4 1-1s-.4-1-1-1h-11V9c0-.2-.1-.4-.3-.5h-.2c-.1 0-.3.1-.4.2l-2.7 3c0 .2 0 .4.1.6z"></path>
45+
</svg>
46+
</a>
47+
</li>
48+
}
49+
@if (pagingModel.CurrentPage == pagingModel.TotalPages)
50+
{
51+
<li class="nhsuk-pagination-item--next">
6952

53+
</li>
54+
}
55+
else
56+
{
57+
<li class="nhsuk-pagination-item--next">
58+
<a class="nhsuk-pagination__link nhsuk-pagination__link--next" asp-action="ChangeWorkPlace" asp-route-currentPage="@(CurrentPageIndex + 1)" asp-route-filterText="@Context.Request.Query["filterText"]">
59+
<span class="nhsuk-pagination__title">Next</span>
60+
<span class="nhsuk-u-visually-hidden">:</span>
61+
<span class="nhsuk-pagination__page">@nextMessage</span>
62+
<svg class="nhsuk-icon nhsuk-icon__arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" width="34" height="34">
63+
<path d="M19.6 11.66l-2.73-3A.51.51 0 0 0 16 9v2H5a1 1 0 0 0 0 2h11v2a.5.5 0 0 0 .32.46.39.39 0 0 0 .18 0 .52.52 0 0 0 .37-.16l2.73-3a.5.5 0 0 0 0-.64z"></path>
64+
</svg>
65+
</a>
66+
</li>
67+
}
68+
</ul>
69+
</nav>
70+
}

0 commit comments

Comments
 (0)