{% extends "base.html" %}
{% load i18n %}
{% load translations %}
{% load check_links %}

{% block breadcrumbs %}
<li><a href="{% url 'manage' %}">{% trans "Manage" %}</a></li>
<li><a href="{% url 'manage-performance' %}">{% trans "Performance report" %}</a></li>
{% endblock %}


{% block content %}
{% if errors %}
<div class="panel panel-danger">
<div class="panel-heading">
  <h4 class="panel-title">
    {% documentation_icon 'admin/install' 'production' right=True %}
    {% trans "Configuration errors" %}
  </h4>
</div>
  <table class="table table-striped">
  <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" %}" class="btn btn-primary" />
      <input type="submit" name="ignore" value="{% trans "Ignore permanently" %}" class="btn btn-primary" />
      </form>
      </td>
  </tr>
  {% endfor %}
  </tbody>
  </table>
<div class="panel-footer">
    <p class="helptext">
    {% 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 %}
<div class="panel panel-primary">
<div class="panel-heading">
  <h4 class="panel-title">
    {% documentation_icon 'admin/install' 'production' right=True %}
    {% trans "System checks" %}
  </h4>
</div>
  <table class="table table-striped">
  <thead>
  <tr>
    <th>{% trans "Name" %}</th>
    <th>{% trans "Message" %}</th>
    <th>{% trans "Documentation" %}</th>
  </tr>
  </thead>
  <tbody>
  {% for check in checks %}
  {% if not check.is_silenced %}
  <tr class="row{% cycle '1' '2' %}">
      <td>{{ check.id }}</td>
      <td>{{ check.msg }}</td>
      <td>{% check_link check %}</td>
  </tr>
  {% endif %}
  {% endfor %}
  </tbody>
  </table>
  </div>

  {% endif %}

  {% if not checks and not errors %}
  {% trans "Congratulations, your setup seems to work." as msg %}
  {% show_message "success" msg %}
  {% endif %}

</div>
{% endblock %}
