{% extends "orga/schedule/base.html" %}
{% load compress %}
{% load bootstrap4 %}
{% load i18n %}
{% load static %}

{% block schedule_content %}
<h2>{% trans "Release new schedule" %}</h2>
<div class="alert alert-warning"><span></span><span>
    {% blocktrans  trimmed %}
    There are still warnings about the release of this schedule. Please review them carefully!
    {% endblocktrans %}
</span></div>

<ul>
    <li>
        {% if request.event.wip_schedule.previous_schedule.version %}
        {% blocktrans with prev=request.event.wip_schedule.previous_schedule.version since=request.event.wip_schedule.previous_schedule.published|timesince trimmed %}
            The previous schedule ({{ prev }}) was released {{ since }} ago.
        {% endblocktrans %}
        {% else %}
        {% trans "This will be the very first schedule release." %}
        {% endif %}
    <li>
        {% if notifications %}
            {% blocktrans with notifications=notifications trimmed %}
            When releasing this new schedule, <strong>{{ notifications }} notifications emails
            </strong> will be generated and placed in the outbox, to tell speakers about their
            talk slots.
            {% endblocktrans %}
        {% else %}
            {% blocktrans trimmed %}
            This schedule release would result in <strong>no notification emails</strong> for
            speakers.
            {% endblocktrans %}
        {% endif %}
    </li>
    {% if warnings.unconfirmed %}
    <li>{% blocktrans with unconfirmed=warnings.unconfirmed|length trimmed %}
        {{ unconfirmed }} talks are still <strong>unconfirmed</strong> and will not show up
        on the public schedule.
    {% endblocktrans %}</li>
    {% endif %}
    {% if warnings.unscheduled %}
    <li>{% blocktrans with unscheduled=warnings.unscheduled|length trimmed %}
        {{ unscheduled }} talks have <strong>not yet been scheduled</strong>.
    {% endblocktrans %}</li>
    {% endif %}
    {% if warnings.no_track %}
    <li>{% blocktrans with no_track=warnings.no_track|length trimmed %}
        {{ no_track }} talks have <strong>not yet been assigned a track</strong>.
    {% endblocktrans %}</li>
    {% endif %}
</ul>
{% if warnings.talk_warnings %}
<h4>{% trans "Warnings" %}</h4>
<ul>
    {% for talk in warnings.talk_warnings %}
    {% for warning in talk.warnings %}
    <li><a href="{{ talk.submission.orga_urls.base }}">{{ quotation_open }}{{ talk.submission.title }}{{ quotation_close }}</a>: {{ warning.message }}</li>
    {% endfor %}
    {% endfor %}
</ul>

{% endif %}

<h4>{% trans "Public changelog" %}</h4>
<p>{% trans "This is how the new schedule version will appear in the public changelog and in the RSS feed." %}</p>

<div id="fake-changelog">
    <h4>{% trans "Version" %} …</h4>
    {% include "agenda/changelog_block.html" with schedule=request.event.wip_schedule %}
</div>

<div class="submit-group" id="release">
    <a href="{{ request.event.orga_urls.schedule }}" class="btn btn-info btn-lg">{% trans "Back" %}</a>
    <form method="post" class="d-flex align-items-center">
        {% csrf_token %}
        {% bootstrap_field form.notify_speakers layout='event-inline' form_group_class='col-lg-6' %}
        <div class="input-group">
            <input id="id_version" class="form-control" name="version" maxlength="200" title="" type="text" placeholder="{% trans "Version" %}" value="{{ suggested_version }}" required>
            <button type="submit" class="btn btn-success btn-lg">{% trans "Release" %}</button>
        </div>
    </form>
</div>
{% endblock %}
