{% extends "fellchensammlung/base.html" %}
{% load i18n %}
{% load static %}
{% block additional_scrips %}
    <script src="{% static 'fellchensammlung/js/mousetrap.min.js' %}"></script>
    <script src="{% static 'fellchensammlung/js/rescue-org-check-shortcuts.js' %}"></script>
{% endblock %}

{% block content %}
    <h1 class="title is-1">{% translate "Aktualitätscheck" %}</h1>
    <p class="subtitle is-3">{% translate "Überprüfe ob es in Tierheimen neue Tiere gibt die ein Zuhause suchen" %}</p>

    <div class="block">
        <div class="columns">
            <div class="column">
                <strong>{% translate 'Geprüfte Tierheime' %}:</strong> {{ num_rescue_orgs_checked }}
            </div>
            <div class="column">
                <strong>{% translate 'Tierheime zur Prüfung' %}:</strong> {{ num_rescue_orgs_to_check }}
            </div>
            <div class="column">
                <strong>Geprüft sind {{ percentage_checked|stringformat:"0.2f" }}%</strong>
            </div>
            <div class="column">
                {% if dq %}
                    <a class="button is-info"
                       href="{% url 'organization-check' %}">{% translate 'Datenergänzung deaktivieren' %}</a>
                {% else %}
                    <a class="button is-info is-light"
                       href="{% url 'organization-check-dq' %}">{% translate 'Datenergänzung aktivieren' %}</a>
                {% endif %}
            </div>
        </div>
    </div>

    <div class="block">
        <h2 class="title is-3">{% translate "Am längsten nicht geprüft" %}</h2>
        <div class="grid is-col-min-15">
            {% for rescue_org in rescue_orgs_to_check %}
                <div class="cell">
                    {% include "fellchensammlung/partials/rescue_orgs/partial-check-rescue-org.html" %}
                </div>
            {% endfor %}
        </div>
    </div>
    <hr>

    <div class="block">
        <h2 class="title is-3">{% translate "In aktiver Kommunikation" %}</h2>
        <div class="grid is-col-min-15">
            {% for rescue_org in rescue_orgs_with_ongoing_communication %}
                <div class="cell">
                    {% include "fellchensammlung/partials/rescue_orgs/partial-check-rescue-org.html" %}
                </div>
            {% endfor %}
        </div>
    </div>
    <hr>

    <div class="block">
        <h2 class="title is-3">{% translate "Zuletzt geprüft" %}</h2>
        <div class="grid is-col-min-15">
            {% for rescue_org in rescue_orgs_last_checked %}
                <div class="cell">
                    {% include "fellchensammlung/partials/rescue_orgs/partial-check-rescue-org.html" %}
                </div>
            {% endfor %}
        </div>
    </div>
    {% include "fellchensammlung/partials/modal-shortcuts.html" %}
{% endblock %}
