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

{% load i18n %}
{% load afat %}

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

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

{% block afat_body %}
    {% url "afat:statistics_alliance" allianceid year_prev as url_previous_year %}
    {% url "afat:statistics_alliance" allianceid year_next as url_next_year %}
    {% url "afat:statistics_alliance" allianceid year_current as url_current_year %}

    {% include "afat/partials/common/navigation/year-navigation.html" with url_previous_year=url_previous_year url_next_year=url_next_year url_current_year=url_current_year %}

    <div class="card card-default">
        <div class="card-body">
            <table class="table table-striped table-hover">
                <thead>
                    <tr>
                        <th>{% translate "Month" %}</th>
                        <th>{% translate "FATs" %}</th>

                        {% if type == 0 %}
                            <th>{% translate "Avg FATs" %}</th>
                        {% endif %}

                        <th></th>
                    </tr>
                </thead>

                <tbody>
                    {% for month in months %}
                        <tr>
                            <td>{{ month.0|month_name }}</td>
                            <td>{{ month.1 }}</td>

                            {% if type == 0 %}
                                <td>{{ month.2 }}</td>
                            {% endif %}

                            <td class="text-end">
                                {% if alliance != "No Alliance" %}
                                    <a
                                        href="{% url 'afat:statistics_alliance' allianceid year month.0 %}"
                                        class="btn btn-primary btn-sm"
                                        data-bs-toggle="tooltip"
                                        data-bs-html="true"
                                        data-bs-title="{% translate 'View detailed alliance statistics for: ' %}<br>{{ month.0|month_name }} {{ year }}"
                                    >
                                        <i class="fa-solid fa-eye"></i>
                                    </a>
                                {% endif %}
                            </td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
{% endblock %}

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