{#
SPDX-FileCopyrightText: 2026 Martin Kirchgessner

SPDX-License-Identifier: AGPL-3.0-or-later
#}

{% extends 'layout.jinja' %}
{% block title %}Auto-DJ{% endblock title %}

{% from 'autodj/macros.jinja' import autodj_slot %}
{% set can_autodj = current_user.user.can_autodj() %}

{% block content %}
<section class="content">
<div class="container">
<h1>
    Auto-DJ
</h1>

{% if can_autodj %}
<p>
    <a
        class="button is-primary"
        href="{{ url_for('autodj.add_form')}}"
        aria-label="Add"
        >
        Add
    </a>
</p>
{% endif %}

<div class="columns" id="autodjschedule">
    {% for day in day_names %}
        <section class="column" role="region" aria-labelledby="day_name_{{day.value}}">
            <header aria-hidden="true">
                <h2 id="day_name_{{day.value}}" class="title is-4">
                    {{ day.display }}
                </h2>
            </header>
            <div class="schedule" style="height: {{ 24*REM_PER_HOUR }}rem;">
                {% for slot in slots_per_day[day.value] %}
                    {{ autodj_slot(slot, can_autodj) }}
                {% endfor %}
            </div>
        </section>
    {% endfor %}
</div>

</div>
</section>

{% endblock %}
