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

{% load admin_tags i18n lib_tags static %}

{% block extra_css %}
  {{ block.super }}
  {% extra_static_content "domains" "css" user %}
{% endblock %}

{% block leftcol %}
  <ul class="nav nav-sidebar">
    {% domains_menu "domains" user False %}
  </ul>

  {% get_extra_admin_content user "leftcol" selection %}
{% endblock %}

{% block apparea %}
  <h2>{% trans "Opened alarms for" %} {{ object }}</h2>
  <hr>

  <table class="table">
    <thead>
      <tr>
        <th>{% trans "Date" %}</th>
        <th>{% trans "Message" %}</th>
        <th>{% trans "Mailbox" %}</th>
      </tr>
    </thead>
    <tbody>
      {% for alarm in object.alarms.opened %}
        <tr>
          <td>{{ alarm.created|date:"SHORT_DATETIME_FORMAT" }}</td>
          <td>{{ alarm.title }}</td>
          <td>{{ alarm.mailbox|default:"" }}</td>
        </tr>
      {% empty %}
        <tr>
          <td cospan="3">
            <div class="alert alert-info">{% trans "No opened alarm" %}</div>
          </td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
{% endblock %}
