Adjusting back text for all steps in send message process

This commit is contained in:
Jonathan Bobel
2025-04-25 10:23:28 -04:00
parent 6f6402e36a
commit 670d82b72c
6 changed files with 50 additions and 25 deletions
+41 -20
View File
@@ -476,7 +476,7 @@ def send_one_off_step(service_id, template_id, step_index):
"views/send-test.html", "views/send-test.html",
page_title=get_send_test_page_title( page_title=get_send_test_page_title(
template.template_type, template.template_type,
entering_recipient=not session["recipient"], entering_recipient=(step_index == 0),
name=template.name, name=template.name,
), ),
template=template, template=template,
@@ -755,31 +755,52 @@ def get_back_link(
preview=False, preview=False,
): ):
if preview: if preview:
return url_for( return {
"main.check_notification", "href": {
service_id=service_id, "url": url_for(
template_id=template.id, "main.check_notification",
) service_id=service_id,
template_id=template.id,
),
"text": "Back to preview"
},
"html": "Back to preview"
}
if step_index == 0: if step_index == 0:
if should_skip_template_page(template._template): if should_skip_template_page(template._template):
return url_for( return {
".choose_template", "href": {
service_id=service_id, "url": url_for(".choose_template", service_id=service_id),
) "text": "Back to all templates"
},
"html": "Back to all templates"
}
else: else:
return url_for( return {
".view_template", "href": {
"url": url_for(".view_template", service_id=service_id, template_id=template.id),
"text": "Back to confirm your template"
},
"html": "Back to confirm your template"
}
back_to_text = (
"Back to select recipients" if step_index == 1 else "Back to message personalization"
)
return {
"href": {
"url": url_for(
"main.send_one_off_step",
service_id=service_id, service_id=service_id,
template_id=template.id, template_id=template.id,
) step_index=step_index - 1,
),
return url_for( "text": back_to_text
"main.send_one_off_step", },
service_id=service_id, "html": back_to_text
template_id=template.id, }
step_index=step_index - 1,
)
def get_skip_link(step_index, template): def get_skip_link(step_index, template):
+1 -1
View File
@@ -12,7 +12,7 @@
{% block backLink %} {% block backLink %}
{{ usaBackLink({ "href": back_link }) }} {{ usaBackLink(back_link) }}
{% endblock %} {% endblock %}
{% block maincolumn_content %} {% block maincolumn_content %}
+2 -1
View File
@@ -11,7 +11,8 @@
{% block backLink %} {% block backLink %}
{{ usaBackLink({ {{ usaBackLink({
"href": url_for('main.choose_template', service_id=current_service.id, template_folder_id=template_folder_id) if template_folder_id else url_for('main.choose_template', service_id=current_service.id) "href": url_for('main.choose_template', service_id=current_service.id, template_folder_id=template_folder_id) if template_folder_id else url_for('main.choose_template', service_id=current_service.id),
"html": "Back to all templates"
}) }} }) }}
{% endblock %} {% endblock %}
+1 -1
View File
@@ -9,7 +9,7 @@
{% endblock %} {% endblock %}
{% block backLink %} {% block backLink %}
{{ usaBackLink({ "href": back_link }) }} {{ usaBackLink(back_link) }}
{% endblock %} {% endblock %}
{% block maincolumn_content %} {% block maincolumn_content %}
+1 -1
View File
@@ -9,7 +9,7 @@
{% endblock %} {% endblock %}
{% block backLink %} {% block backLink %}
{{ usaBackLink({ "href": back_link }) }} {{ usaBackLink(back_link) }}
{% endblock %} {% endblock %}
+4 -1
View File
@@ -12,7 +12,10 @@
{% block backLink %} {% block backLink %}
{{ usaBackLink(params) }} {{ usaBackLink({
"href": url_for('main.send_one_off_step', service_id=current_service.id, template_id=template.id, step_index=0),
"html": "Back to select recipients"
}) }}
{% endblock %} {% endblock %}
{% set phone_numbers = [ {% set phone_numbers = [