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

View File

@@ -476,7 +476,7 @@ def send_one_off_step(service_id, template_id, step_index):
"views/send-test.html",
page_title=get_send_test_page_title(
template.template_type,
entering_recipient=not session["recipient"],
entering_recipient=(step_index == 0),
name=template.name,
),
template=template,
@@ -755,31 +755,52 @@ def get_back_link(
preview=False,
):
if preview:
return url_for(
"main.check_notification",
service_id=service_id,
template_id=template.id,
)
return {
"href": {
"url": url_for(
"main.check_notification",
service_id=service_id,
template_id=template.id,
),
"text": "Back to preview"
},
"html": "Back to preview"
}
if step_index == 0:
if should_skip_template_page(template._template):
return url_for(
".choose_template",
service_id=service_id,
)
return {
"href": {
"url": url_for(".choose_template", service_id=service_id),
"text": "Back to all templates"
},
"html": "Back to all templates"
}
else:
return url_for(
".view_template",
return {
"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,
template_id=template.id,
)
return url_for(
"main.send_one_off_step",
service_id=service_id,
template_id=template.id,
step_index=step_index - 1,
)
step_index=step_index - 1,
),
"text": back_to_text
},
"html": back_to_text
}
def get_skip_link(step_index, template):

View File

@@ -12,7 +12,7 @@
{% block backLink %}
{{ usaBackLink({ "href": back_link }) }}
{{ usaBackLink(back_link) }}
{% endblock %}
{% block maincolumn_content %}

View File

@@ -11,7 +11,8 @@
{% block backLink %}
{{ 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 %}

View File

@@ -9,7 +9,7 @@
{% endblock %}
{% block backLink %}
{{ usaBackLink({ "href": back_link }) }}
{{ usaBackLink(back_link) }}
{% endblock %}
{% block maincolumn_content %}

View File

@@ -9,7 +9,7 @@
{% endblock %}
{% block backLink %}
{{ usaBackLink({ "href": back_link }) }}
{{ usaBackLink(back_link) }}
{% endblock %}

View File

@@ -12,7 +12,10 @@
{% 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 %}
{% set phone_numbers = [