{% extends 'aa_contacts/base.html' %}
{% load i18n %}

{% block page_title %}{% translate "Alliance Contacts" %}{% endblock page_title %}

{% block extra_css %}
    {% include "bundles/datatables-css-bs5.html" %}
{% endblock %}

{% block aacontactscontent %}
    {% include "framework/header/page-header.html" with title=alliance.alliance_name|add:" Contacts" %}
    {% if perms.aa_contacts.manage_alliance_contacts %}
        <div class="row justify-content-center my-3">
            <div class="col-6">
                <div class="card-group">
                    <div class="card text-center">
                        <div class="card-header">
                            {% translate "Last update" %}
                        </div>
                        <div class="card-body">
                            <p>{{ token.last_update|date:"d/m/Y G:i e" }}</p>
                        </div>
                    </div>
                    <div class="card text-center">
                        <div class="card-header">
                            {% translate "Actions" %}
                        </div>
                        <div class="card-body">
                            <a class="btn btn-primary" href="{% url "aa_contacts:update_alliance" alliance.pk %}">{% translate "Update" %}</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    {% endif %}
    <div class="col-12">
        <div class="card">
            <div class="card-body">
                {% include "aa_contacts/contact_list.html" with view_notes=perms.aa_contacts.view_alliance_notes edit_notes=perms.aa_contacts.manage_alliance_contacts contacts=contacts edit_url="aa_contacts:update_alliance_contact" %}
            </div>
        </div>
    </div>
{% endblock aacontactscontent %}

{% block extra_javascript %}
    {% include "bundles/datatables-js-bs5.html" %}
    {% include "bundles/filterdropdown-js.html" %}
{% endblock extra_javascript %}