{% extends "base.html" %}
{% load static i18n %}
{% block css %}
    {{ block.super }}
    <link href="{% static 'css/acp_calendar.css' %}" rel="stylesheet">
{% endblock css %}
{% block content %}
    <div class="container">
    {% if year %}
        <h1>{% trans 'Holidays for' %} {{ year }}</h1>
    {% else %}
        <h1>{% trans 'Holidays' %}</h1>
    {% endif %}
    <table id="position_table" class="table table-striped table-bordered" cellspacing="0" width="50%">
            <thead>
            <tr>
                <th>{% trans 'Type' %}</th>
                <th>{% trans 'Date' %}</th>
                <th>{% trans 'Fiscal Year' %}</th>
            </tr>
            </thead>

            <tbody>
            {% for holiday in acpholiday_list %}
                <tr>

                    <td>{{ holiday.holiday_type.name }}  &#x1F1F5; &#x1F1E6;</td>
                    <td>{{ holiday.date }}</td>
                    <td>{{ holiday.fiscal_year }}</td>

                </tr>
            {% endfor %}
            </tbody>
        </table>


    {% if is_paginated %}
        <ul class="pagination">
            {% if page_obj.has_previous %}
                <li><a href="?page={{ page_obj.previous_page_number }}">&laquo;</a></li>
            {% else %}
                <li class="disabled"><span>&laquo;</span></li>
            {% endif %}
            {% for i in page_obj.paginator.page_range %}
                {% if page_obj.number == i %}
                    <li class="active"><span>{{ i }} <span class="sr-only">(current)</span></span></li>
                {% else %}
                    <li><a href="?page={{ i }}">{{ i }}</a></li>
                {% endif %}
            {% endfor %}
            {% if page_obj.has_next %}
                <li><a href="?page={{ page_obj.next_page_number }}">&raquo;</a></li>
            {% else %}
                <li class="disabled"><span>&raquo;</span></li>
            {% endif %}
        </ul>
    {% endif %}
    </div>
{% endblock %}
