{% extends "pretixcontrol/event/settings_base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block inside %}
    <form action="" method="post" class="form-horizontal">
        {% csrf_token %}
        {% bootstrap_form_errors form %}
        <fieldset>
            <legend>{% trans "General information" %}</legend>
            {% bootstrap_field form.name layout="control" %}
            {% bootstrap_field form.slug layout="control" %}
            {% bootstrap_field form.date_from layout="control" horizontal_field_class="col-md-9 splitdatetimerow" %}
            {% bootstrap_field form.date_to layout="control" horizontal_field_class="col-md-9 splitdatetimerow" %}
            {% bootstrap_field form.location layout="control" %}
            {% bootstrap_field form.date_admission layout="control" horizontal_field_class="col-md-9 splitdatetimerow" %}
            {% bootstrap_field form.currency layout="control" %}
            {% bootstrap_field form.is_public layout="control" %}

            {% if meta_forms %}
                <div class="form-group metadata-group">
                    <label class="col-md-3 control-label">{% trans "Meta data" %}</label>
                    <div class="col-md-9">
                        {% for form in meta_forms %}
                            <div class="row">
                                <div class="col-md-4">
                                    <label for="{{ form.value.id_for_label }}">
                                        {{ form.property.name }}
                                    </label>
                                </div>
                                <div class="col-md-8">
                                    {% bootstrap_form form layout="inline" %}
                                </div>
                            </div>
                        {% endfor %}
                    </div>
                </div>
            {% endif %}
        </fieldset>
        <fieldset>
            <legend>{% trans "Display settings" %}</legend>
            {% bootstrap_field sform.locales layout="control" %}
            {% bootstrap_field sform.locale layout="control" %}
            {% bootstrap_field sform.timezone layout="control" %}
            {% bootstrap_field sform.show_date_to layout="control" %}
            {% bootstrap_field sform.show_times layout="control" %}
            {% bootstrap_field sform.contact_mail layout="control" %}
            {% bootstrap_field sform.imprint_url layout="control" %}
            {% bootstrap_field sform.confirm_text layout="control" %}
            {% bootstrap_field sform.show_quota_left layout="control" %}
            {% bootstrap_field sform.display_net_prices layout="control" %}
        </fieldset>
        <fieldset>
            <legend>{% trans "Timeline" %}</legend>
            {% bootstrap_field form.presale_start layout="control" horizontal_field_class="col-md-9 splitdatetimerow" %}
            {% bootstrap_field sform.presale_start_show_date layout="control" %}
            {% bootstrap_field form.presale_end layout="control" horizontal_field_class="col-md-9 splitdatetimerow" %}
            {% bootstrap_field sform.show_items_outside_presale_period layout="control" %}
            {% bootstrap_field sform.last_order_modification_date layout="control" %}
        </fieldset>
        <fieldset>
            <legend>{% trans "Orders" %}</legend>
            {% bootstrap_field sform.reservation_time layout="control" %}
            {% bootstrap_field sform.max_items_per_order layout="control" %}
            {% bootstrap_field sform.attendee_names_asked layout="control" %}
            {% bootstrap_field sform.attendee_names_required layout="control" %}
            {% bootstrap_field sform.order_email_asked_twice layout="control" %}
            {% bootstrap_field sform.attendee_emails_asked layout="control" %}
            {% bootstrap_field sform.attendee_emails_required layout="control" %}
            {% bootstrap_field sform.cancel_allow_user layout="control" %}
        </fieldset>
        <fieldset>
            <legend>{% trans "Waiting list" %}</legend>
            {% bootstrap_field sform.waiting_list_enabled layout="control" %}
            {% bootstrap_field sform.waiting_list_auto layout="control" %}
            {% bootstrap_field sform.waiting_list_hours layout="control" %}
        </fieldset>
        <div class="form-group submit-group">
            <button type="submit" class="btn btn-primary btn-save">
                {% trans "Save" %}
            </button>
        </div>
    </form>
{% endblock %}
