<!--
SPDX-FileCopyrightText: 2017-present Tobias Kunze
SPDX-License-Identifier: AGPL-3.0-only WITH LicenseRef-Pretalx-AGPL-3.0-Terms
-->

{% extends "orga/settings/base.html" %}

{% load i18n %}

{% block extra_title %}{% translate "Settings" %} :: {% endblock extra_title %}

{% block settings_content %}
    <h2>{% translate "Settings" %}</h2>
    <form method="post" enctype="multipart/form-data">
        {% csrf_token %}

        {% include "orga/includes/tablist.html" %}

        <section role="tabpanel" id="tabpanel-general" aria-labelledby="tab-general" tabindex="0" aria-hidden="false">
            {% include "common/forms/errors.html" %}

            {{ form.name.as_field_group }}
            {{ form.slug.as_field_group }}
            {{ form.date_from.as_field_group }}
            {{ form.date_to.as_field_group }}
            {{ form.email.as_field_group }}
            {{ form.custom_domain.as_field_group }}
            {{ form.meta_noindex.as_field_group }}
            {{ form.imprint_url.as_field_group }}
        </section>
        <section role="tabpanel" id="tabpanel-localisation" aria-labelledby="tab-localisation" tabindex="0" aria-hidden="true">
            {{ form.locale.as_field_group }}
            {{ form.locales.as_field_group }}
            {{ form.content_locales.as_field_group }}
            {{ form.timezone.as_field_group }}
        </section>
        <section role="tabpanel" id="tabpanel-texts" aria-labelledby="tab-texts" tabindex="0" aria-hidden="true">
            {{ form.landing_page_text.as_field_group }}
            {{ form.featured_sessions_text.as_field_group }}
        </section>
        <section role="tabpanel" id="tabpanel-display" aria-labelledby="tab-display" tabindex="0" aria-hidden="true">
            <fieldset>
                <legend id="design">{% translate "Design" %}</legend>
                {{ form.primary_color.as_field_group }}
                {{ form.logo.as_field_group }}
                {{ form.header_image.as_field_group }}
                <div id="csswrap">
                    {{ form.custom_css.as_field_group }}
                    <button class="btn btn-outline-info" type="button" data-toggle="collapse" data-target="#collapseCSSBox" aria-expanded="false" aria-controls="collapseCSSBox">
                        <i class="fa fa-code"></i>
                    </button>
                </div>
                <div class="collapse" id="collapseCSSBox">
                    {{ form.custom_css_text.as_field_group }}
                </div>
                <div {% if request.event.primary_color %}style="--color: {{ request.event.primary_color }}"{% endif %} class="colorpicker-update">
                    {{ form.header_pattern.as_field_group }}
                </div>
            </fieldset>
            <fieldset>
                <legend id="schedule">{% translate "Schedule" %}</legend>
                {{ form.show_schedule.as_field_group }}
                {{ form.schedule.as_field_group }}
                {{ form.show_featured.as_field_group }}
                {{ form.use_feedback.as_field_group }}
                {{ form.export_html_on_release.as_field_group }}
                {{ form.html_export_url.as_field_group }}
            </fieldset>
            <fieldset>
                <legend id="other-settings">{% translate "Other settings" %}</legend>

                <div class="form-group hide-optional">
                    <label class="col-md-3 control-label">
                        {% translate "Header links" %}<br>
                        <span class="optional">{% translate "Optional" %}</span>
                    </label>
                    <div class="col-md-9">
                        <p class="mt-1 mb-2 text-muted">
                            {% blocktranslate trimmed %}
                                These links will be shown at the top of all your schedule-related pages, e.g.
                                the schedule itself, speaker pages, session pages, etc.
                                You could for example link to your home page, your registration page, or your
                                livestream here.
                            {% endblocktranslate %}
                        </p>
                        {% include "orga/includes/event_links_formset.html" with formset=header_links_formset %}
                    </div>
                </div>

                <div class="form-group hide-optional">
                    <label class="col-md-3 control-label">
                        {% translate "Footer links" %}<br>
                        <span class="optional">{% translate "Optional" %}</span>
                    </label>
                    <div class="col-md-9">
                        <p class="mt-1 mb-2 text-muted">
                            {% blocktranslate trimmed %}
                                These links will be shown in the footer of all your public pages. You could
                                for example link your terms of service, imprint, or privacy policy here.
                            {% endblocktranslate %}
                        </p>
                        {% include "orga/includes/event_links_formset.html" with formset=footer_links_formset %}
                    </div>
                </div>
            </fieldset>
        </section>
        {% include "orga/includes/submit_row.html" %}
    </form>
{% endblock settings_content %}
