mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-25 21:00:47 -05:00
This commit refactors the `email_message` and `sms_message` UI components to take fewer parameters. `name`, `edit_link` and anything to do with versions are identical for both text and email messages so I’ve moved them to the pages where you choose a template or see the versions. This commit also tidies up the wording and styling of the template history stuff.
55 lines
1.4 KiB
HTML
55 lines
1.4 KiB
HTML
{% macro email_message(
|
|
subject,
|
|
body,
|
|
from_name=None,
|
|
from_address=None,
|
|
recipient=None,
|
|
id=None,
|
|
show_placeholder_for_recipient=False,
|
|
show_id=False
|
|
) %}
|
|
<div class="email-message">
|
|
{% if from_name or subject %}
|
|
<table class="email-message-meta">
|
|
<tbody>
|
|
{% if from_name and from_address %}
|
|
<tr>
|
|
<th>From</th>
|
|
<td>
|
|
{{ from_name }} <{{ from_address }}>
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% if recipient is not none %}
|
|
<tr>
|
|
<th>To</th>
|
|
<td>
|
|
{% if show_placeholder_for_recipient %}
|
|
<span class="placeholder">
|
|
email address
|
|
</span>
|
|
{% else %}
|
|
{{ recipient }}
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% if subject %}
|
|
<tr class="email-message-meta">
|
|
<th>Subject</th>
|
|
<td>
|
|
{{ subject }}
|
|
</td>
|
|
</div>
|
|
{% endif %}
|
|
</tbody>
|
|
</table>
|
|
{% endif %}
|
|
<div class="email-message-body" data-module="expand-collapse" data-max-height="200">
|
|
<div class="email-message-body-wrapper">
|
|
{{ body|nl2br }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|