From 2a4d56cd2c680731ded158e71125364c4770d2b8 Mon Sep 17 00:00:00 2001 From: Jonathan Young Date: Thu, 14 Dec 2023 13:56:19 +0000 Subject: [PATCH] Add fieldset to documents date filter Wraps the to-date and from-date filters in a fieldset with the date header assigned as a legend. This programatically links all of these elements which makes it easier for people using screen readers to tell the purpose of the fields. --- .../admin/editions/_filter_options.html.erb | 51 +++++++++---------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/app/views/admin/editions/_filter_options.html.erb b/app/views/admin/editions/_filter_options.html.erb index 20a7b0c64f8..22c4b5fea2f 100644 --- a/app/views/admin/editions/_filter_options.html.erb +++ b/app/views/admin/editions/_filter_options.html.erb @@ -92,34 +92,33 @@ <% end %> <% if filter_by.include?(:date) %> - <%= render "govuk_publishing_components/components/heading", { - text: "Date (last updated)", - font_size: "s", + <%= render "govuk_publishing_components/components/fieldset", { + legend_text: "Last updated date", heading_level: 3, - margin_bottom: 2, - } %> - - <%= render "govuk_publishing_components/components/input", { - label: { - text: "From", - bold: true, - }, - name: "from_date", - id: "from_date", - value: params["from_date"], - hint: "For example, 23/07/2013", - } %> + heading_size: "s", + } do %> + <%= render "govuk_publishing_components/components/input", { + label: { + text: "From", + bold: true, + }, + name: "from_date", + id: "from_date", + value: params["from_date"], + hint: "For example, 23/07/2013", + } %> - <%= render "govuk_publishing_components/components/input", { - label: { - text: "To", - bold: true, - }, - name: "to_date", - id: "to_date", - value: params["to_date"], - hint: "For example, 23/08/2013", - } %> + <%= render "govuk_publishing_components/components/input", { + label: { + text: "To", + bold: true, + }, + name: "to_date", + id: "to_date", + value: params["to_date"], + hint: "For example, 23/08/2013", + } %> + <% end %> <% end %> <% if filter_by.include?(:only_broken_links) %>