{% load i18n %}
<div class="col-lg-3">
    {% if year.open %}
        <div class="card text-bg-primary">
            <div class="card-header">{{ year.year }}</div>
            <div class="card-body">
                {% translate "Members" %}: <span class="badge bg-primary">{{ year.members }}</span>
                <br />
                {% translate "Santee" %}: <span class="badge bg-primary">{{ users_santee.profile.main_character.character_name }}</span>
                <br />
                <br />
                {% if application_exists %}
                    <span class="btn btn-info" role="button" disabled="disabled">{% translate "Joined" %}</span>
                {% else %}
                    <a class="btn btn-info" href="{% url 'secretsanta:apply' year.year %}" role="button">{% translate "Join" %}</a>
                {% endif %}
                {% if year.participating %}
                    <a class="btn btn-info" href="{% url 'secretsanta:mark_received' year.year %}" role="button">{% translate "Received Gift" %}</a>
                {% endif %}
                {% if perms.secretsanta.manager %}
                    <a class="btn btn-warning" href="{% url 'secretsanta:applications' year.year %}" role="button">{% translate "Applications" %}</a>
                    <a class="btn btn-danger" href="{% url 'secretsanta:pairs' year.year %}" role="button"><span class="fa fas fa-skull-crossbones"></span> {% translate "Administer" %} <span class="fa fas fa-skull-crossbones"></span></a>
                {% endif %}
            </div>
        </div>
    {% else %}
        <div class="card text-bg-secondary">
            <div class="card-header">{{ year.year }}</div>
            <div class="card-body">
                {% translate "Members" %}: <span class="badge bg-primary">{{ year.members }}</span>
                <br />
                {% translate "Santee" %}: <span class="badge bg-primary">{{ users_santee }}</span>
                <br />
                <br />
                {% if santapair_exists %}
                    {% if gift_delivered %}
                        <span class="btn btn-info" disabled="disabled" role="button">{% translate "Received Gift" %}</span>
                    {% else %}
                        <a class="btn btn-info" href="{% url 'secretsanta:mark_received' year.year %}" role="button">{% translate "Received Gift" %}</a>
                    {% endif %}
                {% endif %}
                {% if perms.secretsanta.manager %}
                    <a class="btn btn-warning" href="{% url 'secretsanta:applications' year.year %}" role="button">{% translate "Applications" %}</a>
                    <a class="btn btn-danger" href="{% url 'secretsanta:pairs' year.year %}" role="button"><span class="fa fas fa-skull-crossbones"></span> {% translate "Administer" %} <span class="fa fas fa-skull-crossbones"></span></a>
                {% endif %}
            </div>
        </div>
    {% endif %}
</div>
