{% extends "secretsanta/base-bs5.html" %}
{% load i18n %}
{% load humanize %}
{% block content %}
    <div class="card card-default">
        <div class="card-header">
            <h3 class="card-title">{% translate "Secret Santa Pairs" %}</h3>
        </div>
        <div class="card-body">
            <table class="table table-hover" id="table-secret-santa-pairs">
                <thead>
                    <tr>
                        <th class="text-start">{% translate "Santa" %}</th>
                        <th class="text-start">{% translate "Santa Affiliation" %}</th>
                        <th class="text-start">{% translate "Santee" %}</th>
                        <th class="text-start">{% translate "Santee Affiliation" %}</th>
                        <th class="text-start">{% translate "Delivered" %}</th>
                    </tr>
                </thead>
                <tbody>
                    {% for pair in pairs %}
                        <tr>
                            <td>{{ pair.santa.profile.main_character }}</td>
                            <td>{{ pair.santa.profile.main_character.corporation_name }} / {{ pair.santa.profile.main_character.alliance_name|default_if_none:"" }}</td>
                            <td>{{ pair.santee.profile.main_character }}</td>
                            <td>{{ pair.santee.profile.main_character.corporation_name }} / {{ pair.santee.profile.main_character.alliance_name|default_if_none:"" }}</td>
                            <td>{{ pair.delivered }}</td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
    {% if year.open %}
    {% else %}
        <a class="btn btn-warning" href="{% url 'secretsanta:notify_santas' year.year %}" role="button"><span class="fa fas fa-skull-crossbones"></span> {% translate "Notify Santas on Discord" %} <span class="fa fas fa-skull-crossbones"></span></a>
        <a class="btn btn-info" href="{% url 'secretsanta:notify_outstanding_santees' year.year %}" role="button"><span class="fa fas fa-skull-crossbones"></span> {% translate "Remind Outstanding Santas" %} <span class="fa fas fa-skull-crossbones"></span></a>
    {% endif %}
{% endblock content %}
{% block extra_javascript %}
    {% include "bundles/datatables-js-bs5.html" %}
    {% include "bundles/moment-js.html" %}
{% endblock extra_javascript %}
{% block extra_css %}
    {% include "bundles/datatables-css-bs5.html" %}
{% endblock extra_css %}
{% block extra_script %}
    $(document).ready( function () {
    $('#table-secret-santa-pairs').DataTable({
    lengthMenu: [
    [10, 25, 50, 100, -1],
    [10, 25, 50, 100, 'All'],
    ],
    "stateSave": true,
    "stateDuration": 0
    });
    } );
{% endblock extra_script %}
