{% extends "allianceauth/base-bs5.html" %}

{% load i18n %}

{% block page_title %}
    {% translate "Fleet activity tracking" as page_title %}
    {{ page_title|title }}
{% endblock %}

{% block header_nav_brand %}
    {% translate "Fleet activity tracking" as page_title %}
    {{ page_title|title }}
{% endblock %}

{% block header_nav_collapse_left %}
    {% include "afat/partials/common/navigation/top-menu.html" %}
{% endblock %}

{% block content %}
    <div class="allianceauth-afat">
        <div class="allianceauth-afat-header">
            {% block afat_header %}{% endblock %}
        </div>

        <div class="allianceauth-afat-body">
            <script>
                const afatJsSettingsDefaults = {
                    datetimeFormat: 'YYYY-MMM-DD, HH:mm',
                    language: '{{ LANGUAGE_CODE }}',
                    dataTables: {
                        paging: true,
                        translation: {
                            decimal: '{% translate "." context "Decimal separator" %}',
                            thousands: '{% translate "," context "Thousands separator" %}',
                            emptyTable: '{% translate "No data available in this table" %}',
                            info: '{% translate "Showing _END_ entries" context "Keep _END_ as it is. It will be replaced by a number." %}',
                            infoFiltered: '{% translate "(filtered from _MAX_ total entries)" context "Keep _MAX_ as it is. It will be replaced by a number." %}',
                            infoEmpty: '{% translate "No records available" %}',
                            infoPostFix: '',
                            lengthMenu: '_MENU_',
                            loadingRecords: '{% translate "Loading …" %}',
                            processing: '{% translate "Processing …" %}',
                            zeroRecords: '{% translate "Nothing found, sorry …" %}',
                            search: '_INPUT_',
                            searchPlaceholder: '{% translate "Search …" %}',
                            paginate: {
                                first: '{% translate "First" %}',
                                last: '{% translate "Last" %}',
                                next: '{% translate "Next" %}',
                                previous: '{% translate "Previous" %}'
                            },
                            aria: {
                                sortAscending: '{% translate ": activate to sort column ascending" %}',
                                sortDescending: '{% translate ": activate to sort column descending" %}'
                            }
                        }
                    },
                };
            </script>

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

        <div class="allianceauth-afat-footer mt-3 pt-3 border-top border-light">
            {% include "afat/partials/footer/app-translation-footer.html" %}
        </div>

        <div class="allianceauth-afat-datalists">
            {% block afat_datalists %}{% endblock %}
        </div>
    </div>
{% endblock %}

{% block extra_script %}
    (() => {
        const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]');
        const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
    })();
{% endblock extra_script %}
