From 36b707282daf5c5aeb0b810faaacf9ed218aa467 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Tue, 24 Oct 2023 14:24:51 +0100 Subject: [PATCH 01/41] gds accordion system prototype for search filters --- templates/search/blocks/search_filters.html | 332 ++++++++++++-------- 1 file changed, 194 insertions(+), 138 deletions(-) diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index 8e7a2a7f3..be04a2d80 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -15,161 +15,217 @@

+ + +
{% comment %} Hidden on archive & creator as they currently have no filters {% endcomment %}

Refine results

- -
- {% comment %} - {% if form.group.value == 'tna' %} -
- TODO make this a django form element - - - +
+
+
+

+ + Writing well for the web + +

- {% endif %} - {% endcomment %} - - {% if form.filter_keyword %} -
- - {{ form.filter_keyword }} - {{ form.filter_keyword.errors }} - +
+

This is the content for Writing well for the web.

- {% endif %} - -
-

Edit filters

- - {% if form.group.value == 'tna' or form.group.value == 'digitised' or form.group.value == 'nonTna' %} -
-
- -

Dates

-
- - For example, 27 3 2007 or 2007 -
{{ form.covering_date_from.label_tag }}
- -
- - {% if form.covering_date_from.errors %} -
- {{ form.covering_date_from.errors }} -
- {% endif %} - {{ form.covering_date_from }} - -
- -
- - {{ form.covering_date_to.label_tag }} - {% if form.covering_date_to.errors %} -
- {{ form.covering_date_to.errors }} -
- {% endif %} - {{ form.covering_date_to }} - -
- - -
-
- {% endif %} - - - {% include "search/includes/filter.html" with field=form.collection %} - - - - {% include "search/includes/filter.html" with field=form.time_period %} - - {% include "search/includes/filter.html" with field=form.topic %} - - {% include "search/includes/filter.html" with field=form.format %} - - {% if form.group.value != bucketkeys.NONTNA.value %} - {% include "search/includes/filter.html" with field=form.level %} - {% endif %} - - {% include "search/includes/filter.html" with field=form.closure %} - - - - {% if form.group.value == 'tna' or form.group.value == 'digitised' %} -
-
- -

Record opening date

-
- -
+
+
+
+

+ + Writing well for specialists + +

+
+
+

This is the content for Writing well for specialists.

+
+
+
+
+

+ + Know your audience + +

+
+
+

This is the content for Know your audience.

+
+
+
+
+

+ + How people read + +

+
+
+

This is the content for How people read.

