{% extends "admin/base_site.html" %}
{% load i18n %}
{% load translations %}
{% load check_links %}

{% block title %}{% trans "Performance report" %}{% endblock %}

{% block breadcrumbs %}
<div class="breadcrumbs"><a href="../">
{% trans "Home" %}</a> &rsaquo; {% trans "Performance" %}
</div>{% endblock %}

{% block content %}
<div id="content-main">
  <h1>{% trans "Performance overview" %}</h1>
  <ul class="object-tools">
    <li>
        <a href="{% documentation 'admin/install' 'production' %}" class="doclink">{% trans "Documentation" %}</a>
    </li>
  </ul>
  {% if errors %}
  <h2>{% trans "Configuration errors" %}</h2>
  <div id="changelist" class="module filtered">
    <div class="results">
  <table id="result_list" class="orderable-initalized">
  <thead>
  <tr>
    <th>{% trans "Last occurrence" %}</th>
    <th>{% trans "Name" %}</th>
    <th>{% trans "Message" %}</th>
    <th></th>
  </tr>
  </thead>
  <tbody>
  {% for error in errors %}
  <tr class="row{% cycle '1' '2' %}">
      <td>{{ error.timestamp }}</td>
      <td>{{ error.name }}</td>
      <td><pre>{{ error.message }}</pre></td>
      <td>
      <form method="POST">
      {% csrf_token %}
      <input type="hidden" name="pk" value="{{ error.pk }}"/>
      <input type="submit" name="dismiss" value="{% trans "Dismiss" %}" />
      <input type="submit" name="ignore" value="{% trans "Ignore permanently" %}" />
      </form>
      </td>
  </tr>
  {% endfor %}
  </tbody>
  </table>
    <p class="help">
    {% trans "You can safely permanently ignore errors for file formats you do not intend to use. These are usually caused by missing or outdated dependencies." %}
    </p>
    </div>
  </div>
  {% endif %}

  {% if checks %}
  <h2>{% trans "System checks" %}</h2>
  <div id="changelist" class="module filtered">
    <div class="results">
  <table id="result_list" class="orderable-initalized">
  <thead>
  <tr>
    <th>{% trans "Name" %}</th>
    <th>{% trans "Message" %}</th>
    <th>{% trans "Documentation" %}</th>
  </tr>
  </thead>
  <tbody>
  {% for check in checks %}
  <tr class="row{% cycle '1' '2' %}">
      <td>{{ check.id }}</td>
      <td>{{ check.msg }}</td>
      <td>{% check_link check %}</td>
  </tr>
  {% endfor %}
  </tbody>
  </table>
    </div>
  </div>

  {% endif %}

  {% if not checks and not errors %}
  <p>{% trans "Congratulations, your setup seems to work." %}</p>
  {% endif %}

</div>
{% endblock %}
