{% load i18n locale %}
{% if trans_stats %}
<div class="hd">
  <h3><span>{% trans "Translation Statistics" %}</span></h3>
</div>
<div>
  <table class="stats" lang="{{ LANGUAGE_CODE }}" dir="{% locale_dir %}">
    <tbody>
      {% for item in trans_stats %}
      <tr class="item">
        <td class="stats-name">{{ item.title }}</td>
        <td class="stats-number">{{ item.words|safe }}</td>
        <td class="stats-number">{{ item.percentage }}</td>
        <td class="stats-number">{{ item.units }}</td>
      </tr>
      {% endfor %}
    </tbody>
  </table>
</div>
{% endif %}
{% if check_failures %}
<div class="hd">
  <h3><span>{% trans "Failing Checks" %}</span></h3>
</div>
<div>
{% for failure_category in check_failures %}
  <h4>{{ failure_category.display_name }}</h4>
  <table id="check-{{ failure_category.name }}" class="checks">
    <tr>
    {% for check in failure_category.checks %}
      <td class="check-name"><a href="{{ check.url }}">{{ check.display_name }}</a></td>
      <td class="check-count"><a href="{{ check.url }}">{{ check.count }}</a></td>
    {% if not forloop.counter0|divisibleby:2 %}
    </tr>
    <tr>
    {% endif %}
    {% endfor %}
    </tr>
  </table>
{% endfor %}
</div>
{% endif %}
{% if not trans_stats and not check_failures %}
<h3>{% trans "Nothing to show" %}</h3>
{% endif %}
