Add context to 'Move' button on /templates

Includes adding an extra parameter to the
page_footer component.
This commit is contained in:
Tom Byers
2020-08-05 11:15:38 +01:00
parent a52aa406df
commit 0933485995
3 changed files with 10 additions and 2 deletions

View File

@@ -246,7 +246,9 @@
this.itemsSelectedButtons = $(`
<div id="items_selected">
<div class="js-stick-at-bottom-when-scrolling">
<button class="govuk-button govuk-button--secondary govuk-!-margin-right-3 govuk-!-margin-bottom-1" value="move-to-existing-folder">Move</button>
<button class="govuk-button govuk-button--secondary govuk-!-margin-right-3 govuk-!-margin-bottom-1" value="move-to-existing-folder">
Move<span class="govuk-visually-hidden"> selection to folder</span>
</button>
<button class="govuk-button govuk-button--secondary govuk-!-margin-bottom-1" value="move-to-new-folder">Add to new folder</button>
<div class="template-list-selected-counter" aria-hidden="true">
<span class="template-list-selected-counter__count" aria-hidden="true">

View File

@@ -4,6 +4,7 @@
button_text=None,
button_name=None,
button_value=None,
button_text_hidden_suffix=None,
destructive=False,
secondary_link=False,
secondary_link_text=None,
@@ -20,6 +21,11 @@
{% if centered_button %}{% set _ = button_data.update({"classes": "page-footer__button--centred"}) %}{% endif %}
{% if button_name %}{% set _ = button_data.update({"name": button_name}) %}{% endif %}
{% if button_value %}{% set _ = button_data.update({"value": button_value}) %}{% endif %}
{% if button_text_hidden_suffix %}
{% set _ = button_data.update({
"text": "", "html": button_text + "<span class=\"govuk-visually-hidden\"> " + button_text_hidden_suffix + "</span>"
}) %}
{% endif %}
{{ govukButton(button_data) }}

View File

@@ -10,7 +10,7 @@
{{ radios_nested(templates_and_folders_form.move_to, move_to_children, option_hints=option_hints) }}
</div>
<div class="js-will-stick-at-bottom-when-scrolling">
{{ page_footer('Move', button_name='operation', button_value='move-to-existing-folder') }}
{{ page_footer('Move', button_name='operation', button_value='move-to-existing-folder', button_text_hidden_suffix=' selection to folder') }}
</div>
</div>
<div id="move_to_new_folder_form">