diff --git a/measures/jinja2/measures/list.jinja b/measures/jinja2/measures/list.jinja index 40085e0efd..9097231845 100644 --- a/measures/jinja2/measures/list.jinja +++ b/measures/jinja2/measures/list.jinja @@ -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 %} +

{{ page_title }}

+ + +{% endblock %} diff --git a/measures/views.py b/measures/views.py index 098aeabe6e..789587513c 100644 --- a/measures/views.py +++ b/measures/views.py @@ -27,6 +27,7 @@ from common.forms import unprefix_formset_data from common.models import TrackedModel +from common.pagination import build_pagination_list from common.serializers import AutoCompleteSerializer from common.util import TaricDateRange from common.validators import UpdateType @@ -176,10 +177,23 @@ def get_form_kwargs(self): def paginator(self): filterset_class = self.get_filterset_class() self.filterset = self.get_filterset(filterset_class) - return MeasurePaginator(self.filterset.qs, per_page=20) + return MeasurePaginator(self.filterset.qs, per_page=200) def get_context_data(self, **kwargs): - context = super().get_context_data(**kwargs) + context = {} + paginator = self.paginator + page = paginator.get_page(self.request.GET.get("page", 1)) + context["is_paginated"] = True + context["filter"] = kwargs["filter"] + context["form"] = self.get_form() + context["view"] = self + context["paginator"] = paginator + context["page_obj"] = page + context["object_list"] = page.object_list + context["page_links"] = build_pagination_list( + page.number, + page.paginator.num_pages, + ) measure_selections = [ SelectableObjectsForm.object_id_from_field_name(name) for name in self.measure_selections diff --git a/settings/common.py b/settings/common.py index 69febc37f9..a9d80312cb 100644 --- a/settings/common.py +++ b/settings/common.py @@ -736,7 +736,7 @@ LIMITED_PAGINATOR_MAX_COUNT = 200 # Default max number of objects that will be accurately counted by MeasurePaginator. MEASURES_PAGINATOR_MAX_COUNT = int( - os.environ.get("MEASURES_PAGINATOR_MAX_COUNT", "1000"), + os.environ.get("MEASURES_PAGINATOR_MAX_COUNT", "30000"), ) # key used to instantiate GOVUK Notify python client