-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove actionable pagination for single page (#478)
* remove 'registered by' from search results * remove page range if only single page of search results * update test
- Loading branch information
1 parent
0361250
commit 0c12c22
Showing
5 changed files
with
46 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,40 @@ | ||
{% load future %} | ||
{% if results %} | ||
<nav class="govuk-pagination" role="navigation" aria-label="Pagination"> | ||
{% if page_obj.has_previous %} | ||
<div class="govuk-pagination__prev"> | ||
<a class="govuk-link govuk-pagination__link" href="{% url 'home:pagination' page=page_obj.previous_page_number %}{% query_string clear_label=None clear_filter=None %}" rel="prev"> | ||
<svg class="govuk-pagination__icon govuk-pagination__icon--prev" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13"> | ||
<path d="m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z"></path> | ||
</svg> | ||
<span class="govuk-pagination__link-title">Previous<span class="govuk-visually-hidden"> page</span></span></a> | ||
</div> | ||
{% endif %} | ||
<ul class="govuk-pagination__list"> | ||
{% for p in page_range %} | ||
{% if paginator.ELLIPSIS != p %} | ||
{% if page_obj.number == p %} | ||
<li class="govuk-pagination__item govuk-pagination__item--current"> | ||
{% else %} | ||
<li class="govuk-pagination__item"> | ||
{% endif %} | ||
<a class="govuk-link govuk-pagination__link" href="{% url 'home:pagination' page=p %}{% query_string clear_label=None clear_filter=None new=None %}" aria-label="Page {{ p }}"> | ||
{{ p }} | ||
</a> | ||
</li> | ||
{% else %} | ||
<li class="govuk-pagination__item govuk-pagination__item--ellipses">⋯</li> | ||
<nav class="govuk-pagination" role="navigation" aria-label="Pagination"> | ||
{% if page_obj.has_previous %} | ||
<div class="govuk-pagination__prev"> | ||
<a class="govuk-link govuk-pagination__link" href="{% url 'home:pagination' page=page_obj.previous_page_number %}{% query_string clear_label=None clear_filter=None %}" rel="prev"> | ||
<svg class="govuk-pagination__icon govuk-pagination__icon--prev" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13"> | ||
<path d="m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z"></path> | ||
</svg> | ||
<span class="govuk-pagination__link-title">Previous<span class="govuk-visually-hidden"> page</span></span></a> | ||
</div> | ||
{% endif %} | ||
<ul class="govuk-pagination__list"> | ||
{% if total_results > results_per_page %} | ||
{% for p in page_range %} | ||
{% if paginator.ELLIPSIS != p %} | ||
{% if page_obj.number == p %} | ||
<li class="govuk-pagination__item govuk-pagination__item--current"> | ||
{% else %} | ||
<li class="govuk-pagination__item"> | ||
{% endif %} | ||
<a class="govuk-link govuk-pagination__link" href="{% url 'home:pagination' page=p %}{% query_string clear_label=None clear_filter=None new=None %}" aria-label="Page {{ p }}"> | ||
{{ p }} | ||
</a> | ||
</li> | ||
{% else %} | ||
<li class="govuk-pagination__item govuk-pagination__item--ellipses">⋯</li> | ||
{% endif %} | ||
{% endfor %} | ||
{% endif %} | ||
{% endfor %} | ||
</ul> | ||
{% if page_obj.has_next %} | ||
<div class="govuk-pagination__next"> | ||
<a class="govuk-link govuk-pagination__link" href="{% url 'home:pagination' page=page_obj.next_page_number %}{% query_string clear_label=None clear_filter=None value=None new=None %}" rel="next"> <span class="govuk-pagination__link-title">Next<span class="govuk-visually-hidden"> page</span></span> <svg class="govuk-pagination__icon govuk-pagination__icon--next" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13"> | ||
<path d="m8.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z"></path> | ||
</svg></a> | ||
</div> | ||
{% endif %} | ||
</nav> | ||
{% endif %} | ||
</ul> | ||
{% if page_obj.has_next %} | ||
<div class="govuk-pagination__next"> | ||
<a class="govuk-link govuk-pagination__link" href="{% url 'home:pagination' page=page_obj.next_page_number %}{% query_string clear_label=None clear_filter=None value=None new=None %}" rel="next"> <span class="govuk-pagination__link-title">Next<span class="govuk-visually-hidden"> page</span></span> <svg class="govuk-pagination__icon govuk-pagination__icon--next" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13"> | ||
<path d="m8.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z"></path> | ||
</svg></a> | ||
</div> | ||
{% endif %} | ||
</nav> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters