mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 10:53:28 -05:00
The email pattern looked a bit shonky when displayed in a narrower column. This commit fixes it by making the email’s metadata (eg subject, from) into a table, which it sort of is. This means that it is more flexible about the size of container in which it sits.
39 lines
1012 B
HTML
39 lines
1012 B
HTML
{% macro email_message(subject, body, name=None, edit_link=None, from_name=None, from_address=None) %}
|
|
{% if name %}
|
|
<h3 class="email-message-name">
|
|
{% if edit_link %}
|
|
<a href="{{ edit_link }}">{{ name }}</a>
|
|
{% else %}
|
|
{{ name }}
|
|
{% endif %}
|
|
</h3>
|
|
{% endif %}
|
|
<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 subject %}
|
|
<tr class="email-message-meta">
|
|
<th>Subject</th>
|
|
<td>
|
|
{{ subject }}
|
|
</td>
|
|
</div>
|
|
{% endif %}
|
|
</tbody>
|
|
</table>
|
|
{% endif %}
|
|
<div class="email-message-body">
|
|
{{ body|nl2br }}
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|