{% extends 'diary/day_base.html' %}


{% block diary_nav %}
    {% url 'diary:day_nav' slug=nav_slug change='next' as diary_nav_next %}
    {% url 'diary:day_nav' slug=nav_slug change='prev' as diary_nav_prev %}
    {% url 'diary:multi_day' slug=nav_slug as diary_nav_up %}
    {{ block.super }}
{% endblock diary_nav %}


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


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

    <div class="container-fluid">
        {% for label, datetime_slug, start_time, entries, current, trading, historic, advance, allow_dnd in time_slots %}
            <div class="row">
                <div class="col-md-2">
                    <b>{{ label }}</b>
                </div>
                <div
                    id="{{ datetime_slug }}"
                    class=
"row col-md-8 droptarget
{% if current %} current{% endif %}
{% if trading %}
{% if historic %} historic{% elif advance%} advance{% else %} trading{% endif %}
{% else %} admin{% endif %}"
                    {% if request.user.is_staff or allow_dnd %}
                        ondragenter="dragenter(event);"
                        ondragleave="dragleave(event);"
                        ondragover="dragover(event);"
                        ondrop="drop(event);"
                        ondragend="dragend(event);"
                    {% endif %}
                    >
                {% url 'diary:entry_new' slug=datetime_slug as new_entry %}
                    <button
                        class="btn btn-link new"
                        type="button"
onclick="location.href='{{ new_entry }}?next={{ request.path }}'"
                        >
                        <span class="glyphicon glyphicon-plus">
                        </span>
                    </button>
                    {% for entry in entries %}
                        <div
class="entry{% if entry.cancelled %} cancelled{% endif %}{% if entry.no_show %} no_show{% endif %}"
                            id="{{ entry.pk }}"
                            {% if request.user.is_staff or allow_dnd %}
                                draggable="true"
                                ondragstart="drag(event);"
                            {% endif %}
                            >
                            <div
                                data-href=
                            "{% url 'diary:entry_modal' pk=entry.pk %}"
                                data-toggle="modal"
                                data-target="#ajaxModal"
                                >
                                <b>{{ entry.customer }}</b> -
                                {{ entry.short }}
                            </div>
                        </div>
                    {% endfor %}
                </div>
            </div>
        {% endfor %}
    </div>

{% endblock diary_content %}
