{% extends "cfp/event/submission_base.html" %}
{% load bootstrap4 %}
{% load compress %}
{% load i18n %}
{% load orga_edit_link %}
{% load rules %}
{% load rich_text %}
{% load static %}

{% block cfp_submission_header %}
    {% compress js %}
        <script defer src="{% static "vendored/datetimepicker/bootstrap-datetimepicker.js" %}"></script>
        <script defer src="{% static "orga/js/datetimepicker.js" %}"></script>
        <script defer src="{% static 'vendored/select2.min.js' %}"></script>
        <script defer src="{% static "vendored/purify.min.js" %}"></script>
        <script defer src="{% static 'cfp/js/formTools.js' %}"></script>
    {% endcompress %}
    {% compress css %}
        <link rel="stylesheet" type="text/css" href="{% static "vendored/select2.min.css" %}"/>
        <link rel="stylesheet" type="text/x-scss" href="{% static "common/scss/_select2.scss" %}"/>
    {% endcompress %}
{% endblock %}

{% block inner %}
    <div class="d-flex">
        <h2>{{ title }}</h2>
        {% has_perm 'orga.edit_cfp' request.user request.event as can_edit_cfp %}
        {% if can_edit_cfp %}{% orga_edit_link request.event.cfp.urls.questions %}{% endif %}
    </div>
    <p>
        {{ text|rich_text }}
    </p>
    {% if form.submission_fields %}
        {% if form.speaker_fields and form.submission_fields %}
            <h4>{% translate "… about your proposal:" %}</h4>
        {% endif %}
        {% for field in form.submission_fields %}
            {% bootstrap_field field layout='event' %}
        {% endfor %}
    {% endif %}
    {% if form.speaker_fields %}
        {% if form.speaker_fields and form.submission_fields %}
            <h4>{% translate "… about yourself:" %}</h4>
        {% endif %}
        {% for field in form.speaker_fields %}
            {% bootstrap_field field layout='event' %}
        {% endfor %}
    {% endif %}
{% endblock %}
