mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-30 12:18:19 -04:00
Move ‘send test’ link back to template page
This changes it back to how it was when we first introduced this feature: https://github.com/alphagov/notifications-admin/pull/181 It’s kind of lost on the page where you upload a file, which is a shame because it’s a good teaching aid.
This commit is contained in:
@@ -242,11 +242,16 @@ def check_messages(service_id, template_type, upload_id):
|
||||
) if current_service['restricted'] else None
|
||||
)
|
||||
|
||||
if request.args.get('from_test') and len(template.placeholders):
|
||||
if request.args.get('from_test'):
|
||||
extra_args = {'help': 1} if request.args.get('help', '0') != '0' else {}
|
||||
back_link = url_for(
|
||||
'.send_test', service_id=service_id, template_id=template.id, **extra_args
|
||||
)
|
||||
if len(template.placeholders):
|
||||
back_link = url_for(
|
||||
'.send_test', service_id=service_id, template_id=template.id, **extra_args
|
||||
)
|
||||
else:
|
||||
back_link = url_for(
|
||||
'.choose_template', service_id=service_id, template_type=template.template_type, **extra_args
|
||||
)
|
||||
else:
|
||||
back_link = url_for('.send_messages', service_id=service_id, template_id=template.id)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
{% if request.args['help'] %}
|
||||
<h1 class="heading-large">Example text message</h1>
|
||||
{% else %}
|
||||
<h1 class="heading-large">Send a test</h1>
|
||||
<h1 class="heading-large">Send yourself a test</h1>
|
||||
{% endif %}
|
||||
|
||||
{% if 'sms' == template.template_type %}
|
||||
|
||||
@@ -35,9 +35,7 @@
|
||||
<div class="page-footer bottom-gutter">
|
||||
{{file_upload(
|
||||
form.file,
|
||||
button_text='Upload a file of recipients',
|
||||
alternate_link=url_for(".send_test", service_id=current_service.id, template_id=template.id),
|
||||
alternate_link_text='send yourself a test'
|
||||
button_text='Upload a file of recipients'
|
||||
)}}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -26,7 +26,10 @@
|
||||
<a href="{{ url_for(".send_messages", service_id=current_service.id, template_id=template.id) }}" class="primary">
|
||||
Send {{ 'text messages' if 'sms' == template.template_type else 'emails' }}
|
||||
</a>
|
||||
{% endif %}
|
||||
<a href="{{ url_for(".send_test", service_id=current_service.id, template_id=template.id) }}">
|
||||
Send yourself a test
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if current_user.has_permissions(permissions=['manage_templates'], admin_override=True) %}
|
||||
<a href="{{ url_for(".edit_service_template", service_id=current_service.id, template_id=template.id) }}">Edit template</a>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user