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

{% 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.text "information" %}{% endif %}
    </div>
    <p>
        {{ text|rich_text }}
    </p>

    {% if request.event.settings.cfp_request_avatar %}
    {% bootstrap_form_errors form %}
    <div class="avatar-form form-group row">
        <label class="col-md-3 col-form-label">
            {% trans "Profile picture" %}
            <br>
            <img
            class="avatar float-right"
            data-gravatar="{{ gravatar_parameter }}"
            data-avatar=""
            alt="{% trans "Your avatar" %}"
            />
        </label>
        <div class="avatar-form-fields col-md-9">
            {% bootstrap_field form.get_gravatar layout='event-inline' %}
            <div class="user-avatar-display">
                {% bootstrap_field form.avatar layout='inline' %}
                <small class="form-text text-muted d-block">{{ profile_form.avatar.help_text }}</small>
            </div>
        </div>
    </div>
    {% endif %}
    {% bootstrap_field form.name layout='event' %}
    {% if form.biography %}{% bootstrap_field form.biography layout='event' %}{% endif %}
    {% if form.availabilities %}
    {% compress js %}
        <script defer src="{% static "vendored/moment-with-locales.js" %}"></script>
        <script defer src="{% static "vendored/moment-timezone-with-data-2012-2022.js" %}"></script>
        <script defer src="{% static "vendored/fullcalendar/fullcalendar.min.js" %}"></script>
        <script defer src="{% static "common/js/availabilities.js" %}"></script>
    {% endcompress %}
    {% bootstrap_field form.availabilities layout='event' %}
    {% endif %}

    {% compress js %}
        <script defer src="{% static "cfp/js/profile.js" %}"></script>
    {% endcompress %}
{% endblock %}
