Files
notifications-admin/app/templates/components/sms-message.html
Chris Hill-Scott 51f6450e5d Make placeholder look more editable
Depends on:
- [ ] https://github.com/alphagov/notifications-utils/pull/40

In research we’ve noticed two problems with the appearance of
placeholders:

1. We are inconsistent about when we display the ((double brackets)).
   Sometimes we show them, sometimes we don’t. This doesn’t help user’s
   understanding about where the column names in their CSV file come
   from, or how they can edit the template to fix any errors.

2. Because they look so different from normal `<textarea>` text, it’s
   not immediately obvious that they can be edited just like normal
   text. They look more like something that can be dragged/inserted.

So this commit:

1. Makes the brackets always-visible.

2. Makes the text colour of the placeholder `$text-colour`, and only
   highlights the name of the ‘variable’, not the brackets themselves.
2016-06-06 12:59:40 +01:00

38 lines
816 B
HTML

{% macro sms_message(
body,
recipient=None,
id=None,
from=None,
version=1,
updated_at=None,
versions_url=None,
show_placeholder_for_recipient=False,
show_id=False
) %}
{% if recipient is not none %}
<p class="sms-message-recipient">
To:
{% if show_placeholder_for_recipient %}
<span class="placeholder-no-brackets">
phone number
</span>
{% else %}
{{ recipient }}
{% endif %}
</p>
{% endif %}
<div class="sms-message-wrapper{% if input_name %}-with-radio{% endif %}">
{% if from %}
<span class="sms-message-from">
{{ from }}
</span>
{% endif %}
{{ body|nl2br }}
</div>
{% if show_id %}
<p class="sms-message-recipient">
Template ID: {{ id }}
</p>
{% endif %}
{% endmacro %}