From e110c0fd504a27cf62ebe4439032eb8ed4d63b3c Mon Sep 17 00:00:00 2001 From: Lauren Qurashi <46787754+LaurenQurashi@users.noreply.github.com> Date: Mon, 23 Oct 2023 14:17:59 +0100 Subject: [PATCH] Tp2000 959 measure list design changes (#1072) * Add regulation to measure list table * WIP - Add selected filters to template * Add selected filter string formatting * Small design changes * broken test - WIP * Fix tests * Capitalise all chosen filter bullets --- measures/filters.py | 2 +- measures/forms.py | 2 +- measures/jinja2/includes/measures/list.jinja | 2 + measures/jinja2/measures/list.jinja | 15 +++ measures/jinja2/measures/search.jinja | 9 +- measures/tests/test_views.py | 60 ++++++++++ measures/views.py | 113 +++++++++++++++++++ 7 files changed, 194 insertions(+), 9 deletions(-) diff --git a/measures/filters.py b/measures/filters.py index dc3bf996a..1c7c84951 100644 --- a/measures/filters.py +++ b/measures/filters.py @@ -97,7 +97,7 @@ def __init__(self, *args, **kwargs): ) measure_filters_modifier = BooleanFilter( - label="Filter by current Workbasket", + label="Filter by current workbasket", widget=forms.CheckboxInput(), method="measures_filter", required=False, diff --git a/measures/forms.py b/measures/forms.py index 969d7f010..6e4ddf1d5 100644 --- a/measures/forms.py +++ b/measures/forms.py @@ -819,7 +819,7 @@ def __init__(self, *args, **kwargs): Div( "modc", HTML( - "

To use the 'Include inherited measures' filter, enter a valid commodity code in the 'Select commodity code' filter above

", + "

To use the 'Include inherited measures' filter, enter a valid commodity code in the 'Specific commodity code' filter above

", ), css_class="govuk-grid-column-full form-group-margin-bottom-2", ), diff --git a/measures/jinja2/includes/measures/list.jinja b/measures/jinja2/includes/measures/list.jinja index 4f47e5ac8..7b2999815 100644 --- a/measures/jinja2/includes/measures/list.jinja +++ b/measures/jinja2/includes/measures/list.jinja @@ -68,6 +68,7 @@ {"text": create_link(measure.order_number.get_url(), measure.order_number.order_number) if measure.order_number else '-'}, {"text": footnotes_display(measure.footnoteassociationmeasure_set.current())}, {"text": conditions_list(measure) if measure.conditions.current() else "-", "classes": "govuk-!-width-one-quarter"}, + {"text": create_link(url("regulation-ui-detail", kwargs={"role_type": measure.generating_regulation.role_type,"regulation_id": measure.generating_regulation.regulation_id}), measure.generating_regulation.regulation_id) if measure.generating_regulation.regulation_id else '-'}, ]) or "" }} {% endfor %} {{ govukTable({ @@ -84,6 +85,7 @@ {"text": "Quota"}, {"text": "Footnote"}, {"text": "Conditions"}, + {"text": "Regulations"}, ], "rows": table_rows, "classes": "govuk-table-m" diff --git a/measures/jinja2/measures/list.jinja b/measures/jinja2/measures/list.jinja index 663bf38a3..938969399 100644 --- a/measures/jinja2/measures/list.jinja +++ b/measures/jinja2/measures/list.jinja @@ -32,7 +32,22 @@

{{ objects_count }} results

+

+ You are currently viewing {{ objects_count }} results for: +

+
+ {% for list in selected_filter_lists %} +
+ +
+ {%endfor%} +
+
{% endif %} {% if object_list %} {% include list_include %} diff --git a/measures/jinja2/measures/search.jinja b/measures/jinja2/measures/search.jinja index 3c6334149..adf448f5d 100644 --- a/measures/jinja2/measures/search.jinja +++ b/measures/jinja2/measures/search.jinja @@ -11,17 +11,12 @@ {% block content %}

{{ page_title }}

-

- Search for {{object_list.model._meta.verbose_name_plural}}. - Alternatively, create a new {{ object_list.model._meta.verbose_name }}. -

-