{% extends 'allianceauth/base-bs5.html' %}
{% load i18n %}

{% block page_title %}
    {% block page_template_title %}{% endblock page_template_title %} ⋗ {% translate "Ledger" %}
{% endblock %}

{% block header_nav_brand %}
    <a class="nav-link text-white link-light link-underline link-underline-opacity-0" href="{% url 'ledger:index' %}">{% translate "Ledger" %}</a>
{% endblock header_nav_brand %}

{% block header_nav_collapse_left %}
    {% include 'ledger/partials/navigation/navigation.html' %}
{% endblock header_nav_collapse_left %}

{% block header_nav_collapse_right %}
    {% include 'ledger/partials/navigation/administration.html' %}
{% endblock header_nav_collapse_right %}

{% block content %}
    <div class="aa-ledger">
        <!--- Ledger Header --->
        <div class="aa-ledger-header">
            {% block aaledger_header %}{% endblock %}
        </div>
        <!--- Ledger Body --->
        <div class="aa-ledger-body">
            {% get_datatables_language_static LANGUAGE_CODE as DT_LANG_PATH %}
            <script type="application/javascript">
                const aaLedgerDefaultSettings = {
                    // Alliance Auth settings
                    locale: '{{ LANGUAGE_CODE }}',
                    csrfToken: '{{ csrf_token }}',
                    // Ledger settings
                    dataTables: {
                        paging: true,
                        language: {url: '{{ DT_LANG_PATH }}'},
                        layout: {
                            topStart: 'pageLength',
                            topEnd: null,
                            bottomStart: 'info',
                            bottomEnd: 'paging'
                        },
                        ordering: {
                            indicators: false,
                            handler: false
                        },
                        columnControl: [
                            {
                                target: 0,
                                content: [
                                    'order',
                                ]
                            },
                            {
                                target: 1,
                                content: [
                                    'search'
                                ]
                            }
                        ]
                    },
                    translations: {
                        months: [
                            "{% trans 'January' %}", "{% trans 'February' %}", "{% trans 'March' %}", "{% trans 'April' %}",
                            "{% trans 'May' %}", "{% trans 'June' %}", "{% trans 'July' %}", "{% trans 'August' %}",
                            "{% trans 'September' %}", "{% trans 'October' %}", "{% trans 'November' %}", "{% trans 'December' %}"
                        ],
                        dayText: "{% trans 'Day' %}",
                        monthText: "{% trans 'Month' %}",
                        internalServerError: "{% translate 'Internal Server Error' %}",
                    },
                };
            </script>

            {% block ledger_block %}{% endblock %}
        </div>
    </div>
{% endblock %}

{% block extra_javascript %}
{% endblock %}

{% block extra_script %}
{% endblock %}
