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

{% block breadcrumbs %}
<li><a href="{% url 'checks' %}">{% trans "Checks" %}</a></li>
<li><a href="{% url 'show_check' name=check.check_id %}">{{ check.name }}</a></li>
<li><a href="{% url 'show_check_project' name=check.check_id project=component.project.slug %}">{{ component.project }}</a></li>
<li><a href="{% url 'show_check_component' name=check.check_id project=component.project.slug component=component.slug %}">{{ component.name }}</a></li>
{% endblock %}

{% block content %}

<div class="row">
<div class="col-lg-6">

<table class="sort table progress-table table-listing">
    <thead>
        <tr>
            <th>{% trans "Translation" %}</th>
            <th class="number">{% trans "Total" %}</th>
            <th class="number">{% trans "Dismissed" %}</th>
            <th class="number">{% trans "Active" %}</th>
            <th class="number">{% trans "Translated" %}</th>
        </tr>
    </thead>
    <tbody>
    {% for obj in translations %}
        {% url 'translate' project=component.project.slug component=component.slug lang=obj.language.code as translate_url %}
        <tr>
            <th>
                <a href="{{ translate_url }}?q={{ check.url_id }}">
                    {{ obj.language }}
                </a>
            </th>
            <td class="number" data-value="{{ obj.check_count }}">
                <a href="{{ translate_url }}?q={{ check.url_id }} OR dismissed_{{ check.url_id }}">
                    {{ obj.check_count |intcomma}}
                </a>
            </td>
            <td class="number" data-value="{{ obj.dismissed_check_count }}">
                <a href="{{ translate_url }}?q=dismissed_{{ check.url_id }}">
                    {{ obj.dismissed_check_count |intcomma}}
                </a>
            </td>
            <td class="number" data-value="{{ obj.active_check_count }}">
                <a href="{{ translate_url }}?q={{ check.url_id }}">
                    {{ obj.active_check_count |intcomma}}
                </a>
            </td>
            <td class="number" data-value="{{ obj.translated_check_count }}">
                <a href="{{ translate_url }}?q={{ check.url_id }} AND state:&gt;=translated">
                    {{ obj.translated_check_count |intcomma}}
                </a>
            </td>
        </tr>
    {% endfor %}
    </tbody>
</table>
</div>

<div class="col-lg-6">
<div class="panel panel-default">
  <div class="panel-heading"><h4 class="panel-title">{% trans "Check details" %}</h4></div>
  <div class="panel-body">
    <p>
    {{ check.description }}
    </p>
  </div>
  <div class="panel-footer">
  <a class="btn btn-primary" href="{% documentation check %}">{% trans "Documentation" %}</a>
  </div>
</div>
</div>
</div>

</div>

{% endblock %}
