{% extends "admin/change_form.html" %}

{% block breadcrumbs %}{% endblock breadcrumbs %}

{% block content_title %}
  <h1>Message {{object.id}}</h1>
{% endblock content_title %}

{% block content %}
<div class="form-row">
  <label class="required">Subject: </label>{{subject}}
</div>
<div class="form-row">
  <label class="required">From: </label>
  {{ from }}
  <br>
</div>
<div class="form-row">
  <label class="required">To: </label>
  {% for address in to %}
    {{ address }}{% if not forloop.last %}, {% endif %}
  {% endfor %}<br>
</div>
<div class="form-row">
  <label class="required">CC: </label>
  {% for address in cc %}
    {{ address }}{% if not forloop.last %}, {% endif %}
  {% endfor %}<br>
</div>
{% if msg_html %}
  <div class="form-row">
    <h2>HTML</h2>
    <iframe src="{% url 'admin:mail_html' object.pk %}" width="100%" height="400">
    </iframe>
  </div>
{% endif %}
{% if msg_text %}
  <div class="form-row">
    <h2>Text</h2>
    {{msg_text|linebreaks}}
  </div>
{% endif %}
{% if attachments %}
  <div class="form-row">
    <h2>Attachments</h2>
    {% for file in attachments %}
      <div class="form-row">
        <a title="{{ file.content_type }} {{ file.size }}"
           href="{% url 'admin:mail_download' object.pk file.signature %}"
        >{{ file.filename }}</a>
      </div>
    {% endfor %}
  </div>
{% endif %}
{% endblock content %}
