{% extends "afat/base.html" %}

{% load evelinks %}
{% load i18n %}

{% block page_title %}
    {% translate "Fleet Activity Tracking" as page_title %}
    {{ page_title|title }}
{% endblock %}

{% block afat_header %}
    {% translate "Recent activity" as site_title %}
    {% include "framework/header/page-header.html" with title=site_title %}
{% endblock %}

{% block afat_body %}
    {% include "afat/partials/dashboard/tabs-navigation.html" %}

    <div class="tab-content">
        {% include "afat/partials/dashboard/tabs/fats.html" %}
        {% include "afat/partials/dashboard/tabs/fatlinks.html" %}
    </div>

    {% translate "Delete FAT link" as translated_title %}
    {% include "afat/modals/general.html" with modal_name="deleteFatLink" modal_title=translated_title confirm_button_class="btn-danger" %}

    {% translate "Close ESI fleet tracking" as translated_title %}
    {% include "afat/modals/general.html" with modal_name="cancelEsiFleet" modal_title=translated_title confirm_button_class="btn-danger" %}
{% endblock %}

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

{% block extra_javascript %}
    {% translate "No recent FAT links" as dataTableNoFatlinksWarning %}

    <script>
        const afatJsSettingsOverride = {
            url: {
                characterFats: '{% url "afat:dashboard_ajax_get_recent_fats_by_character" 0 %}',
                recentFatLinks: '{% url "afat:dashboard_ajax_get_recent_fatlinks" %}'
            },
            permissions: {
                addFatLink: {% if perms.afat.add_fatlink %}true{% else %}false{% endif %},
                manageAfat: {% if perms.afat.manage_afat %}true{% else %}false{% endif %}
            },
            translation: {
                dataTable: {
                    noFatlinksWarning: '{{ dataTableNoFatlinksWarning|escapejs }}'
                },
            },
            modal: {
                deleteFatLinkModal: {
                    element: '#deleteFatLinkModal'
                },
                cancelEsiFleetModal: {
                    element: '#cancelEsiFleetModal'
                }
            }
        };
    </script>

    {% include "bundles/datatables-js-bs5.html" %}
    {% include "bundles/moment-js.html" with locale=True %}
    {% include "afat/bundles/afat-js.html" %}
    {% include "afat/bundles/afat-dashboard-js.html" %}
{% endblock %}
