mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-26 17:24:23 -04:00
Merge pull request #3593 from alphagov/fix-link-and-button-text-across-pages
Fix link and button text across pages
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{% from "components/form.html" import form_wrapper %}
|
||||
{% from "components/button/macro.njk" import govukButton %}
|
||||
|
||||
{% macro banner(body, type=None, with_tick=False, delete_button=None, subhead=None, context=None, action=None, id=None) %}
|
||||
{% macro banner(body, type=None, with_tick=False, delete_button=None, subhead=None, context=None, action=None, id=None, thing=None) %}
|
||||
<div
|
||||
class='banner{% if type %}-{{ type }}{% endif %}{% if with_tick %}-with-tick{% endif %}'
|
||||
{% if type == 'dangerous' %}
|
||||
@@ -25,7 +25,8 @@
|
||||
{% call form_wrapper(action=action) %}
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
{{ govukButton({
|
||||
"text": delete_button,
|
||||
"text": "" if thing else delete_button,
|
||||
"html": delete_button + "<span class=\"govuk-visually-hidden\"> ‘" + thing + "’</span>" if thing else "",
|
||||
"name": "delete",
|
||||
"classes": "govuk-button--warning govuk-!-margin-top-2",
|
||||
}) }}
|
||||
@@ -34,6 +35,6 @@
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro banner_wrapper(type=None, with_tick=False, delete_button=None, subhead=None, action=None, id=None) %}
|
||||
{{ banner(caller()|safe, type=type, with_tick=with_tick, delete_button=delete_button, subhead=subhead, action=action, id=id) }}
|
||||
{% macro banner_wrapper(type=None, with_tick=False, delete_button=None, subhead=None, action=None, id=None, thing=None) %}
|
||||
{{ banner(caller()|safe, type=type, with_tick=with_tick, delete_button=delete_button, subhead=subhead, action=action, id=id, thing=thing) }}
|
||||
{% endmacro %}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<p class="notify-cookie-banner__confirmation-message govuk-body">
|
||||
You can <a class="govuk-link" href="/cookies">change your cookie settings</a> at any time.
|
||||
</p>
|
||||
<button class="notify-cookie-banner__hide-button govuk-link" data-hide-cookie-banner="true" role="link">Hide</button>
|
||||
<button class="notify-cookie-banner__hide-button govuk-link" data-hide-cookie-banner="true" role="link">Hide<span class="govuk-visually-hidden"> cookies message</span></button>
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
@@ -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) }}
|
||||
|
||||
|
||||
@@ -121,10 +121,13 @@
|
||||
{% endcall %}
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro edit_field(text, link, permissions=[]) -%}
|
||||
{% macro edit_field(text, link, permissions=[], suffix=None) -%}
|
||||
{% call field(align='right') %}
|
||||
{% if not permissions or current_user.has_permissions(*permissions) %}
|
||||
<a class="govuk-link govuk-link--no-visited-state" href="{{ link }}">{{ text }}</a>
|
||||
<a class="govuk-link govuk-link--no-visited-state" href="{{ link }}">
|
||||
{{ text }}
|
||||
{%- if suffix %}<span class="govuk-visually-hidden"> {{ suffix }}</span>{% endif -%}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endcall %}
|
||||
{%- endmacro %}
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
'default' if ((category == 'default') or (category == 'default_with_tick')) else 'dangerous',
|
||||
delete_button=delete_button_text,
|
||||
with_tick=True if category == 'default_with_tick' else False,
|
||||
context=message[1] if message is not string
|
||||
context=message[1] if message is not string,
|
||||
thing=message[2] if message is not string and message[2]
|
||||
)}}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
@@ -73,9 +73,9 @@
|
||||
{% if current_user.has_permissions('manage_service') %}
|
||||
<li class="tick-cross-list-edit-link">
|
||||
{% if user.status == 'pending' %}
|
||||
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('.cancel_invited_user', service_id=current_service.id, invited_user_id=user.id)}}">Cancel invitation</a>
|
||||
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('.cancel_invited_user', service_id=current_service.id, invited_user_id=user.id)}}">Cancel invitation<span class="govuk-visually-hidden"> for {{ user.email_address }}</span></a>
|
||||
{% elif user.state == 'active' and current_user.id != user.id %}
|
||||
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('.edit_user_permissions', service_id=current_service.id, user_id=user.id)}}">Change details</a>
|
||||
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('.edit_user_permissions', service_id=current_service.id, user_id=user.id)}}">Change details<span class="govuk-visually-hidden"> for {{ user.name }} {{ user.email_address }}</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
@@ -25,7 +25,8 @@
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for('.service_name_change', service_id=current_service.id),
|
||||
permissions=['manage_service']
|
||||
permissions=['manage_service'],
|
||||
suffix='service name',
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
@@ -39,9 +40,9 @@
|
||||
) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for('.service_set_auth_type',
|
||||
service_id=current_service.id),
|
||||
permissions=['manage_service']
|
||||
url_for('.service_set_auth_type', service_id=current_service.id),
|
||||
permissions=['manage_service'],
|
||||
suffix='sign-in method',
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
@@ -66,7 +67,8 @@
|
||||
channel='email',
|
||||
service_id=current_service.id
|
||||
),
|
||||
permissions=['manage_service']
|
||||
permissions=['manage_service'],
|
||||
suffix='your settings for sending emails',
|
||||
)}}
|
||||
{% endcall %}
|
||||
|
||||
@@ -82,9 +84,9 @@
|
||||
{% endcall %}
|
||||
{{ edit_field(
|
||||
'Manage',
|
||||
url_for('.service_email_reply_to',
|
||||
service_id=current_service.id),
|
||||
permissions=['manage_service','manage_api_keys']
|
||||
url_for('.service_email_reply_to', service_id=current_service.id),
|
||||
permissions=['manage_service','manage_api_keys'],
|
||||
suffix='reply-to email addresses',
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
@@ -96,6 +98,7 @@
|
||||
'Change',
|
||||
url_for('.branding_request', service_id=current_service.id, branding_type="email"),
|
||||
permissions=['manage_service'],
|
||||
suffix='email branding',
|
||||
)}}
|
||||
{% endcall %}
|
||||
|
||||
@@ -106,6 +109,7 @@
|
||||
'Manage',
|
||||
url_for('.send_files_by_email_contact_details', service_id=current_service.id),
|
||||
permissions=['manage_service'],
|
||||
suffix='sending files by email',
|
||||
)}}
|
||||
{% endcall %}
|
||||
|
||||
@@ -128,7 +132,8 @@
|
||||
service_id=current_service.id,
|
||||
channel='sms'
|
||||
),
|
||||
permissions=['manage_service']
|
||||
permissions=['manage_service'],
|
||||
suffix='your settings for sending text messages',
|
||||
)}}
|
||||
{% endcall %}
|
||||
|
||||
@@ -144,9 +149,9 @@
|
||||
{% endcall %}
|
||||
{{ edit_field(
|
||||
'Manage',
|
||||
url_for('.service_sms_senders',
|
||||
service_id=current_service.id),
|
||||
permissions=['manage_service','manage_api_keys']
|
||||
url_for('.service_sms_senders', service_id=current_service.id),
|
||||
permissions=['manage_service','manage_api_keys'],
|
||||
suffix='text message senders',
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
@@ -156,9 +161,9 @@
|
||||
{{ boolean_field(current_service.prefix_sms) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for('.service_set_sms_prefix',
|
||||
service_id=current_service.id),
|
||||
permissions=['manage_service']
|
||||
url_for('.service_set_sms_prefix', service_id=current_service.id),
|
||||
permissions=['manage_service'],
|
||||
suffix='your settings for starting text messages with service name',
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
@@ -168,9 +173,9 @@
|
||||
{{ boolean_field('international_sms' in current_service.permissions) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for('.service_set_international_sms',
|
||||
service_id=current_service.id),
|
||||
permissions=['manage_service']
|
||||
url_for('.service_set_international_sms', service_id=current_service.id),
|
||||
permissions=['manage_service'],
|
||||
suffix='your settings for sending international text messages',
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
@@ -180,9 +185,9 @@
|
||||
{{ boolean_field('inbound_sms' in current_service.permissions) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for('.service_set_inbound_sms',
|
||||
service_id=current_service.id),
|
||||
permissions=['manage_service']
|
||||
url_for('.service_set_inbound_sms', service_id=current_service.id),
|
||||
permissions=['manage_service'],
|
||||
suffix='your settings for receiving text messages',
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
@@ -206,7 +211,8 @@
|
||||
channel='letter',
|
||||
service_id=current_service.id
|
||||
),
|
||||
permissions=['manage_service']
|
||||
permissions=['manage_service'],
|
||||
suffix='your settings for sending letters',
|
||||
)}}
|
||||
{% endcall %}
|
||||
|
||||
@@ -228,9 +234,9 @@
|
||||
{% endcall %}
|
||||
{{ edit_field(
|
||||
'Manage',
|
||||
url_for('.service_letter_contact_details',
|
||||
service_id=current_service.id),
|
||||
permissions=['manage_service','manage_api_keys']
|
||||
url_for('.service_letter_contact_details', service_id=current_service.id),
|
||||
permissions=['manage_service','manage_api_keys'],
|
||||
suffix='sender addresses',
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
@@ -241,7 +247,8 @@
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for('.branding_request', service_id=current_service.id, branding_type="letter"),
|
||||
permissions=['manage_service']
|
||||
permissions=['manage_service'],
|
||||
suffix='letter branding',
|
||||
)}}
|
||||
{% endcall %}
|
||||
|
||||
@@ -308,14 +315,14 @@
|
||||
{{ text_field('') }}
|
||||
{% else %}
|
||||
{{ boolean_field(not current_service.trial_mode) }}
|
||||
{{ edit_field('Change', url_for('.service_switch_live', service_id=current_service.id)) }}
|
||||
{{ edit_field('Change', url_for('.service_switch_live', service_id=current_service.id), suffix='service status') }}
|
||||
{% endif %}
|
||||
{% endcall %}
|
||||
|
||||
{% call row() %}
|
||||
{{ text_field('Count in list of live services')}}
|
||||
{{ text_field('Yes' if current_service.count_as_live else 'No') }}
|
||||
{{ edit_field('Change', url_for('.service_switch_count_as_live', service_id=current_service.id)) }}
|
||||
{{ edit_field('Change', url_for('.service_switch_count_as_live', service_id=current_service.id), suffix='if service is counted in list of live services') }}
|
||||
{% endcall %}
|
||||
|
||||
{% call row() %}
|
||||
@@ -334,30 +341,30 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endcall %}
|
||||
{{ edit_field('Change', url_for('.link_service_to_organisation', service_id=current_service.id)) }}
|
||||
{{ edit_field('Change', url_for('.link_service_to_organisation', service_id=current_service.id), suffix='organisation for service') }}
|
||||
{% endcall %}
|
||||
|
||||
{% call row() %}
|
||||
{{ text_field('Free text message allowance')}}
|
||||
{{ text_field('{:,}'.format(current_service.free_sms_fragment_limit)) }}
|
||||
{{ edit_field('Change', url_for('.set_free_sms_allowance', service_id=current_service.id)) }}
|
||||
{{ edit_field('Change', url_for('.set_free_sms_allowance', service_id=current_service.id), suffix='free text message allowance') }}
|
||||
{% endcall %}
|
||||
{% call row() %}
|
||||
{{ text_field('Email branding' )}}
|
||||
{{ text_field(current_service.email_branding_name) }}
|
||||
{{ edit_field('Change', url_for('.service_set_email_branding', service_id=current_service.id)) }}
|
||||
{{ edit_field('Change', url_for('.service_set_email_branding', service_id=current_service.id), suffix='email branding (admin view)') }}
|
||||
{% endcall %}
|
||||
{% call row() %}
|
||||
{{ text_field('Letter branding')}}
|
||||
{{ optional_text_field(current_service.letter_branding.name) }}
|
||||
{{ edit_field('Change', url_for('.service_set_letter_branding', service_id=current_service.id)) }}
|
||||
{{ edit_field('Change', url_for('.service_set_letter_branding', service_id=current_service.id), suffix='letter branding (admin view)') }}
|
||||
{% endcall %}
|
||||
{% call row() %}
|
||||
{{ text_field('Data retention')}}
|
||||
{% call field() %}
|
||||
{{ current_service.data_retention | join(', ', attribute='notification_type') }}
|
||||
{% endcall %}
|
||||
{{ edit_field('Change', url_for('.data_retention', service_id=current_service.id)) }}
|
||||
{{ edit_field('Change', url_for('.data_retention', service_id=current_service.id), suffix='data retention') }}
|
||||
{% endcall %}
|
||||
|
||||
{% for permission in service_permissions %}
|
||||
@@ -365,7 +372,15 @@
|
||||
{% call row() %}
|
||||
{{ text_field(service_permissions[permission].title)}}
|
||||
{{ boolean_field(current_service.has_permission(permission)) }}
|
||||
{{ edit_field('Change', url_for(service_permissions[permission].endpoint or '.service_set_permission', service_id=current_service.id, permission=permission if not service_permissions[permission].endpoint else None)) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for(
|
||||
service_permissions[permission].endpoint or '.service_set_permission',
|
||||
service_id=current_service.id,
|
||||
permission=permission if not service_permissions[permission].endpoint else None
|
||||
),
|
||||
suffix='your settings for ' + service_permissions[permission].title,
|
||||
) }}
|
||||
{% endcall %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
{% if current_user.has_permissions('send_messages', restrict_admin_usage=True) and not letter_too_long %}
|
||||
<div class="govuk-grid-column-one-half">
|
||||
<a href="{{ url_for(".set_sender", service_id=current_service.id, template_id=template.id) }}" class="govuk-link govuk-link--no-visited-state pill-separate-item">
|
||||
Send
|
||||
Send<span class="govuk-visually-hidden"> a message using this template</span>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -39,7 +39,7 @@
|
||||
{% if current_user.has_permissions('manage_templates') %}
|
||||
<div class="govuk-grid-column-one-half">
|
||||
<a href="{{ url_for(".edit_service_template", service_id=current_service.id, template_id=template.id) }}" class="govuk-link govuk-link--no-visited-state pill-separate-item">
|
||||
Edit
|
||||
Edit<span class="govuk-visually-hidden"> this template</span>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -47,7 +47,7 @@
|
||||
{% if current_user.has_permissions('send_messages', restrict_admin_usage=True) %}
|
||||
<div class="govuk-grid-column-one-half">
|
||||
<a href="{{ url_for(".set_sender", service_id=current_service.id, template_id=template.id) }}" class="govuk-link govuk-link--no-visited-state pill-separate-item">
|
||||
Send
|
||||
Send<span class="govuk-visually-hidden"> a message using this template</span>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user