+
+
+
- For example, 27 3 2007 or 2007
- {{ form.opening_start_date.label_tag }} - {% if form.opening_start_date.errors %} -
- {{ form.opening_start_date.errors }} -
- {% endif %} - {{ form.opening_start_date }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
- + + -
+ - {{ form.opening_end_date.label_tag }} - {% if form.opening_end_date.errors %} -
- {{ form.opening_end_date.errors }} -
- {% endif %} - {{ form.opening_end_date }} + + + + + + + + + + -
+ - - -
+ + + - {% endif %} + - {% if form.group.value == bucketkeys.NONTNA.value %} - {% include "search/includes/filter.html" with field=form.held_by %} - {% include "search/includes/filter.html" with field=form.catalogue_source %} - {% endif %} + + + + - {% if form.group.value == bucketkeys.CREATOR.value %} - {% include "search/includes/filter.html" with field=form.type %} - {% include "search/includes/filter.html" with field=form.country %} - {% endif %} + + + + - {% if form.group.value == bucketkeys.ARCHIVE.value %} - {% include "search/includes/filter.html" with field=form.location %} - {% endif %} -
+ + + + - {# render hidden inputs for fields controlled by other forms #} - {% render_fields_as_hidden form include='q group sort_by sort_order' %} + + - + {% comment %} {% include './search_export_and_share.html' %} {% endcomment %}
From e7b652f71d11e8fb8547674dff7420a61ac0f2bb Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Tue, 24 Oct 2023 14:36:46 +0100 Subject: [PATCH 02/41] content blocks for search filters accordian --- templates/search/blocks/search_filters.html | 43 +++++++++++++++++---- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index be04a2d80..09cc00910 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -26,55 +26,82 @@

Refine results

- Writing well for the web + Search within

-

This is the content for Writing well for the web.

+

This is the content for Search within.

- Writing well for specialists + Dates

-

This is the content for Writing well for specialists.

+

This is the content for Dates.

- Know your audience + Collections

-

This is the content for Know your audience.

+

This is the content for Collections.

- How people read + Level

-

This is the content for How people read.

+

This is the content for Level.

+
+
+
+
+

+ + Closure status + +

+
+
+

This is the content for Closure status.

+
+
+
+
+

+ + Record opening date + +

+
+
+

This is the content for Record opening date.

+ + + From 2733b4131ec37b57afafb0ba6d936f1bf0481bb8 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Tue, 24 Oct 2023 15:03:15 +0100 Subject: [PATCH 03/41] integration of search filter sections --- templates/search/blocks/search_filters.html | 142 +++++++++++--------- 1 file changed, 75 insertions(+), 67 deletions(-) diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index 09cc00910..b71b7c52d 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -26,77 +26,85 @@

Refine results

- Search within + Search within Results:

-

This is the content for Search within.

-
- -
-
-

- - Dates - -

-
-
-

This is the content for Dates.

-
-
-
-
-

- - Collections - -

-
-
-

This is the content for Collections.

-
-
-
-
-

- - Level - -

-
-
-

This is the content for Level.

-
-
-
-
-

- - Closure status - -

-
-
-

This is the content for Closure status.

-
-
-
-
-

- - Record opening date - -

-
-
-

This is the content for Record opening date.

-
-
- - - +

+

+ + {{ form.filter_keyword }} + {{ form.filter_keyword.errors }} + +
+

+ + + +
+
+

+ + Dates + +

+
+
+

This is the content for Dates.

+
+
+
+
+

+ + Collections + +

+
+
+

This is the content for Collections.

+
+
+
+
+

+ + Level + +

+
+
+

This is the content for Level.

+
+
+
+
+

+ + Closure status + +

+
+
+

This is the content for Closure status.

+
+
+
+
+

+ + Record opening date + +

+
+
+

This is the content for Record opening date.

+
+
+ + + From 028e0b691533eae7b6e1447deb516928a1f0e02d Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Tue, 24 Oct 2023 16:19:36 +0100 Subject: [PATCH 04/41] initial section styles for search filters accordion. --- templates/search/blocks/search_filters.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index b71b7c52d..2b9db6ebf 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -1,5 +1,6 @@ {% load search_tags %} +

@@ -24,7 +25,7 @@

Refine results

-

+

Search within Results: @@ -44,7 +45,7 @@

-

+

Dates @@ -56,7 +57,7 @@

-

+

Collections @@ -68,7 +69,7 @@

-

+

Level @@ -80,7 +81,7 @@

-

+

Closure status @@ -92,7 +93,7 @@

-

+

Record opening date From c17e93986acbba076e34a07152a54f15f3d06a16 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Wed, 25 Oct 2023 15:39:20 +0100 Subject: [PATCH 05/41] dates section for search filters accordian --- templates/search/blocks/search_filters.html | 55 +++++++++++++++++++-- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index 2b9db6ebf..3c3e698f0 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -40,9 +40,8 @@

- -
-
+
+

@@ -52,7 +51,55 @@

-

This is the content for Dates.

+
+

Edit filters

+ + {% if form.group.value == 'tna' or form.group.value == 'digitised' or form.group.value == 'nonTna' %} +
+
+ +

Dates

+
+ + For example, 27 3 2007 or 2007 +
{{ form.covering_date_from.label_tag }}
+ +
+ + {% if form.covering_date_from.errors %} +
+ {{ form.covering_date_from.errors }} +
+ {% endif %} + {{ form.covering_date_from }} + +
+ +
+ + {{ form.covering_date_to.label_tag }} + {% if form.covering_date_to.errors %} +
+ {{ form.covering_date_to.errors }} +
+ {% endif %} + {{ form.covering_date_to }} + +
+ + +
+
+ {% endif %} + + +
From 4992405e3f8dfb97ed57e3ed338cf9822eacb240 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Wed, 25 Oct 2023 15:57:11 +0100 Subject: [PATCH 06/41] initial styling for search filter accordian --- sass/includes/search/_search-filters.scss | 7 +++++++ templates/search/blocks/search_filters.html | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sass/includes/search/_search-filters.scss b/sass/includes/search/_search-filters.scss index 9568acbb5..7bc152b34 100644 --- a/sass/includes/search/_search-filters.scss +++ b/sass/includes/search/_search-filters.scss @@ -120,6 +120,12 @@ color: #ffffff; margin-bottom: 2rem; } + + button { + border:0; + border-bottom:1px solid grey; + margin-bottom:10px; + } } /*date filters via GDS pattern*/ @@ -153,3 +159,4 @@ .example-text { color: $color__grey-600; } + diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index 3c3e698f0..200ff6c13 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -97,7 +97,7 @@
+
From c7c1cf40d383e4c27a39a7fc0050cc9a4e45107d Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Thu, 26 Oct 2023 10:45:54 +0100 Subject: [PATCH 08/41] Sort by update --- templates/search/blocks/search_sort_and_view_options.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/search/blocks/search_sort_and_view_options.html b/templates/search/blocks/search_sort_and_view_options.html index 3969d7128..157d494df 100644 --- a/templates/search/blocks/search_sort_and_view_options.html +++ b/templates/search/blocks/search_sort_and_view_options.html @@ -13,7 +13,7 @@

{% render_fields_as_hidden form exclude='sort_by' %} - +

Display as:

From 5153fc1b76d4860a632c768d7d23c54a8e31e9d7 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Thu, 26 Oct 2023 14:12:01 +0100 Subject: [PATCH 09/41] population of accordion element for search filters --- templates/search/blocks/search_filters.html | 26 ++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index b727439d8..cfd9c0e31 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -111,6 +111,7 @@

+ {% include "search/includes/filter.html" with field=form.collection %}

This is the content for Collections.

@@ -123,7 +124,9 @@

-

This is the content for Level.

+ {% if form.group.value != bucketkeys.NONTNA.value %} + {% include "search/includes/filter.html" with field=form.level %} + {% endif %}
@@ -135,7 +138,8 @@

-

This is the content for Closure status.

+ {% include "search/includes/filter.html" with field=form.closure %} +
@@ -147,7 +151,23 @@

-

This is the content for Record opening date.

+
+ + For example, 27 3 2007 or 2007
+ {{ form.opening_start_date.label_tag }} + {% if form.opening_start_date.errors %} +
+ {{ form.opening_start_date.errors }} +
+ {% endif %} + {{ form.opening_start_date }} + +
+ +
From 7d89cfc18e74235a18d8ce27e96952b23138aa69 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Thu, 26 Oct 2023 14:36:06 +0100 Subject: [PATCH 10/41] search filters accordian --- sass/includes/search/_search-filters.scss | 5 +++++ templates/search/blocks/search_filters.html | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sass/includes/search/_search-filters.scss b/sass/includes/search/_search-filters.scss index 7bc152b34..360534708 100644 --- a/sass/includes/search/_search-filters.scss +++ b/sass/includes/search/_search-filters.scss @@ -123,8 +123,13 @@ button { border:0; + background:#f4f4f4; border-bottom:1px solid grey; margin-bottom:10px; + width:100%; + text-align: left; + font-weight: 400; + font-size:1em; } } diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index cfd9c0e31..83b91ded9 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -112,7 +112,7 @@

{% include "search/includes/filter.html" with field=form.collection %} -

This is the content for Collections.

+
@@ -166,8 +166,8 @@

+ -

From 6ff2eccddb249169cb012b1be0f051f38591c580 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Mon, 30 Oct 2023 11:09:05 +0000 Subject: [PATCH 11/41] gov uk display overides for search filters --- sass/includes/search/_search-filters.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sass/includes/search/_search-filters.scss b/sass/includes/search/_search-filters.scss index 360534708..711d19608 100644 --- a/sass/includes/search/_search-filters.scss +++ b/sass/includes/search/_search-filters.scss @@ -165,3 +165,8 @@ color: $color__grey-600; } +//gov uk overrides + +.govuk-accordion__section-toggle-text { + display:none; +} \ No newline at end of file From e24a90b6db7063b6cd375d8ab7cae6619ea97f11 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Mon, 30 Oct 2023 11:12:48 +0000 Subject: [PATCH 12/41] display overides --- sass/includes/search/_search-filters.scss | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sass/includes/search/_search-filters.scss b/sass/includes/search/_search-filters.scss index 711d19608..4bd3abdb3 100644 --- a/sass/includes/search/_search-filters.scss +++ b/sass/includes/search/_search-filters.scss @@ -167,6 +167,9 @@ //gov uk overrides -.govuk-accordion__section-toggle-text { +.govuk-accordion__section-toggle-text, +.govuk-accordion__section-heading-divider{ display:none; -} \ No newline at end of file +} + + \ No newline at end of file From 7a557560524da6906e504bbb592a336f2bc26117 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Mon, 30 Oct 2023 11:14:22 +0000 Subject: [PATCH 13/41] button cursor for filters accordian --- sass/includes/search/_search-filters.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/sass/includes/search/_search-filters.scss b/sass/includes/search/_search-filters.scss index 4bd3abdb3..26208e2b8 100644 --- a/sass/includes/search/_search-filters.scss +++ b/sass/includes/search/_search-filters.scss @@ -130,6 +130,7 @@ text-align: left; font-weight: 400; font-size:1em; + cursor: pointer; } } From baccdef9c454bed66679a34d4c4904c20374828c Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Mon, 30 Oct 2023 11:17:24 +0000 Subject: [PATCH 14/41] visual improvement --- templates/search/blocks/search_filters.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index 83b91ded9..ea0b388c5 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -27,7 +27,7 @@

Refine results

- Search within Results: + Search within Results

From 6439a2d6b1467ada628e952ff802add16d1ca8c4 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Mon, 30 Oct 2023 11:23:38 +0000 Subject: [PATCH 15/41] typography / labelling improvement --- templates/search/blocks/search_filters.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index ea0b388c5..99ffbb202 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -21,20 +21,20 @@

{% comment %} Hidden on archive & creator as they currently have no filters {% endcomment %} -

Refine results

+

Refine results:

- Search within Results + Search within results

- + {{ form.filter_keyword }} {{ form.filter_keyword.errors }} From 7a5ebe56db09e7c42bf9a64e2be60e0db94afbb2 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Wed, 1 Nov 2023 14:20:03 +0000 Subject: [PATCH 16/41] commenting of form elements --- templates/search/blocks/search_filters.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index 99ffbb202..f895e0495 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -1,6 +1,6 @@ {% load search_tags %} - +

@@ -15,6 +15,7 @@

+ @@ -173,7 +174,7 @@

- + From 744cad2bf8034aafeba42d9ea3d78b963b58c572 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Wed, 1 Nov 2023 14:27:37 +0000 Subject: [PATCH 17/41] new and existing form together - debug. --- templates/search/blocks/search_filters.html | 280 ++++++++++---------- 1 file changed, 140 insertions(+), 140 deletions(-) diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index f895e0495..bcb46ef1e 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -180,157 +180,157 @@

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+ {% comment %} + {% if form.group.value == 'tna' %} +
+ TODO make this a django form element + + + +
+ {% endif %} + {% endcomment %} + + {% if form.filter_keyword %} +
+ + {{ form.filter_keyword }} + {{ form.filter_keyword.errors }} + +
+ {% endif %} + +
+

Edit filters

+ + {% if form.group.value == 'tna' or form.group.value == 'digitised' or form.group.value == 'nonTna' %} +
+
+ +

Dates

+
+ + For example, 27 3 2007 or 2007 +
{{ form.covering_date_from.label_tag }}
+ +
+ + {% if form.covering_date_from.errors %} +
+ {{ form.covering_date_from.errors }} +
+ {% endif %} + {{ form.covering_date_from }} + +
+ +
+ + {{ form.covering_date_to.label_tag }} + {% if form.covering_date_to.errors %} +
+ {{ form.covering_date_to.errors }} +
+ {% endif %} + {{ form.covering_date_to }} + +
+ + +
+
+ {% endif %} + + + {% include "search/includes/filter.html" with field=form.collection %} + - - - + {% include "search/includes/filter.html" with field=form.time_period %} - - - - - - - - - - + {% include "search/includes/filter.html" with field=form.topic %} - + {% include "search/includes/filter.html" with field=form.format %} - - - + {% if form.group.value != bucketkeys.NONTNA.value %} + {% include "search/includes/filter.html" with field=form.level %} + {% endif %} - + {% include "search/includes/filter.html" with field=form.closure %} - - - - - - - - - - - - + {% if form.group.value == 'tna' or form.group.value == 'digitised' %} +
+
+ +

Record opening date

+
- - +
- + For example, 27 3 2007 or 2007
+ {{ form.opening_start_date.label_tag }} + {% if form.opening_start_date.errors %} +
+ {{ form.opening_start_date.errors }} +
+ {% endif %} + {{ form.opening_start_date }} + +
+ + +
+ + {{ form.opening_end_date.label_tag }} + {% if form.opening_end_date.errors %} +
+ {{ form.opening_end_date.errors }} +
+ {% endif %} + {{ form.opening_end_date }} + +
+ + +
+
+ + {% endif %} + + {% if form.group.value == bucketkeys.NONTNA.value %} + {% include "search/includes/filter.html" with field=form.held_by %} + {% include "search/includes/filter.html" with field=form.catalogue_source %} + {% endif %} + + {% if form.group.value == bucketkeys.CREATOR.value %} + {% include "search/includes/filter.html" with field=form.type %} + {% include "search/includes/filter.html" with field=form.country %} + {% endif %} + + {% if form.group.value == bucketkeys.ARCHIVE.value %} + {% include "search/includes/filter.html" with field=form.location %} + {% endif %} +
+ + {# render hidden inputs for fields controlled by other forms #} + {% render_fields_as_hidden form include='q group sort_by sort_order' %} + +
{% comment %} {% include './search_export_and_share.html' %} {% endcomment %}

From 1fd3d08baa34b858b3b9cfab7b4febcbdc60b09a Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Wed, 1 Nov 2023 14:48:57 +0000 Subject: [PATCH 18/41] search filters form consolidation with accordion element --- templates/search/blocks/search_filters.html | 388 +++++++------------- 1 file changed, 125 insertions(+), 263 deletions(-) diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index bcb46ef1e..ae545e6aa 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -17,320 +17,182 @@

- - - -
- {% comment %} Hidden on archive & creator as they currently have no filters {% endcomment %} -

Refine results:

-
-
-
-

+
+ {% comment %} + {% if form.group.value == 'tna' %} +
+ TODO make this a django form element + + + +
+ {% endif %} + {% endcomment %} + +
+ {% comment %} Hidden on archive & creator as they currently have no filters {% endcomment %} +

Refine results:

+
+
+
+

Search within results -

-
-
-

-

- - {{ form.filter_keyword }} - {{ form.filter_keyword.errors }} - +

+
+
+

+

+ + {{ form.filter_keyword }} + {{ form.filter_keyword.errors }} + +
+

-

-
-
-
-

+
+
+

Dates -

-
-
-
-

Edit filters

- - {% if form.group.value == 'tna' or form.group.value == 'digitised' or form.group.value == 'nonTna' %} -
-
- -

Dates

-
- - For example, 27 3 2007 or 2007 -
{{ form.covering_date_from.label_tag }}
- -
- - {% if form.covering_date_from.errors %} -
+

+
+
+
+

Edit filters

+ + {% if form.group.value == 'tna' or form.group.value == 'digitised' or form.group.value == 'nonTna' %} +
+
+ +

Dates

+
+ + For example, 27 3 2007 or 2007 +
{{ form.covering_date_from.label_tag }}
+ +
+ + {% if form.covering_date_from.errors %} +
{{ form.covering_date_from.errors }} -
- {% endif %} - {{ form.covering_date_from }} +
+ {% endif %} + {{ form.covering_date_from }} -
+
-
+
- {{ form.covering_date_to.label_tag }} - {% if form.covering_date_to.errors %} -
+ {{ form.covering_date_to.label_tag }} + {% if form.covering_date_to.errors %} +
{{ form.covering_date_to.errors }} -
- {% endif %} - {{ form.covering_date_to }} +
+ {% endif %} + {{ form.covering_date_to }} -
+
- - -
- {% endif %} + + +
+ {% endif %} -
-
-
-
-

+

+
+
+
+

Collections -

-
-
- {% include "search/includes/filter.html" with field=form.collection %} +

+ +
+ {% include "search/includes/filter.html" with field=form.collection %} -
- -
-
-

+

+
+
+
+

Level -

-
-
- {% if form.group.value != bucketkeys.NONTNA.value %} - {% include "search/includes/filter.html" with field=form.level %} - {% endif %} -
-
-
-
-

+

+
+
+ {% if form.group.value != bucketkeys.NONTNA.value %} + {% include "search/includes/filter.html" with field=form.level %} + {% endif %} +
+
+
+
+

Closure status -

-
-
- {% include "search/includes/filter.html" with field=form.closure %} +

+ +
+ {% include "search/includes/filter.html" with field=form.closure %} -
- -
-
-

+

+
+
+
+

Record opening date -

-
-
-
- - For example, 27 3 2007 or 2007
- {{ form.opening_start_date.label_tag }} - {% if form.opening_start_date.errors %} -
- {{ form.opening_start_date.errors }} -
- {% endif %} - {{ form.opening_start_date }} - -
- - -
-
- - - - - - - - - - - {% comment %} - {% if form.group.value == 'tna' %} -
- TODO make this a django form element - - - -
- {% endif %} - {% endcomment %} - - {% if form.filter_keyword %} -
- - {{ form.filter_keyword }} - {{ form.filter_keyword.errors }} - -
- {% endif %} - -
-

Edit filters

- - {% if form.group.value == 'tna' or form.group.value == 'digitised' or form.group.value == 'nonTna' %} -
-
- -

Dates

-
- - For example, 27 3 2007 or 2007 -
{{ form.covering_date_from.label_tag }}
- -
- - {% if form.covering_date_from.errors %} -
- {{ form.covering_date_from.errors }} -
- {% endif %} - {{ form.covering_date_from }} - -
- -
- - {{ form.covering_date_to.label_tag }} - {% if form.covering_date_to.errors %} -
- {{ form.covering_date_to.errors }} -
- {% endif %} - {{ form.covering_date_to }} - -
- - -
-
- {% endif %} - - - {% include "search/includes/filter.html" with field=form.collection %} - - - - {% include "search/includes/filter.html" with field=form.time_period %} - - {% include "search/includes/filter.html" with field=form.topic %} - - {% include "search/includes/filter.html" with field=form.format %} - - {% if form.group.value != bucketkeys.NONTNA.value %} - {% include "search/includes/filter.html" with field=form.level %} - {% endif %} - - {% include "search/includes/filter.html" with field=form.closure %} - - - - {% if form.group.value == 'tna' or form.group.value == 'digitised' %} -
-
- -

Record opening date

-
- +

+ +
For example, 27 3 2007 or 2007
{{ form.opening_start_date.label_tag }} {% if form.opening_start_date.errors %} -
- {{ form.opening_start_date.errors }} -
+ {{ form.opening_start_date.errors }} +
{% endif %} {{ form.opening_start_date }}
- - -
- - {{ form.opening_end_date.label_tag }} - {% if form.opening_end_date.errors %} -
- {{ form.opening_end_date.errors }} -
- {% endif %} - {{ form.opening_end_date }} - -
- - - - {% endif %} + + + + - {% if form.group.value == bucketkeys.NONTNA.value %} - {% include "search/includes/filter.html" with field=form.held_by %} - {% include "search/includes/filter.html" with field=form.catalogue_source %} - {% endif %} + + + + + - {% if form.group.value == bucketkeys.CREATOR.value %} - {% include "search/includes/filter.html" with field=form.type %} - {% include "search/includes/filter.html" with field=form.country %} - {% endif %} - {% if form.group.value == bucketkeys.ARCHIVE.value %} - {% include "search/includes/filter.html" with field=form.location %} - {% endif %} - - {# render hidden inputs for fields controlled by other forms #} - {% render_fields_as_hidden form include='q group sort_by sort_order' %} - + {% comment %} {% include './search_export_and_share.html' %} {% endcomment %} From b5d40a8112e408727d2251bec955779e83f77c54 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Wed, 1 Nov 2023 15:28:16 +0000 Subject: [PATCH 19/41] formatting --- sass/includes/search/_search-filters.scss | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/sass/includes/search/_search-filters.scss b/sass/includes/search/_search-filters.scss index 26208e2b8..7ecbc298d 100644 --- a/sass/includes/search/_search-filters.scss +++ b/sass/includes/search/_search-filters.scss @@ -122,14 +122,14 @@ } button { - border:0; - background:#f4f4f4; - border-bottom:1px solid grey; - margin-bottom:10px; - width:100%; + border: 0; + background: #f4f4f4; + border-bottom: 1px solid grey; + margin-bottom: 10px; + width: 100%; text-align: left; font-weight: 400; - font-size:1em; + font-size: 1em; cursor: pointer; } } @@ -169,8 +169,6 @@ //gov uk overrides .govuk-accordion__section-toggle-text, -.govuk-accordion__section-heading-divider{ - display:none; +.govuk-accordion__section-heading-divider { + display: none; } - - \ No newline at end of file From 54f8e4338c1cd8ec22b0d61fffbaff89607c9e65 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Wed, 1 Nov 2023 15:40:41 +0000 Subject: [PATCH 20/41] python check --- templates/search/blocks/search_filters.html | 3 --- 1 file changed, 3 deletions(-) diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index ae545e6aa..94009b120 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -189,9 +189,6 @@

- - - {% comment %} {% include './search_export_and_share.html' %} {% endcomment %} From 1efa83b1ead513e5193e9e13a57b21123fa56e12 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Thu, 2 Nov 2023 10:45:18 +0000 Subject: [PATCH 21/41] formatting adjustment --- templates/search/blocks/search_filters.html | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index 94009b120..c3894bdfa 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -190,6 +190,5 @@

- {% comment %} {% include './search_export_and_share.html' %} {% endcomment %} From 95e7f2be58f6560c646c78514a1e6a016cb66433 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Thu, 2 Nov 2023 11:09:36 +0000 Subject: [PATCH 22/41] font size adjustment --- sass/includes/search/_search-filters.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sass/includes/search/_search-filters.scss b/sass/includes/search/_search-filters.scss index 7ecbc298d..8642a1977 100644 --- a/sass/includes/search/_search-filters.scss +++ b/sass/includes/search/_search-filters.scss @@ -129,8 +129,9 @@ width: 100%; text-align: left; font-weight: 400; - font-size: 1em; + font-size: 1.12rem; cursor: pointer; + } } From b1abddfbf4a9a5b8ba277417f5804613375b18f0 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Mon, 6 Nov 2023 11:37:39 +0000 Subject: [PATCH 23/41] integrating local coy of accordion script --- templates/search/blocks/search_filters.html | 10 ++++++++++ templates/static/scripts/accordion.min.js | 2 ++ 2 files changed, 12 insertions(+) create mode 100644 templates/static/scripts/accordion.min.js diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index c3894bdfa..57d54f227 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -1,4 +1,6 @@ {% load search_tags %} + +
@@ -183,12 +185,20 @@

+ + {% load static %} + + + + {% comment %} {% include './search_export_and_share.html' %} {% endcomment %} + diff --git a/templates/static/scripts/accordion.min.js b/templates/static/scripts/accordion.min.js new file mode 100644 index 000000000..b8f3ed23a --- /dev/null +++ b/templates/static/scripts/accordion.min.js @@ -0,0 +1,2 @@ +!function(){"use strict";function t(t,e){if(window.NodeList.prototype.forEach)return t.forEach(e);for(var n=0;n1&&o.shift(),n[o.join(".")]=t[i]}return n}function i(t){if("string"!=typeof t)return t;var e=t.trim();return"true"===e||"false"!==e&&(e.length>0&&isFinite(Number(e))?Number(e):t)}function o(t){var e={};for(var n in t)e[n]=i(t[n]);return e}function s(t,e){this.translations=t||{},this.locale=e&&e.locale||document.documentElement.lang||"en"}(function(t){var e,n,i,o;"defineProperty"in Object&&function(){try{return Object.defineProperty({},"test",{value:42}),!0}catch(t){return!1}}()||(e=Object.defineProperty,n=Object.prototype.hasOwnProperty("__defineGetter__"),i="Getters & setters cannot be defined on this javascript engine",o="A property cannot both have accessors and be writable or have a value",Object.defineProperty=function(t,s,r){if(e&&(t===window||t===document||t===Element.prototype||t instanceof Element))return e(t,s,r);if(null===t||!(t instanceof Object||"object"==typeof t))throw new TypeError("Object.defineProperty called on non-object");if(!(r instanceof Object))throw new TypeError("Property description must be an object");var a=String(s),l="value"in r||"writable"in r,c="get"in r&&typeof r.get,u="set"in r&&typeof r.set;if(c){if("function"!==c)throw new TypeError("Getter must be a function");if(!n)throw new TypeError(i);if(l)throw new TypeError(o);Object.__defineGetter__.call(t,a,r.get)}else t[a]=r.value;if(u){if("function"!==u)throw new TypeError("Setter must be a function");if(!n)throw new TypeError(i);if(l)throw new TypeError(o);Object.__defineSetter__.call(t,a,r.set)}return"value"in r&&(t[a]=r.value),t})}).call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"Document"in this||"undefined"==typeof WorkerGlobalScope&&"function"!=typeof importScripts&&(this.HTMLDocument?this.Document=this.HTMLDocument:(this.Document=this.HTMLDocument=document.constructor=new Function("return function Document() {}")(),this.Document.prototype=document))}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"Element"in this&&"HTMLElement"in this||function(){if(!window.Element||window.HTMLElement){window.Element=window.HTMLElement=new Function("return function Element() {}")();var t,e=document.appendChild(document.createElement("body")),n=e.appendChild(document.createElement("iframe")).contentWindow.document,i=Element.prototype=n.appendChild(n.createElement("*")),o={},s=function(t,e){var n,i,r,a=t.childNodes||[],l=-1;if(1===t.nodeType&&t.constructor!==Element)for(n in t.constructor=Element,o)i=o[n],t[n]=i;for(;r=e&&a[++l];)s(r,e);return t},r=document.getElementsByTagName("*"),a=document.createElement,l=100;i.attachEvent("onpropertychange",(function(t){for(var e,n=t.propertyName,s=!o.hasOwnProperty(n),a=i[n],l=o[n],c=-1;e=r[++c];)1===e.nodeType&&(s||e[n]===l)&&(e[n]=a);o[n]=a})),i.constructor=Element,i.hasAttribute||(i.hasAttribute=function(t){return null!==this.getAttribute(t)}),c()||(document.onreadystatechange=c,t=setInterval(c,25)),document.createElement=function(t){var e=a(String(t).toLowerCase());return s(e)},document.removeChild(e)}else window.HTMLElement=window.Element;function c(){return l--||clearTimeout(t),!(!document.body||document.body.prototype||!/(complete|interactive)/.test(document.readyState))&&(s(document,!0),t&&document.body.prototype&&clearTimeout(t),!!document.body.prototype)}}()}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){(function(){if(!document.documentElement.dataset)return!1;var t=document.createElement("div");return t.setAttribute("data-a-b","c"),t.dataset&&"c"==t.dataset.aB})()||Object.defineProperty(Element.prototype,"dataset",{get:function(){for(var t=this.attributes,e={},n=0;n=3&&t%100<=10?"few":t%100>=11&&t%100<=99?"many":"other"},chinese:function(){return"other"},french:function(t){return 0===t||1===t?"one":"other"},german:function(t){return 1===t?"one":"other"},irish:function(t){return 1===t?"one":2===t?"two":t>=3&&t<=6?"few":t>=7&&t<=10?"many":"other"},russian:function(t){var e=t%100,n=e%10;return 1===n&&11!==e?"one":n>=2&&n<=4&&!(e>=12&&e<=14)?"few":0===n||n>=5&&n<=9||e>=11&&e<=14?"many":"other"},scottish:function(t){return 1===t||11===t?"one":2===t||12===t?"two":t>=3&&t<=10||t>=13&&t<=19?"few":"other"},spanish:function(t){return 1===t?"one":t%1e6==0&&0!==t?"many":"other"},welsh:function(t){return 0===t?"zero":1===t?"one":2===t?"two":3===t?"few":6===t?"many":"other"}},function(t){var e;"DOMTokenList"in this&&(!("classList"in(e=document.createElement("x")))||!e.classList.toggle("x",!1)&&!e.className)||function(e){var n;"DOMTokenList"in e&&e.DOMTokenList&&(!document.createElementNS||!document.createElementNS("http://www.w3.org/2000/svg","svg")||document.createElementNS("http://www.w3.org/2000/svg","svg").classList instanceof DOMTokenList)||(e.DOMTokenList=function(){var e=!0,i=function(t,n,i,o){Object.defineProperty?Object.defineProperty(t,n,{configurable:!1===e||!!o,get:i}):t.__defineGetter__(n,i)};try{i({},"support")}catch(n){e=!1}return function(e,n){var o=this,s=[],r={},a=0,l=0,c=function(t){i(o,t,(function(){return d(),s[t]}),!1)},u=function(){if(a>=l)for(;l>>0,"object"==typeof e[n]?e[n].baseVal=s.join(" "):e[n]=s.join(" "),u())},o.remove=function(){d.apply(o,t=arguments);for(var t,i={},l=0,c=[];l>>0,"object"==typeof e[n]?e[n].baseVal=s.join(" "):e[n]=s.join(" "),u()},o.toggle=function(e,n){return d.apply(o,[e]),t!==n?n?(o.add(e),!0):(o.remove(e),!1):r[e]?(o.remove(e),!1):(o.add(e),!0)},o}}()),"classList"in(n=document.createElement("span"))&&(n.classList.toggle("x",!1),n.classList.contains("x")&&(n.classList.constructor.prototype.toggle=function(e){var n=arguments[1];if(n===t){var i=!this.contains(e);return this[i?"add":"remove"](e),i}return this[(n=!!n)?"add":"remove"](e),n})),function(){var t=document.createElement("span");if("classList"in t&&(t.classList.add("a","b"),!t.classList.contains("b"))){var e=t.classList.constructor.prototype.add;t.classList.constructor.prototype.add=function(){for(var t=arguments,n=arguments.length,i=0;i=this.lastInputTimestamp)&&this.updateIfValueChanged()}.bind(this),1e3)},d.prototype.handleBlur=function(){clearInterval(this.valueChecker)},d.prototype.updateIfValueChanged=function(){this.$textarea.value!==this.lastInputValue&&(this.lastInputValue=this.$textarea.value,this.updateCountMessage())},d.prototype.updateCountMessage=function(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()},d.prototype.updateVisibleCountMessage=function(){var t=this.$textarea,e=this.$visibleCountMessage,n=this.maxLength-this.count(t.value);this.isOverThreshold()?e.classList.remove("govuk-character-count__message--disabled"):e.classList.add("govuk-character-count__message--disabled"),n<0?(t.classList.add("govuk-textarea--error"),e.classList.remove("govuk-hint"),e.classList.add("govuk-error-message")):(t.classList.remove("govuk-textarea--error"),e.classList.remove("govuk-error-message"),e.classList.add("govuk-hint")),e.innerText=this.getCountMessage()},d.prototype.updateScreenReaderCountMessage=function(){var t=this.$screenReaderCountMessage;this.isOverThreshold()?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden","true"),t.innerText=this.getCountMessage()},d.prototype.count=function(t){return"maxwords"in this.config&&this.config.maxwords?(t.match(/\S+/g)||[]).length:t.length},d.prototype.getCountMessage=function(){var t=this.maxLength-this.count(this.$textarea.value),e="maxwords"in this.config&&this.config.maxwords?"words":"characters";return this.formatCountMessage(t,e)},d.prototype.formatCountMessage=function(t,e){if(0===t)return this.i18n.t(e+"AtLimit");var n=t<0?"OverLimit":"UnderLimit";return this.i18n.t(e+n,{count:Math.abs(t)})},d.prototype.isOverThreshold=function(){if(!this.config.threshold)return!0;var t=this.$textarea,e=this.count(t.value);return this.maxLength*this.config.threshold/100<=e},h.prototype.init=function(){if(this.$module&&this.$inputs){var e=this.$module;t(this.$inputs,(function(t){var e=t.getAttribute("data-aria-controls");e&&document.getElementById(e)&&(t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls"))})),window.addEventListener("onpageshow"in window?"pageshow":"DOMContentLoaded",this.syncAllConditionalReveals.bind(this)),this.syncAllConditionalReveals(),e.addEventListener("click",this.handleClick.bind(this))}},h.prototype.syncAllConditionalReveals=function(){t(this.$inputs,this.syncConditionalRevealWithInputState.bind(this))},h.prototype.syncConditionalRevealWithInputState=function(t){var e=t.getAttribute("aria-controls");if(e){var n=document.getElementById(e);if(n&&n.classList.contains("govuk-checkboxes__conditional")){var i=t.checked;t.setAttribute("aria-expanded",i.toString()),n.classList.toggle("govuk-checkboxes__conditional--hidden",!i)}}},h.prototype.unCheckAllInputsExcept=function(e){var n=this;t(document.querySelectorAll('input[type="checkbox"][name="'+e.name+'"]'),(function(t){e.form===t.form&&t!==e&&(t.checked=!1,n.syncConditionalRevealWithInputState(t))}))},h.prototype.unCheckExclusiveInputs=function(e){var n=this;t(document.querySelectorAll('input[data-behaviour="exclusive"][type="checkbox"][name="'+e.name+'"]'),(function(t){e.form===t.form&&(t.checked=!1,n.syncConditionalRevealWithInputState(t))}))},h.prototype.handleClick=function(t){var e=t.target;e instanceof HTMLInputElement&&"checkbox"===e.type&&(e.getAttribute("aria-controls")&&this.syncConditionalRevealWithInputState(e),e.checked&&("exclusive"===e.getAttribute("data-behaviour")?this.unCheckAllInputsExcept(e):this.unCheckExclusiveInputs(e)))};function p(t){if(!(t instanceof HTMLElement))return this;this.$module=t,this.$summary=null,this.$content=null}function m(t,n){if(!(t instanceof HTMLElement))return this;this.$module=t;this.config=e({disableAutoFocus:!1},n||{},o(t.dataset))}p.prototype.init=function(){this.$module&&("HTMLDetailsElement"in window&&this.$module instanceof HTMLDetailsElement||this.polyfillDetails())},p.prototype.polyfillDetails=function(){var t,e=this.$module,n=this.$summary=e.getElementsByTagName("summary").item(0),i=this.$content=e.getElementsByTagName("div").item(0);n&&i&&(i.id||(i.id="details-content-"+(t=(new Date).getTime(),void 0!==window.performance&&"function"==typeof window.performance.now&&(t+=window.performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)})))),e.setAttribute("role","group"),n.setAttribute("role","button"),n.setAttribute("aria-controls",i.id),n.tabIndex=0,this.$module.hasAttribute("open")?n.setAttribute("aria-expanded","true"):(n.setAttribute("aria-expanded","false"),i.style.display="none"),this.polyfillHandleInputs(this.polyfillSetAttributes.bind(this)))},p.prototype.polyfillSetAttributes=function(){return this.$module.hasAttribute("open")?(this.$module.removeAttribute("open"),this.$summary.setAttribute("aria-expanded","false"),this.$content.style.display="none"):(this.$module.setAttribute("open","open"),this.$summary.setAttribute("aria-expanded","true"),this.$content.style.display=""),!0},p.prototype.polyfillHandleInputs=function(t){this.$summary.addEventListener("keypress",(function(e){var n=e.target;13!==e.keyCode&&32!==e.keyCode||n instanceof HTMLElement&&"summary"===n.nodeName.toLowerCase()&&(e.preventDefault(),n.click?n.click():t(e))})),this.$summary.addEventListener("keyup",(function(t){var e=t.target;32===t.keyCode&&e instanceof HTMLElement&&"summary"===e.nodeName.toLowerCase()&&t.preventDefault()})),this.$summary.addEventListener("click",t)},m.prototype.init=function(){if(this.$module){var t=this.$module;this.setFocus(),t.addEventListener("click",this.handleClick.bind(this))}},m.prototype.setFocus=function(){var t=this.$module;this.config.disableAutoFocus||(t.setAttribute("tabindex","-1"),t.addEventListener("blur",(function(){t.removeAttribute("tabindex")})),t.focus())},m.prototype.handleClick=function(t){var e=t.target;this.focusTarget(e)&&t.preventDefault()},m.prototype.focusTarget=function(t){if(!(t instanceof HTMLAnchorElement))return!1;var e=this.getFragmentFromUrl(t.href);if(!e)return!1;var n=document.getElementById(e);if(!n)return!1;var i=this.getAssociatedLegendOrLabel(n);return!!i&&(i.scrollIntoView(),n.focus({preventScroll:!0}),!0)},m.prototype.getFragmentFromUrl=function(t){if(-1!==t.indexOf("#"))return t.split("#").pop()},m.prototype.getAssociatedLegendOrLabel=function(t){var e=t.closest("fieldset");if(e){var n=e.getElementsByTagName("legend");if(n.length){var i=n[0];if(t instanceof HTMLInputElement&&("checkbox"===t.type||"radio"===t.type))return i;var o=i.getBoundingClientRect().top,s=t.getBoundingClientRect();if(s.height&&window.innerHeight)if(s.top+s.height-o0?this.$indicatorContainer.classList.add("govuk-exit-this-page__indicator--visible"):this.$indicatorContainer.classList.remove("govuk-exit-this-page__indicator--visible"),t(this.$indicatorContainer.querySelectorAll(".govuk-exit-this-page__indicator-light"),function(t,e){t.classList.toggle("govuk-exit-this-page__indicator-light--on",e=3?(this.keypressCounter=0,null!==this.keypressTimeoutId&&(clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=null),this.exitPage()):1===this.keypressCounter?this.$updateSpan.innerText=this.i18n.t("pressTwoMoreTimes"):this.$updateSpan.innerText=this.i18n.t("pressOneMoreTime"),this.setKeypressTimer()),this.lastKeyWasModified=t.shiftKey},v.prototype.setKeypressTimer=function(){clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=setTimeout(this.resetKeypressTimer.bind(this),this.timeoutTime)},v.prototype.resetKeypressTimer=function(){clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=null,this.keypressCounter=0,this.$updateSpan.innerText=this.i18n.t("timedOut"),this.timeoutMessageId=setTimeout(function(){this.$updateSpan.innerText=""}.bind(this),this.timeoutTime),this.updateIndicator()},v.prototype.resetPage=function(){document.body.classList.remove("govuk-exit-this-page-hide-content"),this.$overlay&&(this.$overlay.remove(),this.$overlay=null),this.$updateSpan.setAttribute("role","status"),this.$updateSpan.innerText="",this.updateIndicator(),this.keypressTimeoutId&&clearTimeout(this.keypressTimeoutId),this.timeoutMessageId&&clearTimeout(this.timeoutMessageId)},v.prototype.init=function(){this.buildIndicator(),this.initUpdateSpan(),this.initButtonClickHandler(),"govukFrontendExitThisPageKeypress"in document.body.dataset||(document.addEventListener("keyup",this.handleKeypress.bind(this),!0),document.body.dataset.govukFrontendExitThisPageKeypress="true"),window.addEventListener("onpageshow"in window?"pageshow":"DOMContentLoaded",this.resetPage.bind(this))},b.prototype.init=function(){this.$module&&this.$menuButton&&this.$menu&&("matchMedia"in window?(this.mql=window.matchMedia("(min-width: 48.0625em)"),"addEventListener"in this.mql?this.mql.addEventListener("change",this.syncState.bind(this)):this.mql.addListener(this.syncState.bind(this)),this.syncState(),this.$menuButton.addEventListener("click",this.handleMenuButtonClick.bind(this))):this.$menuButton.setAttribute("hidden",""))},b.prototype.syncState=function(){this.mql.matches?(this.$menu.removeAttribute("hidden"),this.$menuButton.setAttribute("hidden","")):(this.$menuButton.removeAttribute("hidden"),this.$menuButton.setAttribute("aria-expanded",this.menuIsOpen.toString()),this.menuIsOpen?this.$menu.removeAttribute("hidden"):this.$menu.setAttribute("hidden",""))},b.prototype.handleMenuButtonClick=function(){this.menuIsOpen=!this.menuIsOpen,this.syncState()},g.prototype.init=function(){this.$module&&this.setFocus()},g.prototype.setFocus=function(){var t=this.$module;this.config.disableAutoFocus||"alert"===t.getAttribute("role")&&(t.getAttribute("tabindex")||(t.setAttribute("tabindex","-1"),t.addEventListener("blur",(function(){t.removeAttribute("tabindex")}))),t.focus())},y.prototype.init=function(){if(this.$module&&this.$inputs){var e=this.$module;t(this.$inputs,(function(t){var e=t.getAttribute("data-aria-controls");e&&document.getElementById(e)&&(t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls"))})),window.addEventListener("onpageshow"in window?"pageshow":"DOMContentLoaded",this.syncAllConditionalReveals.bind(this)),this.syncAllConditionalReveals(),e.addEventListener("click",this.handleClick.bind(this))}},y.prototype.syncAllConditionalReveals=function(){t(this.$inputs,this.syncConditionalRevealWithInputState.bind(this))},y.prototype.syncConditionalRevealWithInputState=function(t){var e=t.getAttribute("aria-controls");if(e){var n=document.getElementById(e);if(n&&n.classList.contains("govuk-radios__conditional")){var i=t.checked;t.setAttribute("aria-expanded",i.toString()),n.classList.toggle("govuk-radios__conditional--hidden",!i)}}},y.prototype.handleClick=function(e){var n=this,i=e.target;if(i instanceof HTMLInputElement&&"radio"===i.type){var o=document.querySelectorAll('input[type="radio"][aria-controls]'),s=i.form,r=i.name;t(o,(function(t){var e=t.form===s;t.name===r&&e&&n.syncConditionalRevealWithInputState(t)}))}},w.prototype.init=function(){if(this.$module){var t=this.getLinkedElement();t&&(this.$linkedElement=t,this.$module.addEventListener("click",this.focusLinkedElement.bind(this)))}},w.prototype.getLinkedElement=function(){var t=this.getFragmentFromUrl();return t?document.getElementById(t):null},w.prototype.focusLinkedElement=function(){var t=this.$linkedElement;t.getAttribute("tabindex")||(t.setAttribute("tabindex","-1"),t.classList.add("govuk-skip-link-focused-element"),this.linkedElementListener||(this.$linkedElement.addEventListener("blur",this.removeFocusProperties.bind(this)),this.linkedElementListener=!0)),t.focus()},w.prototype.removeFocusProperties=function(){this.$linkedElement.removeAttribute("tabindex"),this.$linkedElement.classList.remove("govuk-skip-link-focused-element")},w.prototype.getFragmentFromUrl=function(){if(this.$module.hash)return this.$module.hash.split("#").pop()},function(t){"document"in this&&"nextElementSibling"in document.documentElement||Object.defineProperty(Element.prototype,"nextElementSibling",{get:function(){for(var t=this.nextSibling;t&&1!==t.nodeType;)t=t.nextSibling;return t}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"document"in this&&"previousElementSibling"in document.documentElement||Object.defineProperty(Element.prototype,"previousElementSibling",{get:function(){for(var t=this.previousSibling;t&&1!==t.nodeType;)t=t.previousSibling;return t}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),E.prototype.init=function(){this.$module&&this.$tabs&&("function"==typeof window.matchMedia?this.setupResponsiveChecks():this.setup())},E.prototype.setupResponsiveChecks=function(){this.mql=window.matchMedia("(min-width: 40.0625em)"),this.mql.addListener(this.checkMode.bind(this)),this.checkMode()},E.prototype.checkMode=function(){this.mql.matches?this.setup():this.teardown()},E.prototype.setup=function(){var e=this,n=this.$module,i=this.$tabs,o=n.querySelector(".govuk-tabs__list"),s=n.querySelectorAll(".govuk-tabs__list-item");if(i&&o&&s){o.setAttribute("role","tablist"),t(s,(function(t){t.setAttribute("role","presentation")})),t(i,(function(t){e.setAttributes(t),t.addEventListener("click",e.boundTabClick,!0),t.addEventListener("keydown",e.boundTabKeydown,!0),e.hideTab(t)}));var r=this.getTab(window.location.hash)||this.$tabs[0];r&&(this.showTab(r),window.addEventListener("hashchange",this.boundOnHashChange,!0))}},E.prototype.teardown=function(){var e=this,n=this.$module,i=this.$tabs,o=n.querySelector(".govuk-tabs__list"),s=n.querySelectorAll("a.govuk-tabs__list-item");i&&o&&s&&(o.removeAttribute("role"),t(s,(function(t){t.removeAttribute("role")})),t(i,(function(t){t.removeEventListener("click",e.boundTabClick,!0),t.removeEventListener("keydown",e.boundTabKeydown,!0),e.unsetAttributes(t)})),window.removeEventListener("hashchange",this.boundOnHashChange,!0))},E.prototype.onHashChange=function(){var t=window.location.hash,e=this.getTab(t);if(e)if(this.changingHash)this.changingHash=!1;else{var n=this.getCurrentTab();n&&(this.hideTab(n),this.showTab(e),e.focus())}},E.prototype.hideTab=function(t){this.unhighlightTab(t),this.hidePanel(t)},E.prototype.showTab=function(t){this.highlightTab(t),this.showPanel(t)},E.prototype.getTab=function(t){return this.$module.querySelector('a.govuk-tabs__tab[href="'+t+'"]')},E.prototype.setAttributes=function(t){var e=this.getHref(t).slice(1);t.setAttribute("id","tab_"+e),t.setAttribute("role","tab"),t.setAttribute("aria-controls",e),t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");var n=this.getPanel(t);n&&(n.setAttribute("role","tabpanel"),n.setAttribute("aria-labelledby",t.id),n.classList.add(this.jsHiddenClass))},E.prototype.unsetAttributes=function(t){t.removeAttribute("id"),t.removeAttribute("role"),t.removeAttribute("aria-controls"),t.removeAttribute("aria-selected"),t.removeAttribute("tabindex");var e=this.getPanel(t);e&&(e.removeAttribute("role"),e.removeAttribute("aria-labelledby"),e.classList.remove(this.jsHiddenClass))},E.prototype.onTabClick=function(t){var e=this.getCurrentTab(),n=t.currentTarget;e&&n instanceof HTMLAnchorElement&&(t.preventDefault(),this.hideTab(e),this.showTab(n),this.createHistoryEntry(n))},E.prototype.createHistoryEntry=function(t){var e=this.getPanel(t);if(e){var n=e.id;e.id="",this.changingHash=!0,window.location.hash=this.getHref(t).slice(1),e.id=n}},E.prototype.onTabKeydown=function(t){switch(t.keyCode){case this.keys.left:case this.keys.up:this.activatePreviousTab(),t.preventDefault();break;case this.keys.right:case this.keys.down:this.activateNextTab(),t.preventDefault()}},E.prototype.activateNextTab=function(){var t=this.getCurrentTab();if(t&&t.parentElement){var e=t.parentElement.nextElementSibling;if(e){var n=e.querySelector("a.govuk-tabs__tab");n&&(this.hideTab(t),this.showTab(n),n.focus(),this.createHistoryEntry(n))}}},E.prototype.activatePreviousTab=function(){var t=this.getCurrentTab();if(t&&t.parentElement){var e=t.parentElement.previousElementSibling;if(e){var n=e.querySelector("a.govuk-tabs__tab");n&&(this.hideTab(t),this.showTab(n),n.focus(),this.createHistoryEntry(n))}}},E.prototype.getPanel=function(t){return this.$module.querySelector(this.getHref(t))},E.prototype.showPanel=function(t){var e=this.getPanel(t);e&&e.classList.remove(this.jsHiddenClass)},E.prototype.hidePanel=function(t){var e=this.getPanel(t);e&&e.classList.add(this.jsHiddenClass)},E.prototype.unhighlightTab=function(t){t.parentElement&&(t.setAttribute("aria-selected","false"),t.parentElement.classList.remove("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","-1"))},E.prototype.highlightTab=function(t){t.parentElement&&(t.setAttribute("aria-selected","true"),t.parentElement.classList.add("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","0"))},E.prototype.getCurrentTab=function(){return this.$module.querySelector(".govuk-tabs__list-item--selected a.govuk-tabs__tab")},E.prototype.getHref=function(t){var e=t.getAttribute("href");return e.slice(e.indexOf("#"),e.length)},function(e){var n=(e=void 0!==e?e:{}).scope instanceof HTMLElement?e.scope:document;t(n.querySelectorAll('[data-module="govuk-accordion"]'),(function(t){new a(t,e.accordion).init()})),t(n.querySelectorAll('[data-module="govuk-button"]'),(function(t){new c(t,e.button).init()})),t(n.querySelectorAll('[data-module="govuk-character-count"]'),(function(t){new d(t,e.characterCount).init()})),t(n.querySelectorAll('[data-module="govuk-checkboxes"]'),(function(t){new h(t).init()})),t(n.querySelectorAll('[data-module="govuk-details"]'),(function(t){new p(t).init()}));var i=n.querySelector('[data-module="govuk-error-summary"]');i&&new m(i,e.errorSummary).init(),t(n.querySelectorAll('[data-module="govuk-exit-this-page"]'),(function(t){new v(t,e.exitThisPage).init()}));var o=n.querySelector('[data-module="govuk-header"]');o&&new b(o).init(),t(n.querySelectorAll('[data-module="govuk-notification-banner"]'),(function(t){new g(t,e.notificationBanner).init()})),t(n.querySelectorAll('[data-module="govuk-radios"]'),(function(t){new y(t).init()}));var s=n.querySelector('[data-module="govuk-skip-link"]');s&&new w(s).init(),t(n.querySelectorAll('[data-module="govuk-tabs"]'),(function(t){new E(t).init()}))}({errorSummary:{disableAutoFocus:!0},notificationBanner:{disableAutoFocus:!0}})}(); +//# sourceMappingURL=govuk-frontend-069e73dfb31aacad687703e346188e8c.js.map \ No newline at end of file From 644cc98df4793b214e62a8480825f26221a7ff8c Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Mon, 6 Nov 2023 11:47:50 +0000 Subject: [PATCH 24/41] formatting tidy --- sass/includes/search/_search-filters.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/sass/includes/search/_search-filters.scss b/sass/includes/search/_search-filters.scss index 8642a1977..a84c19825 100644 --- a/sass/includes/search/_search-filters.scss +++ b/sass/includes/search/_search-filters.scss @@ -131,7 +131,6 @@ font-weight: 400; font-size: 1.12rem; cursor: pointer; - } } From 0f02acb9bed9622e7cc5826ebb61379768f0e002 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Thu, 9 Nov 2023 11:21:28 +0000 Subject: [PATCH 25/41] adding in GDS chevron elements --- sass/includes/search/_search-filters.scss | 45 +++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/sass/includes/search/_search-filters.scss b/sass/includes/search/_search-filters.scss index a84c19825..e6b77faa3 100644 --- a/sass/includes/search/_search-filters.scss +++ b/sass/includes/search/_search-filters.scss @@ -126,6 +126,7 @@ background: #f4f4f4; border-bottom: 1px solid grey; margin-bottom: 10px; + padding-bottom:10px; width: 100%; text-align: left; font-weight: 400; @@ -172,3 +173,47 @@ .govuk-accordion__section-heading-divider { display: none; } + +//GDS chevrons + +.govuk-accordion__show-all-text { + + margin-left: 0.5rem; + margin-bottom: 0.5rem; + display: inline-block; +} +.govuk-accordion__section-heading-text-focus { + + margin-right:0.25rem; +} + +.govuk-accordion-nav__chevron--down { + -webkit-transform: rotate(180deg); + transform: rotate(180deg); +} + +.govuk-accordion-nav__chevron { + box-sizing: border-box; + display: inline-block; + position: relative; + width: 1.25rem; + height: 1.25rem; + border: 0.0625rem solid; + border-radius: 50%; + vertical-align: middle; +} + +.govuk-accordion-nav__chevron:after { + content: ""; + box-sizing: border-box; + display: block; + position: absolute; + bottom: 0.3125rem; + left: 0.375rem; + width: 0.375rem; + height: 0.375rem; + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + border-top: 0.125rem solid; + border-right: 0.125rem solid; +} \ No newline at end of file From 84f379f7c48035d45fff26eb25b41d92ad8a0c7b Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Thu, 9 Nov 2023 11:29:45 +0000 Subject: [PATCH 26/41] chevron adjustments --- sass/includes/search/_search-filters.scss | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sass/includes/search/_search-filters.scss b/sass/includes/search/_search-filters.scss index e6b77faa3..1a056fa49 100644 --- a/sass/includes/search/_search-filters.scss +++ b/sass/includes/search/_search-filters.scss @@ -126,7 +126,7 @@ background: #f4f4f4; border-bottom: 1px solid grey; margin-bottom: 10px; - padding-bottom:10px; + padding-bottom: 10px; width: 100%; text-align: left; font-weight: 400; @@ -177,14 +177,12 @@ //GDS chevrons .govuk-accordion__show-all-text { - margin-left: 0.5rem; margin-bottom: 0.5rem; display: inline-block; } .govuk-accordion__section-heading-text-focus { - - margin-right:0.25rem; + margin-right: 0.25rem; } .govuk-accordion-nav__chevron--down { @@ -216,4 +214,4 @@ transform: rotate(-45deg); border-top: 0.125rem solid; border-right: 0.125rem solid; -} \ No newline at end of file +} From 0c5c9ba550a679f17e7cb32ec812328e1c5a0503 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Thu, 9 Nov 2023 11:58:23 +0000 Subject: [PATCH 27/41] html tidy up --- templates/search/blocks/search_filters.html | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index 57d54f227..5ee31574f 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -1,5 +1,4 @@ {% load search_tags %} - From d64672d3448b6529db6438a98993f4d3758b0fb2 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Wed, 29 Nov 2023 14:59:49 +0000 Subject: [PATCH 28/41] accordian.js --- templates/static/scripts/accordion.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/static/scripts/accordion.min.js b/templates/static/scripts/accordion.min.js index b8f3ed23a..7c7df8dd7 100644 --- a/templates/static/scripts/accordion.min.js +++ b/templates/static/scripts/accordion.min.js @@ -1,2 +1,2 @@ !function(){"use strict";function t(t,e){if(window.NodeList.prototype.forEach)return t.forEach(e);for(var n=0;n1&&o.shift(),n[o.join(".")]=t[i]}return n}function i(t){if("string"!=typeof t)return t;var e=t.trim();return"true"===e||"false"!==e&&(e.length>0&&isFinite(Number(e))?Number(e):t)}function o(t){var e={};for(var n in t)e[n]=i(t[n]);return e}function s(t,e){this.translations=t||{},this.locale=e&&e.locale||document.documentElement.lang||"en"}(function(t){var e,n,i,o;"defineProperty"in Object&&function(){try{return Object.defineProperty({},"test",{value:42}),!0}catch(t){return!1}}()||(e=Object.defineProperty,n=Object.prototype.hasOwnProperty("__defineGetter__"),i="Getters & setters cannot be defined on this javascript engine",o="A property cannot both have accessors and be writable or have a value",Object.defineProperty=function(t,s,r){if(e&&(t===window||t===document||t===Element.prototype||t instanceof Element))return e(t,s,r);if(null===t||!(t instanceof Object||"object"==typeof t))throw new TypeError("Object.defineProperty called on non-object");if(!(r instanceof Object))throw new TypeError("Property description must be an object");var a=String(s),l="value"in r||"writable"in r,c="get"in r&&typeof r.get,u="set"in r&&typeof r.set;if(c){if("function"!==c)throw new TypeError("Getter must be a function");if(!n)throw new TypeError(i);if(l)throw new TypeError(o);Object.__defineGetter__.call(t,a,r.get)}else t[a]=r.value;if(u){if("function"!==u)throw new TypeError("Setter must be a function");if(!n)throw new TypeError(i);if(l)throw new TypeError(o);Object.__defineSetter__.call(t,a,r.set)}return"value"in r&&(t[a]=r.value),t})}).call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"Document"in this||"undefined"==typeof WorkerGlobalScope&&"function"!=typeof importScripts&&(this.HTMLDocument?this.Document=this.HTMLDocument:(this.Document=this.HTMLDocument=document.constructor=new Function("return function Document() {}")(),this.Document.prototype=document))}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"Element"in this&&"HTMLElement"in this||function(){if(!window.Element||window.HTMLElement){window.Element=window.HTMLElement=new Function("return function Element() {}")();var t,e=document.appendChild(document.createElement("body")),n=e.appendChild(document.createElement("iframe")).contentWindow.document,i=Element.prototype=n.appendChild(n.createElement("*")),o={},s=function(t,e){var n,i,r,a=t.childNodes||[],l=-1;if(1===t.nodeType&&t.constructor!==Element)for(n in t.constructor=Element,o)i=o[n],t[n]=i;for(;r=e&&a[++l];)s(r,e);return t},r=document.getElementsByTagName("*"),a=document.createElement,l=100;i.attachEvent("onpropertychange",(function(t){for(var e,n=t.propertyName,s=!o.hasOwnProperty(n),a=i[n],l=o[n],c=-1;e=r[++c];)1===e.nodeType&&(s||e[n]===l)&&(e[n]=a);o[n]=a})),i.constructor=Element,i.hasAttribute||(i.hasAttribute=function(t){return null!==this.getAttribute(t)}),c()||(document.onreadystatechange=c,t=setInterval(c,25)),document.createElement=function(t){var e=a(String(t).toLowerCase());return s(e)},document.removeChild(e)}else window.HTMLElement=window.Element;function c(){return l--||clearTimeout(t),!(!document.body||document.body.prototype||!/(complete|interactive)/.test(document.readyState))&&(s(document,!0),t&&document.body.prototype&&clearTimeout(t),!!document.body.prototype)}}()}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){(function(){if(!document.documentElement.dataset)return!1;var t=document.createElement("div");return t.setAttribute("data-a-b","c"),t.dataset&&"c"==t.dataset.aB})()||Object.defineProperty(Element.prototype,"dataset",{get:function(){for(var t=this.attributes,e={},n=0;n=3&&t%100<=10?"few":t%100>=11&&t%100<=99?"many":"other"},chinese:function(){return"other"},french:function(t){return 0===t||1===t?"one":"other"},german:function(t){return 1===t?"one":"other"},irish:function(t){return 1===t?"one":2===t?"two":t>=3&&t<=6?"few":t>=7&&t<=10?"many":"other"},russian:function(t){var e=t%100,n=e%10;return 1===n&&11!==e?"one":n>=2&&n<=4&&!(e>=12&&e<=14)?"few":0===n||n>=5&&n<=9||e>=11&&e<=14?"many":"other"},scottish:function(t){return 1===t||11===t?"one":2===t||12===t?"two":t>=3&&t<=10||t>=13&&t<=19?"few":"other"},spanish:function(t){return 1===t?"one":t%1e6==0&&0!==t?"many":"other"},welsh:function(t){return 0===t?"zero":1===t?"one":2===t?"two":3===t?"few":6===t?"many":"other"}},function(t){var e;"DOMTokenList"in this&&(!("classList"in(e=document.createElement("x")))||!e.classList.toggle("x",!1)&&!e.className)||function(e){var n;"DOMTokenList"in e&&e.DOMTokenList&&(!document.createElementNS||!document.createElementNS("http://www.w3.org/2000/svg","svg")||document.createElementNS("http://www.w3.org/2000/svg","svg").classList instanceof DOMTokenList)||(e.DOMTokenList=function(){var e=!0,i=function(t,n,i,o){Object.defineProperty?Object.defineProperty(t,n,{configurable:!1===e||!!o,get:i}):t.__defineGetter__(n,i)};try{i({},"support")}catch(n){e=!1}return function(e,n){var o=this,s=[],r={},a=0,l=0,c=function(t){i(o,t,(function(){return d(),s[t]}),!1)},u=function(){if(a>=l)for(;l>>0,"object"==typeof e[n]?e[n].baseVal=s.join(" "):e[n]=s.join(" "),u())},o.remove=function(){d.apply(o,t=arguments);for(var t,i={},l=0,c=[];l>>0,"object"==typeof e[n]?e[n].baseVal=s.join(" "):e[n]=s.join(" "),u()},o.toggle=function(e,n){return d.apply(o,[e]),t!==n?n?(o.add(e),!0):(o.remove(e),!1):r[e]?(o.remove(e),!1):(o.add(e),!0)},o}}()),"classList"in(n=document.createElement("span"))&&(n.classList.toggle("x",!1),n.classList.contains("x")&&(n.classList.constructor.prototype.toggle=function(e){var n=arguments[1];if(n===t){var i=!this.contains(e);return this[i?"add":"remove"](e),i}return this[(n=!!n)?"add":"remove"](e),n})),function(){var t=document.createElement("span");if("classList"in t&&(t.classList.add("a","b"),!t.classList.contains("b"))){var e=t.classList.constructor.prototype.add;t.classList.constructor.prototype.add=function(){for(var t=arguments,n=arguments.length,i=0;i=this.lastInputTimestamp)&&this.updateIfValueChanged()}.bind(this),1e3)},d.prototype.handleBlur=function(){clearInterval(this.valueChecker)},d.prototype.updateIfValueChanged=function(){this.$textarea.value!==this.lastInputValue&&(this.lastInputValue=this.$textarea.value,this.updateCountMessage())},d.prototype.updateCountMessage=function(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()},d.prototype.updateVisibleCountMessage=function(){var t=this.$textarea,e=this.$visibleCountMessage,n=this.maxLength-this.count(t.value);this.isOverThreshold()?e.classList.remove("govuk-character-count__message--disabled"):e.classList.add("govuk-character-count__message--disabled"),n<0?(t.classList.add("govuk-textarea--error"),e.classList.remove("govuk-hint"),e.classList.add("govuk-error-message")):(t.classList.remove("govuk-textarea--error"),e.classList.remove("govuk-error-message"),e.classList.add("govuk-hint")),e.innerText=this.getCountMessage()},d.prototype.updateScreenReaderCountMessage=function(){var t=this.$screenReaderCountMessage;this.isOverThreshold()?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden","true"),t.innerText=this.getCountMessage()},d.prototype.count=function(t){return"maxwords"in this.config&&this.config.maxwords?(t.match(/\S+/g)||[]).length:t.length},d.prototype.getCountMessage=function(){var t=this.maxLength-this.count(this.$textarea.value),e="maxwords"in this.config&&this.config.maxwords?"words":"characters";return this.formatCountMessage(t,e)},d.prototype.formatCountMessage=function(t,e){if(0===t)return this.i18n.t(e+"AtLimit");var n=t<0?"OverLimit":"UnderLimit";return this.i18n.t(e+n,{count:Math.abs(t)})},d.prototype.isOverThreshold=function(){if(!this.config.threshold)return!0;var t=this.$textarea,e=this.count(t.value);return this.maxLength*this.config.threshold/100<=e},h.prototype.init=function(){if(this.$module&&this.$inputs){var e=this.$module;t(this.$inputs,(function(t){var e=t.getAttribute("data-aria-controls");e&&document.getElementById(e)&&(t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls"))})),window.addEventListener("onpageshow"in window?"pageshow":"DOMContentLoaded",this.syncAllConditionalReveals.bind(this)),this.syncAllConditionalReveals(),e.addEventListener("click",this.handleClick.bind(this))}},h.prototype.syncAllConditionalReveals=function(){t(this.$inputs,this.syncConditionalRevealWithInputState.bind(this))},h.prototype.syncConditionalRevealWithInputState=function(t){var e=t.getAttribute("aria-controls");if(e){var n=document.getElementById(e);if(n&&n.classList.contains("govuk-checkboxes__conditional")){var i=t.checked;t.setAttribute("aria-expanded",i.toString()),n.classList.toggle("govuk-checkboxes__conditional--hidden",!i)}}},h.prototype.unCheckAllInputsExcept=function(e){var n=this;t(document.querySelectorAll('input[type="checkbox"][name="'+e.name+'"]'),(function(t){e.form===t.form&&t!==e&&(t.checked=!1,n.syncConditionalRevealWithInputState(t))}))},h.prototype.unCheckExclusiveInputs=function(e){var n=this;t(document.querySelectorAll('input[data-behaviour="exclusive"][type="checkbox"][name="'+e.name+'"]'),(function(t){e.form===t.form&&(t.checked=!1,n.syncConditionalRevealWithInputState(t))}))},h.prototype.handleClick=function(t){var e=t.target;e instanceof HTMLInputElement&&"checkbox"===e.type&&(e.getAttribute("aria-controls")&&this.syncConditionalRevealWithInputState(e),e.checked&&("exclusive"===e.getAttribute("data-behaviour")?this.unCheckAllInputsExcept(e):this.unCheckExclusiveInputs(e)))};function p(t){if(!(t instanceof HTMLElement))return this;this.$module=t,this.$summary=null,this.$content=null}function m(t,n){if(!(t instanceof HTMLElement))return this;this.$module=t;this.config=e({disableAutoFocus:!1},n||{},o(t.dataset))}p.prototype.init=function(){this.$module&&("HTMLDetailsElement"in window&&this.$module instanceof HTMLDetailsElement||this.polyfillDetails())},p.prototype.polyfillDetails=function(){var t,e=this.$module,n=this.$summary=e.getElementsByTagName("summary").item(0),i=this.$content=e.getElementsByTagName("div").item(0);n&&i&&(i.id||(i.id="details-content-"+(t=(new Date).getTime(),void 0!==window.performance&&"function"==typeof window.performance.now&&(t+=window.performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)})))),e.setAttribute("role","group"),n.setAttribute("role","button"),n.setAttribute("aria-controls",i.id),n.tabIndex=0,this.$module.hasAttribute("open")?n.setAttribute("aria-expanded","true"):(n.setAttribute("aria-expanded","false"),i.style.display="none"),this.polyfillHandleInputs(this.polyfillSetAttributes.bind(this)))},p.prototype.polyfillSetAttributes=function(){return this.$module.hasAttribute("open")?(this.$module.removeAttribute("open"),this.$summary.setAttribute("aria-expanded","false"),this.$content.style.display="none"):(this.$module.setAttribute("open","open"),this.$summary.setAttribute("aria-expanded","true"),this.$content.style.display=""),!0},p.prototype.polyfillHandleInputs=function(t){this.$summary.addEventListener("keypress",(function(e){var n=e.target;13!==e.keyCode&&32!==e.keyCode||n instanceof HTMLElement&&"summary"===n.nodeName.toLowerCase()&&(e.preventDefault(),n.click?n.click():t(e))})),this.$summary.addEventListener("keyup",(function(t){var e=t.target;32===t.keyCode&&e instanceof HTMLElement&&"summary"===e.nodeName.toLowerCase()&&t.preventDefault()})),this.$summary.addEventListener("click",t)},m.prototype.init=function(){if(this.$module){var t=this.$module;this.setFocus(),t.addEventListener("click",this.handleClick.bind(this))}},m.prototype.setFocus=function(){var t=this.$module;this.config.disableAutoFocus||(t.setAttribute("tabindex","-1"),t.addEventListener("blur",(function(){t.removeAttribute("tabindex")})),t.focus())},m.prototype.handleClick=function(t){var e=t.target;this.focusTarget(e)&&t.preventDefault()},m.prototype.focusTarget=function(t){if(!(t instanceof HTMLAnchorElement))return!1;var e=this.getFragmentFromUrl(t.href);if(!e)return!1;var n=document.getElementById(e);if(!n)return!1;var i=this.getAssociatedLegendOrLabel(n);return!!i&&(i.scrollIntoView(),n.focus({preventScroll:!0}),!0)},m.prototype.getFragmentFromUrl=function(t){if(-1!==t.indexOf("#"))return t.split("#").pop()},m.prototype.getAssociatedLegendOrLabel=function(t){var e=t.closest("fieldset");if(e){var n=e.getElementsByTagName("legend");if(n.length){var i=n[0];if(t instanceof HTMLInputElement&&("checkbox"===t.type||"radio"===t.type))return i;var o=i.getBoundingClientRect().top,s=t.getBoundingClientRect();if(s.height&&window.innerHeight)if(s.top+s.height-o0?this.$indicatorContainer.classList.add("govuk-exit-this-page__indicator--visible"):this.$indicatorContainer.classList.remove("govuk-exit-this-page__indicator--visible"),t(this.$indicatorContainer.querySelectorAll(".govuk-exit-this-page__indicator-light"),function(t,e){t.classList.toggle("govuk-exit-this-page__indicator-light--on",e=3?(this.keypressCounter=0,null!==this.keypressTimeoutId&&(clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=null),this.exitPage()):1===this.keypressCounter?this.$updateSpan.innerText=this.i18n.t("pressTwoMoreTimes"):this.$updateSpan.innerText=this.i18n.t("pressOneMoreTime"),this.setKeypressTimer()),this.lastKeyWasModified=t.shiftKey},v.prototype.setKeypressTimer=function(){clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=setTimeout(this.resetKeypressTimer.bind(this),this.timeoutTime)},v.prototype.resetKeypressTimer=function(){clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=null,this.keypressCounter=0,this.$updateSpan.innerText=this.i18n.t("timedOut"),this.timeoutMessageId=setTimeout(function(){this.$updateSpan.innerText=""}.bind(this),this.timeoutTime),this.updateIndicator()},v.prototype.resetPage=function(){document.body.classList.remove("govuk-exit-this-page-hide-content"),this.$overlay&&(this.$overlay.remove(),this.$overlay=null),this.$updateSpan.setAttribute("role","status"),this.$updateSpan.innerText="",this.updateIndicator(),this.keypressTimeoutId&&clearTimeout(this.keypressTimeoutId),this.timeoutMessageId&&clearTimeout(this.timeoutMessageId)},v.prototype.init=function(){this.buildIndicator(),this.initUpdateSpan(),this.initButtonClickHandler(),"govukFrontendExitThisPageKeypress"in document.body.dataset||(document.addEventListener("keyup",this.handleKeypress.bind(this),!0),document.body.dataset.govukFrontendExitThisPageKeypress="true"),window.addEventListener("onpageshow"in window?"pageshow":"DOMContentLoaded",this.resetPage.bind(this))},b.prototype.init=function(){this.$module&&this.$menuButton&&this.$menu&&("matchMedia"in window?(this.mql=window.matchMedia("(min-width: 48.0625em)"),"addEventListener"in this.mql?this.mql.addEventListener("change",this.syncState.bind(this)):this.mql.addListener(this.syncState.bind(this)),this.syncState(),this.$menuButton.addEventListener("click",this.handleMenuButtonClick.bind(this))):this.$menuButton.setAttribute("hidden",""))},b.prototype.syncState=function(){this.mql.matches?(this.$menu.removeAttribute("hidden"),this.$menuButton.setAttribute("hidden","")):(this.$menuButton.removeAttribute("hidden"),this.$menuButton.setAttribute("aria-expanded",this.menuIsOpen.toString()),this.menuIsOpen?this.$menu.removeAttribute("hidden"):this.$menu.setAttribute("hidden",""))},b.prototype.handleMenuButtonClick=function(){this.menuIsOpen=!this.menuIsOpen,this.syncState()},g.prototype.init=function(){this.$module&&this.setFocus()},g.prototype.setFocus=function(){var t=this.$module;this.config.disableAutoFocus||"alert"===t.getAttribute("role")&&(t.getAttribute("tabindex")||(t.setAttribute("tabindex","-1"),t.addEventListener("blur",(function(){t.removeAttribute("tabindex")}))),t.focus())},y.prototype.init=function(){if(this.$module&&this.$inputs){var e=this.$module;t(this.$inputs,(function(t){var e=t.getAttribute("data-aria-controls");e&&document.getElementById(e)&&(t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls"))})),window.addEventListener("onpageshow"in window?"pageshow":"DOMContentLoaded",this.syncAllConditionalReveals.bind(this)),this.syncAllConditionalReveals(),e.addEventListener("click",this.handleClick.bind(this))}},y.prototype.syncAllConditionalReveals=function(){t(this.$inputs,this.syncConditionalRevealWithInputState.bind(this))},y.prototype.syncConditionalRevealWithInputState=function(t){var e=t.getAttribute("aria-controls");if(e){var n=document.getElementById(e);if(n&&n.classList.contains("govuk-radios__conditional")){var i=t.checked;t.setAttribute("aria-expanded",i.toString()),n.classList.toggle("govuk-radios__conditional--hidden",!i)}}},y.prototype.handleClick=function(e){var n=this,i=e.target;if(i instanceof HTMLInputElement&&"radio"===i.type){var o=document.querySelectorAll('input[type="radio"][aria-controls]'),s=i.form,r=i.name;t(o,(function(t){var e=t.form===s;t.name===r&&e&&n.syncConditionalRevealWithInputState(t)}))}},w.prototype.init=function(){if(this.$module){var t=this.getLinkedElement();t&&(this.$linkedElement=t,this.$module.addEventListener("click",this.focusLinkedElement.bind(this)))}},w.prototype.getLinkedElement=function(){var t=this.getFragmentFromUrl();return t?document.getElementById(t):null},w.prototype.focusLinkedElement=function(){var t=this.$linkedElement;t.getAttribute("tabindex")||(t.setAttribute("tabindex","-1"),t.classList.add("govuk-skip-link-focused-element"),this.linkedElementListener||(this.$linkedElement.addEventListener("blur",this.removeFocusProperties.bind(this)),this.linkedElementListener=!0)),t.focus()},w.prototype.removeFocusProperties=function(){this.$linkedElement.removeAttribute("tabindex"),this.$linkedElement.classList.remove("govuk-skip-link-focused-element")},w.prototype.getFragmentFromUrl=function(){if(this.$module.hash)return this.$module.hash.split("#").pop()},function(t){"document"in this&&"nextElementSibling"in document.documentElement||Object.defineProperty(Element.prototype,"nextElementSibling",{get:function(){for(var t=this.nextSibling;t&&1!==t.nodeType;)t=t.nextSibling;return t}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"document"in this&&"previousElementSibling"in document.documentElement||Object.defineProperty(Element.prototype,"previousElementSibling",{get:function(){for(var t=this.previousSibling;t&&1!==t.nodeType;)t=t.previousSibling;return t}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),E.prototype.init=function(){this.$module&&this.$tabs&&("function"==typeof window.matchMedia?this.setupResponsiveChecks():this.setup())},E.prototype.setupResponsiveChecks=function(){this.mql=window.matchMedia("(min-width: 40.0625em)"),this.mql.addListener(this.checkMode.bind(this)),this.checkMode()},E.prototype.checkMode=function(){this.mql.matches?this.setup():this.teardown()},E.prototype.setup=function(){var e=this,n=this.$module,i=this.$tabs,o=n.querySelector(".govuk-tabs__list"),s=n.querySelectorAll(".govuk-tabs__list-item");if(i&&o&&s){o.setAttribute("role","tablist"),t(s,(function(t){t.setAttribute("role","presentation")})),t(i,(function(t){e.setAttributes(t),t.addEventListener("click",e.boundTabClick,!0),t.addEventListener("keydown",e.boundTabKeydown,!0),e.hideTab(t)}));var r=this.getTab(window.location.hash)||this.$tabs[0];r&&(this.showTab(r),window.addEventListener("hashchange",this.boundOnHashChange,!0))}},E.prototype.teardown=function(){var e=this,n=this.$module,i=this.$tabs,o=n.querySelector(".govuk-tabs__list"),s=n.querySelectorAll("a.govuk-tabs__list-item");i&&o&&s&&(o.removeAttribute("role"),t(s,(function(t){t.removeAttribute("role")})),t(i,(function(t){t.removeEventListener("click",e.boundTabClick,!0),t.removeEventListener("keydown",e.boundTabKeydown,!0),e.unsetAttributes(t)})),window.removeEventListener("hashchange",this.boundOnHashChange,!0))},E.prototype.onHashChange=function(){var t=window.location.hash,e=this.getTab(t);if(e)if(this.changingHash)this.changingHash=!1;else{var n=this.getCurrentTab();n&&(this.hideTab(n),this.showTab(e),e.focus())}},E.prototype.hideTab=function(t){this.unhighlightTab(t),this.hidePanel(t)},E.prototype.showTab=function(t){this.highlightTab(t),this.showPanel(t)},E.prototype.getTab=function(t){return this.$module.querySelector('a.govuk-tabs__tab[href="'+t+'"]')},E.prototype.setAttributes=function(t){var e=this.getHref(t).slice(1);t.setAttribute("id","tab_"+e),t.setAttribute("role","tab"),t.setAttribute("aria-controls",e),t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");var n=this.getPanel(t);n&&(n.setAttribute("role","tabpanel"),n.setAttribute("aria-labelledby",t.id),n.classList.add(this.jsHiddenClass))},E.prototype.unsetAttributes=function(t){t.removeAttribute("id"),t.removeAttribute("role"),t.removeAttribute("aria-controls"),t.removeAttribute("aria-selected"),t.removeAttribute("tabindex");var e=this.getPanel(t);e&&(e.removeAttribute("role"),e.removeAttribute("aria-labelledby"),e.classList.remove(this.jsHiddenClass))},E.prototype.onTabClick=function(t){var e=this.getCurrentTab(),n=t.currentTarget;e&&n instanceof HTMLAnchorElement&&(t.preventDefault(),this.hideTab(e),this.showTab(n),this.createHistoryEntry(n))},E.prototype.createHistoryEntry=function(t){var e=this.getPanel(t);if(e){var n=e.id;e.id="",this.changingHash=!0,window.location.hash=this.getHref(t).slice(1),e.id=n}},E.prototype.onTabKeydown=function(t){switch(t.keyCode){case this.keys.left:case this.keys.up:this.activatePreviousTab(),t.preventDefault();break;case this.keys.right:case this.keys.down:this.activateNextTab(),t.preventDefault()}},E.prototype.activateNextTab=function(){var t=this.getCurrentTab();if(t&&t.parentElement){var e=t.parentElement.nextElementSibling;if(e){var n=e.querySelector("a.govuk-tabs__tab");n&&(this.hideTab(t),this.showTab(n),n.focus(),this.createHistoryEntry(n))}}},E.prototype.activatePreviousTab=function(){var t=this.getCurrentTab();if(t&&t.parentElement){var e=t.parentElement.previousElementSibling;if(e){var n=e.querySelector("a.govuk-tabs__tab");n&&(this.hideTab(t),this.showTab(n),n.focus(),this.createHistoryEntry(n))}}},E.prototype.getPanel=function(t){return this.$module.querySelector(this.getHref(t))},E.prototype.showPanel=function(t){var e=this.getPanel(t);e&&e.classList.remove(this.jsHiddenClass)},E.prototype.hidePanel=function(t){var e=this.getPanel(t);e&&e.classList.add(this.jsHiddenClass)},E.prototype.unhighlightTab=function(t){t.parentElement&&(t.setAttribute("aria-selected","false"),t.parentElement.classList.remove("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","-1"))},E.prototype.highlightTab=function(t){t.parentElement&&(t.setAttribute("aria-selected","true"),t.parentElement.classList.add("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","0"))},E.prototype.getCurrentTab=function(){return this.$module.querySelector(".govuk-tabs__list-item--selected a.govuk-tabs__tab")},E.prototype.getHref=function(t){var e=t.getAttribute("href");return e.slice(e.indexOf("#"),e.length)},function(e){var n=(e=void 0!==e?e:{}).scope instanceof HTMLElement?e.scope:document;t(n.querySelectorAll('[data-module="govuk-accordion"]'),(function(t){new a(t,e.accordion).init()})),t(n.querySelectorAll('[data-module="govuk-button"]'),(function(t){new c(t,e.button).init()})),t(n.querySelectorAll('[data-module="govuk-character-count"]'),(function(t){new d(t,e.characterCount).init()})),t(n.querySelectorAll('[data-module="govuk-checkboxes"]'),(function(t){new h(t).init()})),t(n.querySelectorAll('[data-module="govuk-details"]'),(function(t){new p(t).init()}));var i=n.querySelector('[data-module="govuk-error-summary"]');i&&new m(i,e.errorSummary).init(),t(n.querySelectorAll('[data-module="govuk-exit-this-page"]'),(function(t){new v(t,e.exitThisPage).init()}));var o=n.querySelector('[data-module="govuk-header"]');o&&new b(o).init(),t(n.querySelectorAll('[data-module="govuk-notification-banner"]'),(function(t){new g(t,e.notificationBanner).init()})),t(n.querySelectorAll('[data-module="govuk-radios"]'),(function(t){new y(t).init()}));var s=n.querySelector('[data-module="govuk-skip-link"]');s&&new w(s).init(),t(n.querySelectorAll('[data-module="govuk-tabs"]'),(function(t){new E(t).init()}))}({errorSummary:{disableAutoFocus:!0},notificationBanner:{disableAutoFocus:!0}})}(); -//# sourceMappingURL=govuk-frontend-069e73dfb31aacad687703e346188e8c.js.map \ No newline at end of file +//# sourceMappingURL=govuk-frontend-069e73dfb31aacad687703e346188e8c.js.map From 91f409f161c6bef68d903eebbf06ad3f8522aa9e Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Wed, 29 Nov 2023 15:06:29 +0000 Subject: [PATCH 29/41] formatting tidy --- templates/search/blocks/search_filters.html | 1 - templates/static/scripts/accordion.min.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index 5ee31574f..bd50d56d0 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -123,7 +123,6 @@

{% include "search/includes/filter.html" with field=form.collection %} -
diff --git a/templates/static/scripts/accordion.min.js b/templates/static/scripts/accordion.min.js index 7c7df8dd7..b8f3ed23a 100644 --- a/templates/static/scripts/accordion.min.js +++ b/templates/static/scripts/accordion.min.js @@ -1,2 +1,2 @@ !function(){"use strict";function t(t,e){if(window.NodeList.prototype.forEach)return t.forEach(e);for(var n=0;n1&&o.shift(),n[o.join(".")]=t[i]}return n}function i(t){if("string"!=typeof t)return t;var e=t.trim();return"true"===e||"false"!==e&&(e.length>0&&isFinite(Number(e))?Number(e):t)}function o(t){var e={};for(var n in t)e[n]=i(t[n]);return e}function s(t,e){this.translations=t||{},this.locale=e&&e.locale||document.documentElement.lang||"en"}(function(t){var e,n,i,o;"defineProperty"in Object&&function(){try{return Object.defineProperty({},"test",{value:42}),!0}catch(t){return!1}}()||(e=Object.defineProperty,n=Object.prototype.hasOwnProperty("__defineGetter__"),i="Getters & setters cannot be defined on this javascript engine",o="A property cannot both have accessors and be writable or have a value",Object.defineProperty=function(t,s,r){if(e&&(t===window||t===document||t===Element.prototype||t instanceof Element))return e(t,s,r);if(null===t||!(t instanceof Object||"object"==typeof t))throw new TypeError("Object.defineProperty called on non-object");if(!(r instanceof Object))throw new TypeError("Property description must be an object");var a=String(s),l="value"in r||"writable"in r,c="get"in r&&typeof r.get,u="set"in r&&typeof r.set;if(c){if("function"!==c)throw new TypeError("Getter must be a function");if(!n)throw new TypeError(i);if(l)throw new TypeError(o);Object.__defineGetter__.call(t,a,r.get)}else t[a]=r.value;if(u){if("function"!==u)throw new TypeError("Setter must be a function");if(!n)throw new TypeError(i);if(l)throw new TypeError(o);Object.__defineSetter__.call(t,a,r.set)}return"value"in r&&(t[a]=r.value),t})}).call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"Document"in this||"undefined"==typeof WorkerGlobalScope&&"function"!=typeof importScripts&&(this.HTMLDocument?this.Document=this.HTMLDocument:(this.Document=this.HTMLDocument=document.constructor=new Function("return function Document() {}")(),this.Document.prototype=document))}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"Element"in this&&"HTMLElement"in this||function(){if(!window.Element||window.HTMLElement){window.Element=window.HTMLElement=new Function("return function Element() {}")();var t,e=document.appendChild(document.createElement("body")),n=e.appendChild(document.createElement("iframe")).contentWindow.document,i=Element.prototype=n.appendChild(n.createElement("*")),o={},s=function(t,e){var n,i,r,a=t.childNodes||[],l=-1;if(1===t.nodeType&&t.constructor!==Element)for(n in t.constructor=Element,o)i=o[n],t[n]=i;for(;r=e&&a[++l];)s(r,e);return t},r=document.getElementsByTagName("*"),a=document.createElement,l=100;i.attachEvent("onpropertychange",(function(t){for(var e,n=t.propertyName,s=!o.hasOwnProperty(n),a=i[n],l=o[n],c=-1;e=r[++c];)1===e.nodeType&&(s||e[n]===l)&&(e[n]=a);o[n]=a})),i.constructor=Element,i.hasAttribute||(i.hasAttribute=function(t){return null!==this.getAttribute(t)}),c()||(document.onreadystatechange=c,t=setInterval(c,25)),document.createElement=function(t){var e=a(String(t).toLowerCase());return s(e)},document.removeChild(e)}else window.HTMLElement=window.Element;function c(){return l--||clearTimeout(t),!(!document.body||document.body.prototype||!/(complete|interactive)/.test(document.readyState))&&(s(document,!0),t&&document.body.prototype&&clearTimeout(t),!!document.body.prototype)}}()}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){(function(){if(!document.documentElement.dataset)return!1;var t=document.createElement("div");return t.setAttribute("data-a-b","c"),t.dataset&&"c"==t.dataset.aB})()||Object.defineProperty(Element.prototype,"dataset",{get:function(){for(var t=this.attributes,e={},n=0;n=3&&t%100<=10?"few":t%100>=11&&t%100<=99?"many":"other"},chinese:function(){return"other"},french:function(t){return 0===t||1===t?"one":"other"},german:function(t){return 1===t?"one":"other"},irish:function(t){return 1===t?"one":2===t?"two":t>=3&&t<=6?"few":t>=7&&t<=10?"many":"other"},russian:function(t){var e=t%100,n=e%10;return 1===n&&11!==e?"one":n>=2&&n<=4&&!(e>=12&&e<=14)?"few":0===n||n>=5&&n<=9||e>=11&&e<=14?"many":"other"},scottish:function(t){return 1===t||11===t?"one":2===t||12===t?"two":t>=3&&t<=10||t>=13&&t<=19?"few":"other"},spanish:function(t){return 1===t?"one":t%1e6==0&&0!==t?"many":"other"},welsh:function(t){return 0===t?"zero":1===t?"one":2===t?"two":3===t?"few":6===t?"many":"other"}},function(t){var e;"DOMTokenList"in this&&(!("classList"in(e=document.createElement("x")))||!e.classList.toggle("x",!1)&&!e.className)||function(e){var n;"DOMTokenList"in e&&e.DOMTokenList&&(!document.createElementNS||!document.createElementNS("http://www.w3.org/2000/svg","svg")||document.createElementNS("http://www.w3.org/2000/svg","svg").classList instanceof DOMTokenList)||(e.DOMTokenList=function(){var e=!0,i=function(t,n,i,o){Object.defineProperty?Object.defineProperty(t,n,{configurable:!1===e||!!o,get:i}):t.__defineGetter__(n,i)};try{i({},"support")}catch(n){e=!1}return function(e,n){var o=this,s=[],r={},a=0,l=0,c=function(t){i(o,t,(function(){return d(),s[t]}),!1)},u=function(){if(a>=l)for(;l>>0,"object"==typeof e[n]?e[n].baseVal=s.join(" "):e[n]=s.join(" "),u())},o.remove=function(){d.apply(o,t=arguments);for(var t,i={},l=0,c=[];l>>0,"object"==typeof e[n]?e[n].baseVal=s.join(" "):e[n]=s.join(" "),u()},o.toggle=function(e,n){return d.apply(o,[e]),t!==n?n?(o.add(e),!0):(o.remove(e),!1):r[e]?(o.remove(e),!1):(o.add(e),!0)},o}}()),"classList"in(n=document.createElement("span"))&&(n.classList.toggle("x",!1),n.classList.contains("x")&&(n.classList.constructor.prototype.toggle=function(e){var n=arguments[1];if(n===t){var i=!this.contains(e);return this[i?"add":"remove"](e),i}return this[(n=!!n)?"add":"remove"](e),n})),function(){var t=document.createElement("span");if("classList"in t&&(t.classList.add("a","b"),!t.classList.contains("b"))){var e=t.classList.constructor.prototype.add;t.classList.constructor.prototype.add=function(){for(var t=arguments,n=arguments.length,i=0;i=this.lastInputTimestamp)&&this.updateIfValueChanged()}.bind(this),1e3)},d.prototype.handleBlur=function(){clearInterval(this.valueChecker)},d.prototype.updateIfValueChanged=function(){this.$textarea.value!==this.lastInputValue&&(this.lastInputValue=this.$textarea.value,this.updateCountMessage())},d.prototype.updateCountMessage=function(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()},d.prototype.updateVisibleCountMessage=function(){var t=this.$textarea,e=this.$visibleCountMessage,n=this.maxLength-this.count(t.value);this.isOverThreshold()?e.classList.remove("govuk-character-count__message--disabled"):e.classList.add("govuk-character-count__message--disabled"),n<0?(t.classList.add("govuk-textarea--error"),e.classList.remove("govuk-hint"),e.classList.add("govuk-error-message")):(t.classList.remove("govuk-textarea--error"),e.classList.remove("govuk-error-message"),e.classList.add("govuk-hint")),e.innerText=this.getCountMessage()},d.prototype.updateScreenReaderCountMessage=function(){var t=this.$screenReaderCountMessage;this.isOverThreshold()?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden","true"),t.innerText=this.getCountMessage()},d.prototype.count=function(t){return"maxwords"in this.config&&this.config.maxwords?(t.match(/\S+/g)||[]).length:t.length},d.prototype.getCountMessage=function(){var t=this.maxLength-this.count(this.$textarea.value),e="maxwords"in this.config&&this.config.maxwords?"words":"characters";return this.formatCountMessage(t,e)},d.prototype.formatCountMessage=function(t,e){if(0===t)return this.i18n.t(e+"AtLimit");var n=t<0?"OverLimit":"UnderLimit";return this.i18n.t(e+n,{count:Math.abs(t)})},d.prototype.isOverThreshold=function(){if(!this.config.threshold)return!0;var t=this.$textarea,e=this.count(t.value);return this.maxLength*this.config.threshold/100<=e},h.prototype.init=function(){if(this.$module&&this.$inputs){var e=this.$module;t(this.$inputs,(function(t){var e=t.getAttribute("data-aria-controls");e&&document.getElementById(e)&&(t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls"))})),window.addEventListener("onpageshow"in window?"pageshow":"DOMContentLoaded",this.syncAllConditionalReveals.bind(this)),this.syncAllConditionalReveals(),e.addEventListener("click",this.handleClick.bind(this))}},h.prototype.syncAllConditionalReveals=function(){t(this.$inputs,this.syncConditionalRevealWithInputState.bind(this))},h.prototype.syncConditionalRevealWithInputState=function(t){var e=t.getAttribute("aria-controls");if(e){var n=document.getElementById(e);if(n&&n.classList.contains("govuk-checkboxes__conditional")){var i=t.checked;t.setAttribute("aria-expanded",i.toString()),n.classList.toggle("govuk-checkboxes__conditional--hidden",!i)}}},h.prototype.unCheckAllInputsExcept=function(e){var n=this;t(document.querySelectorAll('input[type="checkbox"][name="'+e.name+'"]'),(function(t){e.form===t.form&&t!==e&&(t.checked=!1,n.syncConditionalRevealWithInputState(t))}))},h.prototype.unCheckExclusiveInputs=function(e){var n=this;t(document.querySelectorAll('input[data-behaviour="exclusive"][type="checkbox"][name="'+e.name+'"]'),(function(t){e.form===t.form&&(t.checked=!1,n.syncConditionalRevealWithInputState(t))}))},h.prototype.handleClick=function(t){var e=t.target;e instanceof HTMLInputElement&&"checkbox"===e.type&&(e.getAttribute("aria-controls")&&this.syncConditionalRevealWithInputState(e),e.checked&&("exclusive"===e.getAttribute("data-behaviour")?this.unCheckAllInputsExcept(e):this.unCheckExclusiveInputs(e)))};function p(t){if(!(t instanceof HTMLElement))return this;this.$module=t,this.$summary=null,this.$content=null}function m(t,n){if(!(t instanceof HTMLElement))return this;this.$module=t;this.config=e({disableAutoFocus:!1},n||{},o(t.dataset))}p.prototype.init=function(){this.$module&&("HTMLDetailsElement"in window&&this.$module instanceof HTMLDetailsElement||this.polyfillDetails())},p.prototype.polyfillDetails=function(){var t,e=this.$module,n=this.$summary=e.getElementsByTagName("summary").item(0),i=this.$content=e.getElementsByTagName("div").item(0);n&&i&&(i.id||(i.id="details-content-"+(t=(new Date).getTime(),void 0!==window.performance&&"function"==typeof window.performance.now&&(t+=window.performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)})))),e.setAttribute("role","group"),n.setAttribute("role","button"),n.setAttribute("aria-controls",i.id),n.tabIndex=0,this.$module.hasAttribute("open")?n.setAttribute("aria-expanded","true"):(n.setAttribute("aria-expanded","false"),i.style.display="none"),this.polyfillHandleInputs(this.polyfillSetAttributes.bind(this)))},p.prototype.polyfillSetAttributes=function(){return this.$module.hasAttribute("open")?(this.$module.removeAttribute("open"),this.$summary.setAttribute("aria-expanded","false"),this.$content.style.display="none"):(this.$module.setAttribute("open","open"),this.$summary.setAttribute("aria-expanded","true"),this.$content.style.display=""),!0},p.prototype.polyfillHandleInputs=function(t){this.$summary.addEventListener("keypress",(function(e){var n=e.target;13!==e.keyCode&&32!==e.keyCode||n instanceof HTMLElement&&"summary"===n.nodeName.toLowerCase()&&(e.preventDefault(),n.click?n.click():t(e))})),this.$summary.addEventListener("keyup",(function(t){var e=t.target;32===t.keyCode&&e instanceof HTMLElement&&"summary"===e.nodeName.toLowerCase()&&t.preventDefault()})),this.$summary.addEventListener("click",t)},m.prototype.init=function(){if(this.$module){var t=this.$module;this.setFocus(),t.addEventListener("click",this.handleClick.bind(this))}},m.prototype.setFocus=function(){var t=this.$module;this.config.disableAutoFocus||(t.setAttribute("tabindex","-1"),t.addEventListener("blur",(function(){t.removeAttribute("tabindex")})),t.focus())},m.prototype.handleClick=function(t){var e=t.target;this.focusTarget(e)&&t.preventDefault()},m.prototype.focusTarget=function(t){if(!(t instanceof HTMLAnchorElement))return!1;var e=this.getFragmentFromUrl(t.href);if(!e)return!1;var n=document.getElementById(e);if(!n)return!1;var i=this.getAssociatedLegendOrLabel(n);return!!i&&(i.scrollIntoView(),n.focus({preventScroll:!0}),!0)},m.prototype.getFragmentFromUrl=function(t){if(-1!==t.indexOf("#"))return t.split("#").pop()},m.prototype.getAssociatedLegendOrLabel=function(t){var e=t.closest("fieldset");if(e){var n=e.getElementsByTagName("legend");if(n.length){var i=n[0];if(t instanceof HTMLInputElement&&("checkbox"===t.type||"radio"===t.type))return i;var o=i.getBoundingClientRect().top,s=t.getBoundingClientRect();if(s.height&&window.innerHeight)if(s.top+s.height-o0?this.$indicatorContainer.classList.add("govuk-exit-this-page__indicator--visible"):this.$indicatorContainer.classList.remove("govuk-exit-this-page__indicator--visible"),t(this.$indicatorContainer.querySelectorAll(".govuk-exit-this-page__indicator-light"),function(t,e){t.classList.toggle("govuk-exit-this-page__indicator-light--on",e=3?(this.keypressCounter=0,null!==this.keypressTimeoutId&&(clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=null),this.exitPage()):1===this.keypressCounter?this.$updateSpan.innerText=this.i18n.t("pressTwoMoreTimes"):this.$updateSpan.innerText=this.i18n.t("pressOneMoreTime"),this.setKeypressTimer()),this.lastKeyWasModified=t.shiftKey},v.prototype.setKeypressTimer=function(){clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=setTimeout(this.resetKeypressTimer.bind(this),this.timeoutTime)},v.prototype.resetKeypressTimer=function(){clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=null,this.keypressCounter=0,this.$updateSpan.innerText=this.i18n.t("timedOut"),this.timeoutMessageId=setTimeout(function(){this.$updateSpan.innerText=""}.bind(this),this.timeoutTime),this.updateIndicator()},v.prototype.resetPage=function(){document.body.classList.remove("govuk-exit-this-page-hide-content"),this.$overlay&&(this.$overlay.remove(),this.$overlay=null),this.$updateSpan.setAttribute("role","status"),this.$updateSpan.innerText="",this.updateIndicator(),this.keypressTimeoutId&&clearTimeout(this.keypressTimeoutId),this.timeoutMessageId&&clearTimeout(this.timeoutMessageId)},v.prototype.init=function(){this.buildIndicator(),this.initUpdateSpan(),this.initButtonClickHandler(),"govukFrontendExitThisPageKeypress"in document.body.dataset||(document.addEventListener("keyup",this.handleKeypress.bind(this),!0),document.body.dataset.govukFrontendExitThisPageKeypress="true"),window.addEventListener("onpageshow"in window?"pageshow":"DOMContentLoaded",this.resetPage.bind(this))},b.prototype.init=function(){this.$module&&this.$menuButton&&this.$menu&&("matchMedia"in window?(this.mql=window.matchMedia("(min-width: 48.0625em)"),"addEventListener"in this.mql?this.mql.addEventListener("change",this.syncState.bind(this)):this.mql.addListener(this.syncState.bind(this)),this.syncState(),this.$menuButton.addEventListener("click",this.handleMenuButtonClick.bind(this))):this.$menuButton.setAttribute("hidden",""))},b.prototype.syncState=function(){this.mql.matches?(this.$menu.removeAttribute("hidden"),this.$menuButton.setAttribute("hidden","")):(this.$menuButton.removeAttribute("hidden"),this.$menuButton.setAttribute("aria-expanded",this.menuIsOpen.toString()),this.menuIsOpen?this.$menu.removeAttribute("hidden"):this.$menu.setAttribute("hidden",""))},b.prototype.handleMenuButtonClick=function(){this.menuIsOpen=!this.menuIsOpen,this.syncState()},g.prototype.init=function(){this.$module&&this.setFocus()},g.prototype.setFocus=function(){var t=this.$module;this.config.disableAutoFocus||"alert"===t.getAttribute("role")&&(t.getAttribute("tabindex")||(t.setAttribute("tabindex","-1"),t.addEventListener("blur",(function(){t.removeAttribute("tabindex")}))),t.focus())},y.prototype.init=function(){if(this.$module&&this.$inputs){var e=this.$module;t(this.$inputs,(function(t){var e=t.getAttribute("data-aria-controls");e&&document.getElementById(e)&&(t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls"))})),window.addEventListener("onpageshow"in window?"pageshow":"DOMContentLoaded",this.syncAllConditionalReveals.bind(this)),this.syncAllConditionalReveals(),e.addEventListener("click",this.handleClick.bind(this))}},y.prototype.syncAllConditionalReveals=function(){t(this.$inputs,this.syncConditionalRevealWithInputState.bind(this))},y.prototype.syncConditionalRevealWithInputState=function(t){var e=t.getAttribute("aria-controls");if(e){var n=document.getElementById(e);if(n&&n.classList.contains("govuk-radios__conditional")){var i=t.checked;t.setAttribute("aria-expanded",i.toString()),n.classList.toggle("govuk-radios__conditional--hidden",!i)}}},y.prototype.handleClick=function(e){var n=this,i=e.target;if(i instanceof HTMLInputElement&&"radio"===i.type){var o=document.querySelectorAll('input[type="radio"][aria-controls]'),s=i.form,r=i.name;t(o,(function(t){var e=t.form===s;t.name===r&&e&&n.syncConditionalRevealWithInputState(t)}))}},w.prototype.init=function(){if(this.$module){var t=this.getLinkedElement();t&&(this.$linkedElement=t,this.$module.addEventListener("click",this.focusLinkedElement.bind(this)))}},w.prototype.getLinkedElement=function(){var t=this.getFragmentFromUrl();return t?document.getElementById(t):null},w.prototype.focusLinkedElement=function(){var t=this.$linkedElement;t.getAttribute("tabindex")||(t.setAttribute("tabindex","-1"),t.classList.add("govuk-skip-link-focused-element"),this.linkedElementListener||(this.$linkedElement.addEventListener("blur",this.removeFocusProperties.bind(this)),this.linkedElementListener=!0)),t.focus()},w.prototype.removeFocusProperties=function(){this.$linkedElement.removeAttribute("tabindex"),this.$linkedElement.classList.remove("govuk-skip-link-focused-element")},w.prototype.getFragmentFromUrl=function(){if(this.$module.hash)return this.$module.hash.split("#").pop()},function(t){"document"in this&&"nextElementSibling"in document.documentElement||Object.defineProperty(Element.prototype,"nextElementSibling",{get:function(){for(var t=this.nextSibling;t&&1!==t.nodeType;)t=t.nextSibling;return t}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"document"in this&&"previousElementSibling"in document.documentElement||Object.defineProperty(Element.prototype,"previousElementSibling",{get:function(){for(var t=this.previousSibling;t&&1!==t.nodeType;)t=t.previousSibling;return t}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),E.prototype.init=function(){this.$module&&this.$tabs&&("function"==typeof window.matchMedia?this.setupResponsiveChecks():this.setup())},E.prototype.setupResponsiveChecks=function(){this.mql=window.matchMedia("(min-width: 40.0625em)"),this.mql.addListener(this.checkMode.bind(this)),this.checkMode()},E.prototype.checkMode=function(){this.mql.matches?this.setup():this.teardown()},E.prototype.setup=function(){var e=this,n=this.$module,i=this.$tabs,o=n.querySelector(".govuk-tabs__list"),s=n.querySelectorAll(".govuk-tabs__list-item");if(i&&o&&s){o.setAttribute("role","tablist"),t(s,(function(t){t.setAttribute("role","presentation")})),t(i,(function(t){e.setAttributes(t),t.addEventListener("click",e.boundTabClick,!0),t.addEventListener("keydown",e.boundTabKeydown,!0),e.hideTab(t)}));var r=this.getTab(window.location.hash)||this.$tabs[0];r&&(this.showTab(r),window.addEventListener("hashchange",this.boundOnHashChange,!0))}},E.prototype.teardown=function(){var e=this,n=this.$module,i=this.$tabs,o=n.querySelector(".govuk-tabs__list"),s=n.querySelectorAll("a.govuk-tabs__list-item");i&&o&&s&&(o.removeAttribute("role"),t(s,(function(t){t.removeAttribute("role")})),t(i,(function(t){t.removeEventListener("click",e.boundTabClick,!0),t.removeEventListener("keydown",e.boundTabKeydown,!0),e.unsetAttributes(t)})),window.removeEventListener("hashchange",this.boundOnHashChange,!0))},E.prototype.onHashChange=function(){var t=window.location.hash,e=this.getTab(t);if(e)if(this.changingHash)this.changingHash=!1;else{var n=this.getCurrentTab();n&&(this.hideTab(n),this.showTab(e),e.focus())}},E.prototype.hideTab=function(t){this.unhighlightTab(t),this.hidePanel(t)},E.prototype.showTab=function(t){this.highlightTab(t),this.showPanel(t)},E.prototype.getTab=function(t){return this.$module.querySelector('a.govuk-tabs__tab[href="'+t+'"]')},E.prototype.setAttributes=function(t){var e=this.getHref(t).slice(1);t.setAttribute("id","tab_"+e),t.setAttribute("role","tab"),t.setAttribute("aria-controls",e),t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");var n=this.getPanel(t);n&&(n.setAttribute("role","tabpanel"),n.setAttribute("aria-labelledby",t.id),n.classList.add(this.jsHiddenClass))},E.prototype.unsetAttributes=function(t){t.removeAttribute("id"),t.removeAttribute("role"),t.removeAttribute("aria-controls"),t.removeAttribute("aria-selected"),t.removeAttribute("tabindex");var e=this.getPanel(t);e&&(e.removeAttribute("role"),e.removeAttribute("aria-labelledby"),e.classList.remove(this.jsHiddenClass))},E.prototype.onTabClick=function(t){var e=this.getCurrentTab(),n=t.currentTarget;e&&n instanceof HTMLAnchorElement&&(t.preventDefault(),this.hideTab(e),this.showTab(n),this.createHistoryEntry(n))},E.prototype.createHistoryEntry=function(t){var e=this.getPanel(t);if(e){var n=e.id;e.id="",this.changingHash=!0,window.location.hash=this.getHref(t).slice(1),e.id=n}},E.prototype.onTabKeydown=function(t){switch(t.keyCode){case this.keys.left:case this.keys.up:this.activatePreviousTab(),t.preventDefault();break;case this.keys.right:case this.keys.down:this.activateNextTab(),t.preventDefault()}},E.prototype.activateNextTab=function(){var t=this.getCurrentTab();if(t&&t.parentElement){var e=t.parentElement.nextElementSibling;if(e){var n=e.querySelector("a.govuk-tabs__tab");n&&(this.hideTab(t),this.showTab(n),n.focus(),this.createHistoryEntry(n))}}},E.prototype.activatePreviousTab=function(){var t=this.getCurrentTab();if(t&&t.parentElement){var e=t.parentElement.previousElementSibling;if(e){var n=e.querySelector("a.govuk-tabs__tab");n&&(this.hideTab(t),this.showTab(n),n.focus(),this.createHistoryEntry(n))}}},E.prototype.getPanel=function(t){return this.$module.querySelector(this.getHref(t))},E.prototype.showPanel=function(t){var e=this.getPanel(t);e&&e.classList.remove(this.jsHiddenClass)},E.prototype.hidePanel=function(t){var e=this.getPanel(t);e&&e.classList.add(this.jsHiddenClass)},E.prototype.unhighlightTab=function(t){t.parentElement&&(t.setAttribute("aria-selected","false"),t.parentElement.classList.remove("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","-1"))},E.prototype.highlightTab=function(t){t.parentElement&&(t.setAttribute("aria-selected","true"),t.parentElement.classList.add("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","0"))},E.prototype.getCurrentTab=function(){return this.$module.querySelector(".govuk-tabs__list-item--selected a.govuk-tabs__tab")},E.prototype.getHref=function(t){var e=t.getAttribute("href");return e.slice(e.indexOf("#"),e.length)},function(e){var n=(e=void 0!==e?e:{}).scope instanceof HTMLElement?e.scope:document;t(n.querySelectorAll('[data-module="govuk-accordion"]'),(function(t){new a(t,e.accordion).init()})),t(n.querySelectorAll('[data-module="govuk-button"]'),(function(t){new c(t,e.button).init()})),t(n.querySelectorAll('[data-module="govuk-character-count"]'),(function(t){new d(t,e.characterCount).init()})),t(n.querySelectorAll('[data-module="govuk-checkboxes"]'),(function(t){new h(t).init()})),t(n.querySelectorAll('[data-module="govuk-details"]'),(function(t){new p(t).init()}));var i=n.querySelector('[data-module="govuk-error-summary"]');i&&new m(i,e.errorSummary).init(),t(n.querySelectorAll('[data-module="govuk-exit-this-page"]'),(function(t){new v(t,e.exitThisPage).init()}));var o=n.querySelector('[data-module="govuk-header"]');o&&new b(o).init(),t(n.querySelectorAll('[data-module="govuk-notification-banner"]'),(function(t){new g(t,e.notificationBanner).init()})),t(n.querySelectorAll('[data-module="govuk-radios"]'),(function(t){new y(t).init()}));var s=n.querySelector('[data-module="govuk-skip-link"]');s&&new w(s).init(),t(n.querySelectorAll('[data-module="govuk-tabs"]'),(function(t){new E(t).init()}))}({errorSummary:{disableAutoFocus:!0},notificationBanner:{disableAutoFocus:!0}})}(); -//# sourceMappingURL=govuk-frontend-069e73dfb31aacad687703e346188e8c.js.map +//# sourceMappingURL=govuk-frontend-069e73dfb31aacad687703e346188e8c.js.map \ No newline at end of file From 1295419e499d89f1ef170e54756600cb4551f68e Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Thu, 18 Jan 2024 12:26:46 +0000 Subject: [PATCH 30/41] Filter accordion updates --- sass/includes/search/_search-filters.scss | 8 +++++++- scripts/src/accordion.min.js | 2 ++ templates/search/blocks/search_filters.html | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 scripts/src/accordion.min.js diff --git a/sass/includes/search/_search-filters.scss b/sass/includes/search/_search-filters.scss index 877d7217d..b696d68f4 100644 --- a/sass/includes/search/_search-filters.scss +++ b/sass/includes/search/_search-filters.scss @@ -17,7 +17,7 @@ &__heading { font-size: 1.3em; - display: none; + // display: none; } &__widget-list { @@ -233,4 +233,10 @@ transform: rotate(-45deg); border-top: 0.125rem solid; border-right: 0.125rem solid; +} + +// turniung off the show all controls + +.govuk-accordion__controls { + display:none; } \ No newline at end of file diff --git a/scripts/src/accordion.min.js b/scripts/src/accordion.min.js new file mode 100644 index 000000000..55c515d05 --- /dev/null +++ b/scripts/src/accordion.min.js @@ -0,0 +1,2 @@ +!function(){"use strict";function t(t,e){if(window.NodeList.prototype.forEach)return t.forEach(e);for(var n=0;n1&&o.shift(),n[o.join(".")]=t[i]}return n}function i(t){if("string"!=typeof t)return t;var e=t.trim();return"true"===e||"false"!==e&&(e.length>0&&isFinite(Number(e))?Number(e):t)}function o(t){var e={};for(var n in t)e[n]=i(t[n]);return e}function s(t,e){this.translations=t||{},this.locale=e&&e.locale||document.documentElement.lang||"en"}(function(t){var e,n,i,o;"defineProperty"in Object&&function(){try{return Object.defineProperty({},"test",{value:42}),!0}catch(t){return!1}}()||(e=Object.defineProperty,n=Object.prototype.hasOwnProperty("__defineGetter__"),i="Getters & setters cannot be defined on this javascript engine",o="A property cannot both have accessors and be writable or have a value",Object.defineProperty=function(t,s,r){if(e&&(t===window||t===document||t===Element.prototype||t instanceof Element))return e(t,s,r);if(null===t||!(t instanceof Object||"object"==typeof t))throw new TypeError("Object.defineProperty called on non-object");if(!(r instanceof Object))throw new TypeError("Property description must be an object");var a=String(s),l="value"in r||"writable"in r,c="get"in r&&typeof r.get,u="set"in r&&typeof r.set;if(c){if("function"!==c)throw new TypeError("Getter must be a function");if(!n)throw new TypeError(i);if(l)throw new TypeError(o);Object.__defineGetter__.call(t,a,r.get)}else t[a]=r.value;if(u){if("function"!==u)throw new TypeError("Setter must be a function");if(!n)throw new TypeError(i);if(l)throw new TypeError(o);Object.__defineSetter__.call(t,a,r.set)}return"value"in r&&(t[a]=r.value),t})}).call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"Document"in this||"undefined"==typeof WorkerGlobalScope&&"function"!=typeof importScripts&&(this.HTMLDocument?this.Document=this.HTMLDocument:(this.Document=this.HTMLDocument=document.constructor=new Function("return function Document() {}")(),this.Document.prototype=document))}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"Element"in this&&"HTMLElement"in this||function(){if(!window.Element||window.HTMLElement){window.Element=window.HTMLElement=new Function("return function Element() {}")();var t,e=document.appendChild(document.createElement("body")),n=e.appendChild(document.createElement("iframe")).contentWindow.document,i=Element.prototype=n.appendChild(n.createElement("*")),o={},s=function(t,e){var n,i,r,a=t.childNodes||[],l=-1;if(1===t.nodeType&&t.constructor!==Element)for(n in t.constructor=Element,o)i=o[n],t[n]=i;for(;r=e&&a[++l];)s(r,e);return t},r=document.getElementsByTagName("*"),a=document.createElement,l=100;i.attachEvent("onpropertychange",(function(t){for(var e,n=t.propertyName,s=!o.hasOwnProperty(n),a=i[n],l=o[n],c=-1;e=r[++c];)1===e.nodeType&&(s||e[n]===l)&&(e[n]=a);o[n]=a})),i.constructor=Element,i.hasAttribute||(i.hasAttribute=function(t){return null!==this.getAttribute(t)}),c()||(document.onreadystatechange=c,t=setInterval(c,25)),document.createElement=function(t){var e=a(String(t).toLowerCase());return s(e)},document.removeChild(e)}else window.HTMLElement=window.Element;function c(){return l--||clearTimeout(t),!(!document.body||document.body.prototype||!/(complete|interactive)/.test(document.readyState))&&(s(document,!0),t&&document.body.prototype&&clearTimeout(t),!!document.body.prototype)}}()}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){(function(){if(!document.documentElement.dataset)return!1;var t=document.createElement("div");return t.setAttribute("data-a-b","c"),t.dataset&&"c"==t.dataset.aB})()||Object.defineProperty(Element.prototype,"dataset",{get:function(){for(var t=this.attributes,e={},n=0;n=3&&t%100<=10?"few":t%100>=11&&t%100<=99?"many":"other"},chinese:function(){return"other"},french:function(t){return 0===t||1===t?"one":"other"},german:function(t){return 1===t?"one":"other"},irish:function(t){return 1===t?"one":2===t?"two":t>=3&&t<=6?"few":t>=7&&t<=10?"many":"other"},russian:function(t){var e=t%100,n=e%10;return 1===n&&11!==e?"one":n>=2&&n<=4&&!(e>=12&&e<=14)?"few":0===n||n>=5&&n<=9||e>=11&&e<=14?"many":"other"},scottish:function(t){return 1===t||11===t?"one":2===t||12===t?"two":t>=3&&t<=10||t>=13&&t<=19?"few":"other"},spanish:function(t){return 1===t?"one":t%1e6==0&&0!==t?"many":"other"},welsh:function(t){return 0===t?"zero":1===t?"one":2===t?"two":3===t?"few":6===t?"many":"other"}},function(t){var e;"DOMTokenList"in this&&(!("classList"in(e=document.createElement("x")))||!e.classList.toggle("x",!1)&&!e.className)||function(e){var n;"DOMTokenList"in e&&e.DOMTokenList&&(!document.createElementNS||!document.createElementNS("http://www.w3.org/2000/svg","svg")||document.createElementNS("http://www.w3.org/2000/svg","svg").classList instanceof DOMTokenList)||(e.DOMTokenList=function(){var e=!0,i=function(t,n,i,o){Object.defineProperty?Object.defineProperty(t,n,{configurable:!1===e||!!o,get:i}):t.__defineGetter__(n,i)};try{i({},"support")}catch(n){e=!1}return function(e,n){var o=this,s=[],r={},a=0,l=0,c=function(t){i(o,t,(function(){return d(),s[t]}),!1)},u=function(){if(a>=l)for(;l>>0,"object"==typeof e[n]?e[n].baseVal=s.join(" "):e[n]=s.join(" "),u())},o.remove=function(){d.apply(o,t=arguments);for(var t,i={},l=0,c=[];l>>0,"object"==typeof e[n]?e[n].baseVal=s.join(" "):e[n]=s.join(" "),u()},o.toggle=function(e,n){return d.apply(o,[e]),t!==n?n?(o.add(e),!0):(o.remove(e),!1):r[e]?(o.remove(e),!1):(o.add(e),!0)},o}}()),"classList"in(n=document.createElement("span"))&&(n.classList.toggle("x",!1),n.classList.contains("x")&&(n.classList.constructor.prototype.toggle=function(e){var n=arguments[1];if(n===t){var i=!this.contains(e);return this[i?"add":"remove"](e),i}return this[(n=!!n)?"add":"remove"](e),n})),function(){var t=document.createElement("span");if("classList"in t&&(t.classList.add("a","b"),!t.classList.contains("b"))){var e=t.classList.constructor.prototype.add;t.classList.constructor.prototype.add=function(){for(var t=arguments,n=arguments.length,i=0;i=this.lastInputTimestamp)&&this.updateIfValueChanged()}.bind(this),1e3)},d.prototype.handleBlur=function(){clearInterval(this.valueChecker)},d.prototype.updateIfValueChanged=function(){this.$textarea.value!==this.lastInputValue&&(this.lastInputValue=this.$textarea.value,this.updateCountMessage())},d.prototype.updateCountMessage=function(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()},d.prototype.updateVisibleCountMessage=function(){var t=this.$textarea,e=this.$visibleCountMessage,n=this.maxLength-this.count(t.value);this.isOverThreshold()?e.classList.remove("govuk-character-count__message--disabled"):e.classList.add("govuk-character-count__message--disabled"),n<0?(t.classList.add("govuk-textarea--error"),e.classList.remove("govuk-hint"),e.classList.add("govuk-error-message")):(t.classList.remove("govuk-textarea--error"),e.classList.remove("govuk-error-message"),e.classList.add("govuk-hint")),e.innerText=this.getCountMessage()},d.prototype.updateScreenReaderCountMessage=function(){var t=this.$screenReaderCountMessage;this.isOverThreshold()?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden","true"),t.innerText=this.getCountMessage()},d.prototype.count=function(t){return"maxwords"in this.config&&this.config.maxwords?(t.match(/\S+/g)||[]).length:t.length},d.prototype.getCountMessage=function(){var t=this.maxLength-this.count(this.$textarea.value),e="maxwords"in this.config&&this.config.maxwords?"words":"characters";return this.formatCountMessage(t,e)},d.prototype.formatCountMessage=function(t,e){if(0===t)return this.i18n.t(e+"AtLimit");var n=t<0?"OverLimit":"UnderLimit";return this.i18n.t(e+n,{count:Math.abs(t)})},d.prototype.isOverThreshold=function(){if(!this.config.threshold)return!0;var t=this.$textarea,e=this.count(t.value);return this.maxLength*this.config.threshold/100<=e},h.prototype.init=function(){if(this.$module&&this.$inputs){var e=this.$module;t(this.$inputs,(function(t){var e=t.getAttribute("data-aria-controls");e&&document.getElementById(e)&&(t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls"))})),window.addEventListener("onpageshow"in window?"pageshow":"DOMContentLoaded",this.syncAllConditionalReveals.bind(this)),this.syncAllConditionalReveals(),e.addEventListener("click",this.handleClick.bind(this))}},h.prototype.syncAllConditionalReveals=function(){t(this.$inputs,this.syncConditionalRevealWithInputState.bind(this))},h.prototype.syncConditionalRevealWithInputState=function(t){var e=t.getAttribute("aria-controls");if(e){var n=document.getElementById(e);if(n&&n.classList.contains("govuk-checkboxes__conditional")){var i=t.checked;t.setAttribute("aria-expanded",i.toString()),n.classList.toggle("govuk-checkboxes__conditional--hidden",!i)}}},h.prototype.unCheckAllInputsExcept=function(e){var n=this;t(document.querySelectorAll('input[type="checkbox"][name="'+e.name+'"]'),(function(t){e.form===t.form&&t!==e&&(t.checked=!1,n.syncConditionalRevealWithInputState(t))}))},h.prototype.unCheckExclusiveInputs=function(e){var n=this;t(document.querySelectorAll('input[data-behaviour="exclusive"][type="checkbox"][name="'+e.name+'"]'),(function(t){e.form===t.form&&(t.checked=!1,n.syncConditionalRevealWithInputState(t))}))},h.prototype.handleClick=function(t){var e=t.target;e instanceof HTMLInputElement&&"checkbox"===e.type&&(e.getAttribute("aria-controls")&&this.syncConditionalRevealWithInputState(e),e.checked&&("exclusive"===e.getAttribute("data-behaviour")?this.unCheckAllInputsExcept(e):this.unCheckExclusiveInputs(e)))};function p(t){if(!(t instanceof HTMLElement))return this;this.$module=t,this.$summary=null,this.$content=null}function m(t,n){if(!(t instanceof HTMLElement))return this;this.$module=t;this.config=e({disableAutoFocus:!1},n||{},o(t.dataset))}p.prototype.init=function(){this.$module&&("HTMLDetailsElement"in window&&this.$module instanceof HTMLDetailsElement||this.polyfillDetails())},p.prototype.polyfillDetails=function(){var t,e=this.$module,n=this.$summary=e.getElementsByTagName("summary").item(0),i=this.$content=e.getElementsByTagName("div").item(0);n&&i&&(i.id||(i.id="details-content-"+(t=(new Date).getTime(),void 0!==window.performance&&"function"==typeof window.performance.now&&(t+=window.performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)})))),e.setAttribute("role","group"),n.setAttribute("role","button"),n.setAttribute("aria-controls",i.id),n.tabIndex=0,this.$module.hasAttribute("open")?n.setAttribute("aria-expanded","true"):(n.setAttribute("aria-expanded","false"),i.style.display="none"),this.polyfillHandleInputs(this.polyfillSetAttributes.bind(this)))},p.prototype.polyfillSetAttributes=function(){return this.$module.hasAttribute("open")?(this.$module.removeAttribute("open"),this.$summary.setAttribute("aria-expanded","false"),this.$content.style.display="none"):(this.$module.setAttribute("open","open"),this.$summary.setAttribute("aria-expanded","true"),this.$content.style.display=""),!0},p.prototype.polyfillHandleInputs=function(t){this.$summary.addEventListener("keypress",(function(e){var n=e.target;13!==e.keyCode&&32!==e.keyCode||n instanceof HTMLElement&&"summary"===n.nodeName.toLowerCase()&&(e.preventDefault(),n.click?n.click():t(e))})),this.$summary.addEventListener("keyup",(function(t){var e=t.target;32===t.keyCode&&e instanceof HTMLElement&&"summary"===e.nodeName.toLowerCase()&&t.preventDefault()})),this.$summary.addEventListener("click",t)},m.prototype.init=function(){if(this.$module){var t=this.$module;this.setFocus(),t.addEventListener("click",this.handleClick.bind(this))}},m.prototype.setFocus=function(){var t=this.$module;this.config.disableAutoFocus||(t.setAttribute("tabindex","-1"),t.addEventListener("blur",(function(){t.removeAttribute("tabindex")})),t.focus())},m.prototype.handleClick=function(t){var e=t.target;this.focusTarget(e)&&t.preventDefault()},m.prototype.focusTarget=function(t){if(!(t instanceof HTMLAnchorElement))return!1;var e=this.getFragmentFromUrl(t.href);if(!e)return!1;var n=document.getElementById(e);if(!n)return!1;var i=this.getAssociatedLegendOrLabel(n);return!!i&&(i.scrollIntoView(),n.focus({preventScroll:!0}),!0)},m.prototype.getFragmentFromUrl=function(t){if(-1!==t.indexOf("#"))return t.split("#").pop()},m.prototype.getAssociatedLegendOrLabel=function(t){var e=t.closest("fieldset");if(e){var n=e.getElementsByTagName("legend");if(n.length){var i=n[0];if(t instanceof HTMLInputElement&&("checkbox"===t.type||"radio"===t.type))return i;var o=i.getBoundingClientRect().top,s=t.getBoundingClientRect();if(s.height&&window.innerHeight)if(s.top+s.height-o0?this.$indicatorContainer.classList.add("govuk-exit-this-page__indicator--visible"):this.$indicatorContainer.classList.remove("govuk-exit-this-page__indicator--visible"),t(this.$indicatorContainer.querySelectorAll(".govuk-exit-this-page__indicator-light"),function(t,e){t.classList.toggle("govuk-exit-this-page__indicator-light--on",e=3?(this.keypressCounter=0,null!==this.keypressTimeoutId&&(clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=null),this.exitPage()):1===this.keypressCounter?this.$updateSpan.innerText=this.i18n.t("pressTwoMoreTimes"):this.$updateSpan.innerText=this.i18n.t("pressOneMoreTime"),this.setKeypressTimer()),this.lastKeyWasModified=t.shiftKey},v.prototype.setKeypressTimer=function(){clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=setTimeout(this.resetKeypressTimer.bind(this),this.timeoutTime)},v.prototype.resetKeypressTimer=function(){clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=null,this.keypressCounter=0,this.$updateSpan.innerText=this.i18n.t("timedOut"),this.timeoutMessageId=setTimeout(function(){this.$updateSpan.innerText=""}.bind(this),this.timeoutTime),this.updateIndicator()},v.prototype.resetPage=function(){document.body.classList.remove("govuk-exit-this-page-hide-content"),this.$overlay&&(this.$overlay.remove(),this.$overlay=null),this.$updateSpan.setAttribute("role","status"),this.$updateSpan.innerText="",this.updateIndicator(),this.keypressTimeoutId&&clearTimeout(this.keypressTimeoutId),this.timeoutMessageId&&clearTimeout(this.timeoutMessageId)},v.prototype.init=function(){this.buildIndicator(),this.initUpdateSpan(),this.initButtonClickHandler(),"govukFrontendExitThisPageKeypress"in document.body.dataset||(document.addEventListener("keyup",this.handleKeypress.bind(this),!0),document.body.dataset.govukFrontendExitThisPageKeypress="true"),window.addEventListener("onpageshow"in window?"pageshow":"DOMContentLoaded",this.resetPage.bind(this))},b.prototype.init=function(){this.$module&&this.$menuButton&&this.$menu&&("matchMedia"in window?(this.mql=window.matchMedia("(min-width: 48.0625em)"),"addEventListener"in this.mql?this.mql.addEventListener("change",this.syncState.bind(this)):this.mql.addListener(this.syncState.bind(this)),this.syncState(),this.$menuButton.addEventListener("click",this.handleMenuButtonClick.bind(this))):this.$menuButton.setAttribute("hidden",""))},b.prototype.syncState=function(){this.mql.matches?(this.$menu.removeAttribute("hidden"),this.$menuButton.setAttribute("hidden","")):(this.$menuButton.removeAttribute("hidden"),this.$menuButton.setAttribute("aria-expanded",this.menuIsOpen.toString()),this.menuIsOpen?this.$menu.removeAttribute("hidden"):this.$menu.setAttribute("hidden",""))},b.prototype.handleMenuButtonClick=function(){this.menuIsOpen=!this.menuIsOpen,this.syncState()},g.prototype.init=function(){this.$module&&this.setFocus()},g.prototype.setFocus=function(){var t=this.$module;this.config.disableAutoFocus||"alert"===t.getAttribute("role")&&(t.getAttribute("tabindex")||(t.setAttribute("tabindex","-1"),t.addEventListener("blur",(function(){t.removeAttribute("tabindex")}))),t.focus())},y.prototype.init=function(){if(this.$module&&this.$inputs){var e=this.$module;t(this.$inputs,(function(t){var e=t.getAttribute("data-aria-controls");e&&document.getElementById(e)&&(t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls"))})),window.addEventListener("onpageshow"in window?"pageshow":"DOMContentLoaded",this.syncAllConditionalReveals.bind(this)),this.syncAllConditionalReveals(),e.addEventListener("click",this.handleClick.bind(this))}},y.prototype.syncAllConditionalReveals=function(){t(this.$inputs,this.syncConditionalRevealWithInputState.bind(this))},y.prototype.syncConditionalRevealWithInputState=function(t){var e=t.getAttribute("aria-controls");if(e){var n=document.getElementById(e);if(n&&n.classList.contains("govuk-radios__conditional")){var i=t.checked;t.setAttribute("aria-expanded",i.toString()),n.classList.toggle("govuk-radios__conditional--hidden",!i)}}},y.prototype.handleClick=function(e){var n=this,i=e.target;if(i instanceof HTMLInputElement&&"radio"===i.type){var o=document.querySelectorAll('input[type="radio"][aria-controls]'),s=i.form,r=i.name;t(o,(function(t){var e=t.form===s;t.name===r&&e&&n.syncConditionalRevealWithInputState(t)}))}},w.prototype.init=function(){if(this.$module){var t=this.getLinkedElement();t&&(this.$linkedElement=t,this.$module.addEventListener("click",this.focusLinkedElement.bind(this)))}},w.prototype.getLinkedElement=function(){var t=this.getFragmentFromUrl();return t?document.getElementById(t):null},w.prototype.focusLinkedElement=function(){var t=this.$linkedElement;t.getAttribute("tabindex")||(t.setAttribute("tabindex","-1"),t.classList.add("govuk-skip-link-focused-element"),this.linkedElementListener||(this.$linkedElement.addEventListener("blur",this.removeFocusProperties.bind(this)),this.linkedElementListener=!0)),t.focus()},w.prototype.removeFocusProperties=function(){this.$linkedElement.removeAttribute("tabindex"),this.$linkedElement.classList.remove("govuk-skip-link-focused-element")},w.prototype.getFragmentFromUrl=function(){if(this.$module.hash)return this.$module.hash.split("#").pop()},function(t){"document"in this&&"nextElementSibling"in document.documentElement||Object.defineProperty(Element.prototype,"nextElementSibling",{get:function(){for(var t=this.nextSibling;t&&1!==t.nodeType;)t=t.nextSibling;return t}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"document"in this&&"previousElementSibling"in document.documentElement||Object.defineProperty(Element.prototype,"previousElementSibling",{get:function(){for(var t=this.previousSibling;t&&1!==t.nodeType;)t=t.previousSibling;return t}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),E.prototype.init=function(){this.$module&&this.$tabs&&("function"==typeof window.matchMedia?this.setupResponsiveChecks():this.setup())},E.prototype.setupResponsiveChecks=function(){this.mql=window.matchMedia("(min-width: 40.0625em)"),this.mql.addListener(this.checkMode.bind(this)),this.checkMode()},E.prototype.checkMode=function(){this.mql.matches?this.setup():this.teardown()},E.prototype.setup=function(){var e=this,n=this.$module,i=this.$tabs,o=n.querySelector(".govuk-tabs__list"),s=n.querySelectorAll(".govuk-tabs__list-item");if(i&&o&&s){o.setAttribute("role","tablist"),t(s,(function(t){t.setAttribute("role","presentation")})),t(i,(function(t){e.setAttributes(t),t.addEventListener("click",e.boundTabClick,!0),t.addEventListener("keydown",e.boundTabKeydown,!0),e.hideTab(t)}));var r=this.getTab(window.location.hash)||this.$tabs[0];r&&(this.showTab(r),window.addEventListener("hashchange",this.boundOnHashChange,!0))}},E.prototype.teardown=function(){var e=this,n=this.$module,i=this.$tabs,o=n.querySelector(".govuk-tabs__list"),s=n.querySelectorAll("a.govuk-tabs__list-item");i&&o&&s&&(o.removeAttribute("role"),t(s,(function(t){t.removeAttribute("role")})),t(i,(function(t){t.removeEventListener("click",e.boundTabClick,!0),t.removeEventListener("keydown",e.boundTabKeydown,!0),e.unsetAttributes(t)})),window.removeEventListener("hashchange",this.boundOnHashChange,!0))},E.prototype.onHashChange=function(){var t=window.location.hash,e=this.getTab(t);if(e)if(this.changingHash)this.changingHash=!1;else{var n=this.getCurrentTab();n&&(this.hideTab(n),this.showTab(e),e.focus())}},E.prototype.hideTab=function(t){this.unhighlightTab(t),this.hidePanel(t)},E.prototype.showTab=function(t){this.highlightTab(t),this.showPanel(t)},E.prototype.getTab=function(t){return this.$module.querySelector('a.govuk-tabs__tab[href="'+t+'"]')},E.prototype.setAttributes=function(t){var e=this.getHref(t).slice(1);t.setAttribute("id","tab_"+e),t.setAttribute("role","tab"),t.setAttribute("aria-controls",e),t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");var n=this.getPanel(t);n&&(n.setAttribute("role","tabpanel"),n.setAttribute("aria-labelledby",t.id),n.classList.add(this.jsHiddenClass))},E.prototype.unsetAttributes=function(t){t.removeAttribute("id"),t.removeAttribute("role"),t.removeAttribute("aria-controls"),t.removeAttribute("aria-selected"),t.removeAttribute("tabindex");var e=this.getPanel(t);e&&(e.removeAttribute("role"),e.removeAttribute("aria-labelledby"),e.classList.remove(this.jsHiddenClass))},E.prototype.onTabClick=function(t){var e=this.getCurrentTab(),n=t.currentTarget;e&&n instanceof HTMLAnchorElement&&(t.preventDefault(),this.hideTab(e),this.showTab(n),this.createHistoryEntry(n))},E.prototype.createHistoryEntry=function(t){var e=this.getPanel(t);if(e){var n=e.id;e.id="",this.changingHash=!0,window.location.hash=this.getHref(t).slice(1),e.id=n}},E.prototype.onTabKeydown=function(t){switch(t.keyCode){case this.keys.left:case this.keys.up:this.activatePreviousTab(),t.preventDefault();break;case this.keys.right:case this.keys.down:this.activateNextTab(),t.preventDefault()}},E.prototype.activateNextTab=function(){var t=this.getCurrentTab();if(t&&t.parentElement){var e=t.parentElement.nextElementSibling;if(e){var n=e.querySelector("a.govuk-tabs__tab");n&&(this.hideTab(t),this.showTab(n),n.focus(),this.createHistoryEntry(n))}}},E.prototype.activatePreviousTab=function(){var t=this.getCurrentTab();if(t&&t.parentElement){var e=t.parentElement.previousElementSibling;if(e){var n=e.querySelector("a.govuk-tabs__tab");n&&(this.hideTab(t),this.showTab(n),n.focus(),this.createHistoryEntry(n))}}},E.prototype.getPanel=function(t){return this.$module.querySelector(this.getHref(t))},E.prototype.showPanel=function(t){var e=this.getPanel(t);e&&e.classList.remove(this.jsHiddenClass)},E.prototype.hidePanel=function(t){var e=this.getPanel(t);e&&e.classList.add(this.jsHiddenClass)},E.prototype.unhighlightTab=function(t){t.parentElement&&(t.setAttribute("aria-selected","false"),t.parentElement.classList.remove("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","-1"))},E.prototype.highlightTab=function(t){t.parentElement&&(t.setAttribute("aria-selected","true"),t.parentElement.classList.add("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","0"))},E.prototype.getCurrentTab=function(){return this.$module.querySelector(".govuk-tabs__list-item--selected a.govuk-tabs__tab")},E.prototype.getHref=function(t){var e=t.getAttribute("href");return e.slice(e.indexOf("#"),e.length)},function(e){var n=(e=void 0!==e?e:{}).scope instanceof HTMLElement?e.scope:document;t(n.querySelectorAll('[data-module="govuk-accordion"]'),(function(t){new a(t,e.accordion).init()})),t(n.querySelectorAll('[data-module="govuk-button"]'),(function(t){new c(t,e.button).init()})),t(n.querySelectorAll('[data-module="govuk-character-count"]'),(function(t){new d(t,e.characterCount).init()})),t(n.querySelectorAll('[data-module="govuk-checkboxes"]'),(function(t){new h(t).init()})),t(n.querySelectorAll('[data-module="govuk-details"]'),(function(t){new p(t).init()}));var i=n.querySelector('[data-module="govuk-error-summary"]');i&&new m(i,e.errorSummary).init(),t(n.querySelectorAll('[data-module="govuk-exit-this-page"]'),(function(t){new v(t,e.exitThisPage).init()}));var o=n.querySelector('[data-module="govuk-header"]');o&&new b(o).init(),t(n.querySelectorAll('[data-module="govuk-notification-banner"]'),(function(t){new g(t,e.notificationBanner).init()})),t(n.querySelectorAll('[data-module="govuk-radios"]'),(function(t){new y(t).init()}));var s=n.querySelector('[data-module="govuk-skip-link"]');s&&new w(s).init(),t(n.querySelectorAll('[data-module="govuk-tabs"]'),(function(t){new E(t).init()}))}({errorSummary:{disableAutoFocus:!0},notificationBanner:{disableAutoFocus:!0}})}(); +// //# sourceMappingURL=govuk-frontend-069e73dfb31aacad687703e346188e8c.js.map \ No newline at end of file diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index 69e579418..7225a7d76 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -155,6 +155,12 @@

+ + + + + + {% if form.group.value == 'tna' or form.group.value == 'digitised' %}
@@ -215,6 +221,8 @@

{% load static %} + + {% if form.group.value == 'tna' or form.group.value == 'digitised' %} -
-
- -

Record opening date

-
-
-

- Record opening date -

-
+
+
+

+ + Record opening date + +

+
+
+

@@ -197,58 +196,15 @@

-
+

+

{% endif %} - - {% if form.group.value == 'tna' or form.group.value == 'digitised' %} -
-
- -

Record opening date

-
-
-

- Record opening date -

-
-
-
- For example, 27 3 2007 or 2007 -
- {{ form.opening_start_date.label_tag }} - {% if form.opening_start_date.errors %} -
- {{ form.opening_start_date.errors }} -
- {% endif %} - {{ form.opening_start_date }} -
-
- {{ form.opening_end_date.label_tag }} - {% if form.opening_end_date.errors %} -
- {{ form.opening_end_date.errors }} -
- {% endif %} - {{ form.opening_end_date }} -
-
-
-
- {% endif %} + {% if form.group.value == bucketkeys.NONTNA.value %} {% include "search/includes/filter.html" with field=form.held_by %} {% include "search/includes/filter.html" with field=form.catalogue_source %} From 81b62de78ee12b128f34aa9f9a76d9f9acc8965d Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Thu, 25 Jan 2024 11:04:59 +0000 Subject: [PATCH 35/41] refactoring to make accordion elements for search filters dynamic --- templates/search/includes/filter.html | 39 ++++++++++++++++----------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/templates/search/includes/filter.html b/templates/search/includes/filter.html index 3d1bd3d74..b44e784a2 100644 --- a/templates/search/includes/filter.html +++ b/templates/search/includes/filter.html @@ -1,21 +1,28 @@ {% if field.field.choices and field.field.choices_updated %} -
-
-

{{ field.label }}

-
- {{ field.errors }} - {{ field }} -
- {% if field.more_filter_options_available %} - {% if search_tab == searchtabs.CATALOGUE.value %} - See more - {% elif search_tab == searchtabs.WEBSITE.value %} - See more - {% endif %} +
+
+

+ + {{ field.label }} + +

+
+
+

+

+ {{ field.errors }} + {{ field }} +
+ {% if field.more_filter_options_available %} + {% if search_tab == searchtabs.CATALOGUE.value %} + See more + {% elif search_tab == searchtabs.WEBSITE.value %} + See more {% endif %} - -
+ {% endif %} +

+ {% else %} {{ field.as_hidden }} -{% endif %} +{% endif %} \ No newline at end of file From f7198f62f808c7501c499c02461d7d9933b54149 Mon Sep 17 00:00:00 2001 From: JohnHeeryTNA Date: Thu, 25 Jan 2024 11:53:25 +0000 Subject: [PATCH 36/41] js to hide non available filters 'creators' bucket --- templates/search/blocks/search_filters.html | 37 ++++++++++++++++----- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/templates/search/blocks/search_filters.html b/templates/search/blocks/search_filters.html index 092670610..0612fa997 100644 --- a/templates/search/blocks/search_filters.html +++ b/templates/search/blocks/search_filters.html @@ -64,7 +64,7 @@

Filters

-
+

Dates @@ -111,7 +111,7 @@

Edit filters

{% endif %}
-
+

+

{% endif %} -
+

- + {% if form.group.value == 'tna' or form.group.value == 'digitised' %}
@@ -200,10 +200,6 @@

{% endif %} - - - - {% if form.group.value == bucketkeys.NONTNA.value %} {% include "search/includes/filter.html" with field=form.held_by %} @@ -223,6 +219,29 @@

{% load static %} + + + + + {% load static %} -