Add conditional placeholder detection

Implements: https://github.com/alphagov/notifications-utils/pull/51

Copies the same regex.

Adds some CSS to display conditional placeholders differently to
normal placeholders (vertical rather that curved right-hand edge).
This commit is contained in:
Chris Hill-Scott
2016-07-12 12:48:09 +01:00
parent d380eaf060
commit c006b8748c
4 changed files with 23 additions and 5 deletions

View File

@@ -144,7 +144,7 @@
{% if 'email' == template.template_type %}
{{ email_message(
template.formatted_subject_as_markup if errors else template.replaced_subject,
template.formatted_as_markup if errors else template.replaced,
template.formatted_as_markup if errors else template.replaced|safe,
from_address='{}@notifications.service.gov.uk'.format(current_service.email_from),
from_name=current_service.name,
recipient=first_recipient,
@@ -154,7 +154,7 @@
<div class="grid-row">
<div class="column-two-thirds">
{{ sms_message(
template.formatted_as_markup if errors else template.replaced,
template.formatted_as_markup if errors else template.replaced|safe,
recipient=first_recipient,
show_placeholder_for_recipient=errors
)}}