-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a4a0660
commit c86907e
Showing
3 changed files
with
141 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,127 @@ | ||
{% extends "layouts/layout.jinja" %} | ||
|
||
{% from "components/button/macro.njk" import govukButton %} | ||
{% from "components/input/macro.njk" import govukInput %} | ||
{% from "components/table/macro.njk" import govukTable %} | ||
|
||
{% set form_url = "measure-ui-list" %} | ||
{% set list_include = "includes/measures/list.jinja" %} | ||
|
||
{%- include "layouts/list_vertical.jinja" -%} | ||
{% set page_title = "Find and edit " ~ object_list.model._meta.verbose_name_plural %} | ||
|
||
{% block content %} | ||
<h1 class="govuk-heading-xl">{{ page_title }}</h1> | ||
|
||
<div class="full-width-search"> | ||
<div class="govuk-!-margin-bottom-5"> | ||
<h2 class="govuk-heading-m govuk-!-margin-bottom-5">Search and filter</h2> | ||
<p class="govuk-body"> | ||
Select one or more options to search | ||
</p> | ||
<form method="get" action="{{ url(form_url) }}"> | ||
{{ crispy(filter.form) }} | ||
</form> | ||
</div> | ||
|
||
|
||
<div class="govuk-!-margin-top-3"> | ||
{% if paginator.count > 0 %} | ||
|
||
{% set objects_count = '{0:,}'.format(paginator.count) %} | ||
{% if paginator.limit_breached %} | ||
{% set objects_count = objects_count ~ '+' %} | ||
{% endif %} | ||
|
||
<p class="govuk-body-l"> | ||
{{ objects_count }} results | ||
</p> | ||
|
||
{% endif %} | ||
{% if object_list %} | ||
{% include list_include %} | ||
{% else %} | ||
<p class="govuk-body">There are no results for your search, please:</p> | ||
<ul class="govuk-list govuk-list--bullet"> | ||
<li>check the spelling of your keywords</li> | ||
<li>use more general keywords</li> | ||
<li>select or deselect different filters</li> | ||
<li>get help via our <a class="govuk-link" href="#">support and feedback form</a></li> | ||
</ul> | ||
{% endif %} | ||
|
||
|
||
{% if page_obj.has_other_pages() %} | ||
{% set objects_count = '{0:,}'.format(paginator.count) %} | ||
{% set page_count = '{0:,}'.format(paginator.num_pages) %} | ||
{% if paginator.limit_breached %} | ||
{% set objects_count = 'more than ' ~ objects_count %} | ||
{% set page_count = 'more than ' ~ page_count %} | ||
{% endif %} | ||
|
||
<nav class="pagination tamato-clearfix" role="navigation" aria-label="Pagination Navigation"> | ||
<div class="govuk-body"> | ||
Showing {{ page_obj|length }} of {{ objects_count }} | ||
{# Polymorphic TrackedModelsQuerySet instances don't have a valid `model`. #} | ||
{% if items_name %} | ||
{{items_name}} | ||
{% elif page_obj.object_list.model %} | ||
{{ page_obj.object_list.model._meta.verbose_name_plural if paginator.count > 1 else page_obj.object_list.model._meta.verbose_name }} | ||
{% else %} | ||
"items" | ||
{% endif %} | ||
</div> | ||
<div class="govuk-body align-left"> | ||
Page {{page_obj.number}} of {{ page_count }} | ||
</div> | ||
<ul class="govuk-list align-right"> | ||
{% if page_obj.has_previous() %} | ||
<li> | ||
<a | ||
class="govuk-link govuk-!-margin-right-1" | ||
href="?{{ query_transform(request, page=page_obj.previous_page_number())}}" | ||
rel="prev" | ||
aria-label="Goto Page {{ page_obj.previous_page_number() }}" | ||
> | ||
Prev | ||
</a> | ||
</li> | ||
{% endif %} | ||
{% for page_link in page_links %} | ||
{% set isCurrent = page_link == page_obj.number %} | ||
<li | ||
class="{{ 'govuk-!-margin-left-2 govuk-!-margin-right-2' if isCurrent else 'govuk-!-margin-right-1'}}" | ||
{% if isCurrent %}aria-current="true"{% endif %} | ||
> | ||
{% if page_link == '...' or page_link == page_obj.number|string %} | ||
{{ page_link }} | ||
{% else %} | ||
<a | ||
class="govuk-link" | ||
href="?{{ query_transform(request, page=page_link) }}" | ||
aria-label="Goto Page {{ page_link }}" | ||
>{{ '{0:,}'.format(page_link|int) }}</a> | ||
{% endif %} | ||
</li> | ||
{% endfor %} | ||
{% if paginator.limit_breached %} | ||
<li class="govuk-!-margin-right-1" >...</li> | ||
{% endif %} | ||
{% if page_obj.has_next() %} | ||
<li> | ||
<a | ||
class="govuk-link" | ||
href="?{{ query_transform(request, page=page_obj.next_page_number()) }}" | ||
rel="next" | ||
aria-label="Goto Page {{ page_obj.next_page_number() }}" | ||
> | ||
Next | ||
</a> | ||
</li> | ||
{% endif %} | ||
</ul> | ||
</nav> | ||
{% endif %} | ||
|
||
</div> | ||
</div> | ||
{% endblock %} |
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