{% extends 'diary/modal_base.html' %}
{% load static %}


{% block diary_head_extra %}
    {{ block.super }}
    <link rel="stylesheet" href="{% static 'diary/multi_col.css' %}" />
{% endblock diary_head_extra %}


{% block diary_nav %}
    {% url 'diary:month_nav' year=date.year month=date.month change='next' as diary_nav_next %}
    {% url 'diary:month_nav' year=date.year month=date.month change='prev' as diary_nav_prev %}
    {% url 'diary:year' year=date.year as diary_nav_up %}
    {{ block.super }}
{% endblock diary_nav %}


{% block diary_title %}
    {{ month_name }} {{ date.year }}
{% endblock diary_title %}


{% block diary_content %}
    {{ block.super }}

    <div class="container-fluid">

        {# the week headers with day names #}
        <div class="row cols-7">
            {% for day in day_names %}
                <div class="col-md-1 day">
                    {{ day }}
                </div>
            {% endfor %}
        </div>

        {# one week = seven days per row #}
        {% for week in weeks %}
            <div class="row cols-7">
                {% for day, nav_slug, entries, statistics, current in week %}
                    <div
                        class=
"col-md-1 day
{% if day != 0 %} regular{% endif %}
{% if current %} current{% endif %}"
                        >
                        {% if day != 0 %}
                            <a href="{% url 'diary:multi_day' slug=nav_slug %}">
                                {{ day }}
                                <br />
                            </a>
                            {% if entries %}
                                {% for entry in entries %}
                                    <span
                                        class=
"entry{% if entry.cancelled %} cancelled{% endif %}
{% if entry.no_show %} no_show{% endif %}"
                                        data-href=
"{% url 'diary:entry_modal' pk=entry.pk %}"
                                        data-toggle="modal"
                                        data-target="#ajaxModal"
                                        >
                                            {{ entry.customer }}
                                    </span>
                                    <br />
                                {% endfor %}
                            {% elif statistics %}
                                <span class="statistics">
                                    {{ statistics|safe }}
                                </span>
                            {% endif %}
                        {% endif %}
                    </div>
                {% endfor %}
            </div>
        {% endfor %}

    </div>

{% endblock diary_content %}
