Allowing for a custom label on the first step

This commit is contained in:
Jonathan Bobel
2025-04-21 12:12:09 -04:00
parent b4afcb07aa
commit fe42f5ef64
2 changed files with 4 additions and 1 deletions

View File

@@ -481,6 +481,7 @@ def send_one_off_step(service_id, template_id, step_index):
),
template=template,
form=form,
current_placeholder=current_placeholder,
skip_link=get_skip_link(step_index, template),
back_link=back_link,
link_to_upload=(

View File

@@ -40,12 +40,14 @@
) %}
<div class="grid-row">
{% set is_phone_number = form.placeholder_value.label.text == "phone number" %}
{% set hint_text = "Include area code, e.g. 202-555-0191" if is_phone_number else None %}
{% set label_text = "Country code and phone number" if current_placeholder == "phone number" else current_placeholder.title() %}
{% set hint_text = "For example: +18885551234" if is_phone_number else None %}
{% set extra_class = "extra-tracking" if is_phone_number else "" %}
<div class="grid-col-12 {{ extra_class }}">
{{ textbox(
form.placeholder_value,
label=label_text,
hint=hint_text,
extra_form_group_classes=extra_class,
param_extensions={"id": "phone-number", "classes": ""}