{% extends "cfp/event/base.html" %}
{% load i18n %}
{% load bootstrap4 %}
{% block title %}{% trans "Your submission" %} :: {{ request.event }}{% endblock %}
{% block content %}
    <h2>{% trans "Your submission:" %} {{ submission.title }}</h2>
    <p>
        {% trans "Current state of your submission:" %}
        {% include "cfp/event/fragment_state.html" with state=submission.state %}
    </p>
    <h5>
        <form class="add-speaker" action="{{ submission.urls.invite }}">
            <div class="form-group form-inline">
                {% blocktrans trimmed count count=submission.speakers.count %}
                    Speaker:
                    {% plural %}
                    Speakers:
                {% endblocktrans %}
                {{ submission.display_speaker_names }},
                <div class="input-group">
                    <input name="email" class="form-control form-control-sm" placeholder="another.speaker@mail.org">
                    <span class="input-group-btn">
                        <button class="btn btn-primary btn-sm">
                            <span class="fa fa-plus"></span>
                        </button>
                    </span>
                </div>
            </div>
        </form>
    </h5>
    <form action="" method="post">
        {% csrf_token %}
        {% bootstrap_form form layout='horizontal' %}
        {% bootstrap_form qform layout='horizontal' %}
        {% if can_edit %}
            <div class="row">
                <div class="col-md-3 ml-auto">
                    <button type="submit" class="btn btn-block btn-success btn-lg">
                        {% trans "Save" %}
                    </button>
                </div>
            </div>
        {% endif %}
    </form>
    {% if submission.state == "submitted" %}
        <h3>{% trans "Withdraw submission" %}</h3>
        <p>
            {% blocktrans trimmed %}
                You can click here to withdraw your submission from the selection process. You cannot undo this - if you are
                just uncertain if you can or should hold your talk, please contact the organizer instead.
            {% endblocktrans %}
        </p>
        <div class="row">
            <div class="col-md-3 ml-auto">
                <a href="{{ submission.urls.withdraw }}"
                   class="btn pull-right btn-danger btn-block">
                    {% trans "Withdraw" %}
                </a>
            </div>
        </div>
    {% elif submission.state == "accepted" or submission.state == "confirmed" %}
        <h3>{% trans "Cancel submission" %}</h3>
        <p>
            {% blocktrans trimmed %}
                As your submission has been accepted already, please contact the event's organizing team to cancel
                it. The best way to reach out would be an answer to your acceptance mail.
            {% endblocktrans %}
        </p>
    {% endif %}

    <div class="user-logs">
        {% include "common/logs.html" with obj=submission hide_orga="true" %}
    </div>
{% endblock %}
