Files
notifications-admin/app/templates/components/email-message.html
Chris Hill-Scott bc1899e8c0 Make email pattern work in new context
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.
2016-02-24 09:23:38 +00:00

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 }} &lt;{{ from_address }}&gt;
</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 %}