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

{% load static %}
{% load i18n %}
{% load filters %}

{% block page_title %}{{ alliance }} {% translate "Fleet Activity" %}{% endblock %}

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

    <h2>{{ alliance }} {% translate "Fleet Activity" %}</h2>
{% 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/year_navigation.html" with url_previous_year=url_previous_year url_next_year=url_next_year url_current_year=url_current_year %}

    <div class="panel panel-default">
        <div class="panel-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-right">
                                {% if alliance != 'No Alliance' %}
                                    <a href="{% url 'afat:statistics_alliance' allianceid year month.0 %}" class="btn btn-primary btn-sm">
                                        <span class="glyphicon glyphicon-eye-open"></span>
                                    </a>
                                {% endif %}
                            </td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
{% endblock %}

{% block extra_css %}
    <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 %}
