{% extends "wcs/backoffice/base.html" %}
{% load i18n %}

{% block appbar-title %}{% trans "Mail Template" %} - {{ mail_template.name }}{% endblock %}

{% block appbar-actions %}
<a href="delete">{% trans "Delete" %}</a>
<a href="edit">{% trans "Edit" %}</a>
{% endblock %}

{% block content %}
{% if mail_template.description %}
<div class="bo-block">{{ mail_template.description }}</div>
{% endif %}

{% if mail_template.subject and mail_template.body %}
<div class="section">
<h3 class="mail-subject"><strong>{% trans "Subject:" %} </strong>{{ mail_template.subject }}</h3>
<div class="mail-body">{{ mail_template.body }}</div>
</div>

{% for workflow in mail_template.get_places_of_use %}
{% if forloop.first %}
<div class="section">
 <h3>{% trans "Usage in workflows" %}</h3>
 <ul class="objects-list single-links">
{% endif %}
  <li><a href="../../{{ workflow.id }}/">{{ workflow.name }}</a></li>
{% if forloop.last %}
 </ul>
</div>
{% endif %}
{% endfor %}

{% else %}
<div class="infonotice">{% trans "This mail template still needs to be configured." %}</div>
{% endif %}

{% endblock %}
