{% load i18n %}
{% load custom_tags %}
<div class="card">
    <div class="card-header">
        <div class="card-header-title">
            <h2 class="title is-4">
                <a href="{{ rescue_org.get_absolute_url }}">{{ rescue_org.name }}</a>
            </h2>
        </div>
    </div>

    <div class="card-content">
        <p>
            <strong>{% translate 'Zuletzt geprüft:' %}</strong> {{ rescue_org.last_checked_hr }}
        </p>
        {% if rescue_org.website %}
            <a href="{{ rescue_org.website }}" target="_blank">
                <i class="fas fa-globe" aria-label="{% translate "Website" %}"></i>
                {{ rescue_org.website|domain }}
            </a>
        {% endif %}
        {% for species_url in rescue_org.species_urls %}
            <p>{{ species_url.species }}: <a href="{{ species_url.url }}" target="_blank">{{ species_url.url }}</a></p>
        {% endfor %}
        {% if set_species_url_available %}

            <form method="POST">
                {% csrf_token %}
                <input type="hidden" name="action" value="set_species_url">
                <input type="hidden" name="rescue_organization_id" value={{ rescue_org.id }}>
                {{ species_url_form }}
                <input type="submit" class="button is-primary" value="{% trans 'Speichern' %}">
            </form>
        {% endif %}
    </div>
    <div class="card-footer">
        <div class="card-footer-item is-confirm">
            <form method="post">
                {% csrf_token %}
                <input type="hidden"
                       name="rescue_organization_id"
                       value="{{ rescue_org.pk }}">
                <input type="hidden" name="action" value="checked">
                <button class="" type="submit">{% translate "Organisation geprüft" %}</button>

            </form>
        </div>
        <div class="card-footer-item is-danger">
            <form method="post">
                {% csrf_token %}
                <input type="hidden"
                       name="rescue_organization_id"
                       value="{{ rescue_org.pk }}">
                <input type="hidden" name="action" value="exclude">
                <button class="" type="submit">{% translate "Von Check exkludieren" %}</button>

            </form>
        </div>
    </div>
</div>