{% extends 'ledger/base.html' %}
{% load i18n %}
{% load humanize %}
{% load static %}
{% load ledger %}

{% block page_title %}
    {{ title }} ⋗ {% translate "Ledger" %}
{% endblock %}

{% block page_topic %}
    <h1 class="page-header text-center">
        {{ title }}
    </h1>
{% endblock page_topic %}

{% block header_nav_collapse_left %}

{% include 'ledger/partials/menu/ally/navigation.html' %}

{% endblock header_nav_collapse_left %}

{% block header_nav_collapse_right %}

{% include 'ledger/partials/menu/ally/administration.html' %}

{% endblock header_nav_collapse_right %}

{% block ledger_block %}
<div class="card-body bg-primary rounded-top d-flex align-items-center">
    <h3 class="me-3">{% translate "Alliance Ledger" %}</h3>
    <div class="dropdown px-2">
        <button id="yearDropDownButton" class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
            {% now "Y" %}
        </button>
        <ul class="dropdown-menu" id="yearDropdown">
            {% for year in years %}
                <li><a class="dropdown-item" data-bs-year-id="{{ year }}" href="#">{{ year }}</a></li>
            {% endfor %}
        </ul>
    </div>
    <div class="dropdown px-2">
        <button id="monthDropDownButton" class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
            {% now "F" %}
        </button>
        <ul class="dropdown-menu" id="monthDropdown">
            <li><a class="dropdown-item" data-bs-month-id="1" href="#">{% trans "January" %}</a></li>
            <li><a class="dropdown-item" data-bs-month-id="2" href="#">{% trans "February" %}</a></li>
            <li><a class="dropdown-item" data-bs-month-id="3" href="#">{% trans "March" %}</a></li>
            <li><a class="dropdown-item" data-bs-month-id="4" href="#">{% trans "April" %}</a></li>
            <li><a class="dropdown-item" data-bs-month-id="5" href="#">{% trans "May" %}</a></li>
            <li><a class="dropdown-item" data-bs-month-id="6" href="#">{% trans "June" %}</a></li>
            <li><a class="dropdown-item" data-bs-month-id="7" href="#">{% trans "July" %}</a></li>
            <li><a class="dropdown-item" data-bs-month-id="8" href="#">{% trans "August" %}</a></li>
            <li><a class="dropdown-item" data-bs-month-id="9" href="#">{% trans "September" %}</a></li>
            <li><a class="dropdown-item" data-bs-month-id="10" href="#">{% trans "October" %}</a></li>
            <li><a class="dropdown-item" data-bs-month-id="11" href="#">{% trans "November" %}</a></li>
            <li><a class="dropdown-item" data-bs-month-id="12" href="#">{% trans "December" %}</a></li>
        </ul>
    </div>
    <div class="dropdown px-2">
        <button id="dayDropDownButton" class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
            {% trans "Day" %}
        </button>
        <ul class="dropdown-menu" id="dayDropdown">
            <!-- Days will be populated here -->
        </ul>
    </div>
    <div class="ms-auto">
        <a href="{% url 'ledger:alliance_administration' alliance_id=alliance_id %}"><button class="btn btn-secondary me-2 administration">{% translate 'Administration' %}</button></a>
        <a href="{% url 'ledger:alliance_overview' %}"><button class="btn btn-secondary overview">{% translate 'Alliance Overview' %}</button></a>
    </div>
</div>
<div class="card-body rounded-bottom">
    {% include 'ledger/partials/view/ledger.html' with entity_type=entity_type %}
</div>

<!-- Tab Session -->
{% include 'ledger/partials/modal/modal.html' with name="ViewCharacter" %}
{% endblock %}
{% block extra_css %}
{% include 'ledger/bundles/table-css.html' %}
{% endblock %}
{% block extra_javascript %}
{% include 'bundles/datatables-js-bs5.html' %}
{% include 'ledger/bundles/alliance-ledger-bundles.html' %}

{% endblock extra_javascript %}
{% block extra_script %}
{% endblock extra_script %}
