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

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

{% block page_title %}{% translate 'Fleet Activity' %}{% endblock %}

{% block afat_header %}
    <br>
    {% include "afat/partials/menu.html" %}

    <h2>{% translate "Recent Activity" %}</h2>
{% 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.html' %}

    <link rel="stylesheet" type="text/css" href="{% static 'afat/css/aa-bootstrap-fix.min.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'afat/css/allianceauth-afat.min.css' %}">
{% endblock %}

{% block extra_javascript %}
    {% include 'bundles/datatables-js.html' %}
    {% include 'bundles/moment-js.html' with locale=True %}

    <script type="application/javascript" src="{% static 'afat/libs/datatables/plugins/dataTables.rowGroup.min.js' %}"></script>
    <script type="application/javascript" src="{% static 'afat/libs/datatables/plugins/datetime.min.js' %}"></script>
    <script type="application/javascript" src="{% static 'js/filterDropDown/filterDropDown.min.js' %}"></script>
    <script type="application/javascript" src="{% static 'afat/javascript/allianceauth-afat.min.js' %}"></script>

    <script type="application/javascript">
        let afatSettings = {
            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: {
                    noFatsWarning: '{% translate "No recent FATs for" %}',
                    noFatlinksWarning: '{% translate "No recent FAT links" %}'
                },
            },
            modal: {
                deleteFatLinkModal: {
                    element: '#deleteFatLinkModal'
                },
                cancelEsiFleetModal: {
                    element: '#cancelEsiFleetModal'
                }
            }
        }
    </script>
    <script type="application/javascript" src="{% static 'afat/javascript/afat-dashboard.min.js' %}"></script>
{% endblock %}
