{% extends "pretixcontrol/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% load formset_tags %}
{% block custom_header %}
    {{ block.super }}
    <link type="text/css" rel="stylesheet" href="{% url "control:pdf.css" %}">
{% endblock %}
{% block title %}{% trans "Organizer" %}{% endblock %}
{% block content %}
    <h1>
        {% blocktrans with name=organizer.name %}Organizer settings{% endblocktrans %}
        {% if request.user.is_staff and staff_session %}
            <a href="{% url "control:organizer.delete" organizer=organizer.slug %}"
                    class="btn btn-danger hidden-print">
                <span class="fa fa-trash"></span>
            </a>
        {% endif %}
    </h1>

    <form action="" method="post" class="form-horizontal" enctype="multipart/form-data">
        {% csrf_token %}
        {% bootstrap_form_errors sform %}
        {% bootstrap_form_errors form %}
        <div class="row">
            <div class="col-xs-12 col-lg-10">
                <div class="tabbed-form">
                    <fieldset>
                        <legend>{% trans "General" %}</legend>
                        {% bootstrap_field form.name layout="control" %}
                        {% bootstrap_field form.slug layout="control" %}
                        {% if form.domain %}
                            {% bootstrap_field form.domain layout="control" %}
                        {% endif %}
                        {% bootstrap_field sform.imprint_url layout="control" %}
                        {% bootstrap_field sform.contact_mail layout="control" %}
                        {% bootstrap_field sform.organizer_info_text layout="control" %}
                        {% bootstrap_field sform.event_team_provisioning layout="control" %}
                    </fieldset>
                    <fieldset>
                        <legend>{% trans "Organizer page" %}</legend>
                        {% bootstrap_field sform.organizer_logo_image layout="control" %}
                        {% bootstrap_field sform.organizer_logo_image_large layout="control" %}
                        {% bootstrap_field sform.organizer_homepage_text layout="control" %}
                        {% bootstrap_field sform.event_list_type layout="control" %}
                        {% bootstrap_field sform.event_list_availability layout="control" %}
                        {% bootstrap_field sform.organizer_link_back layout="control" %}
                    </fieldset>
                    <fieldset>
                        <legend>{% trans "Localization" %}</legend>
                        {% bootstrap_field sform.locales layout="control" %}
                        {% bootstrap_field sform.region layout="control" %}
                    </fieldset>
                    <fieldset>
                        <legend>{% trans "Shop design" %}</legend>
                        <p class="help-block">
                            {% blocktrans trimmed %}
                                These settings will be used for the organizer page as well as for the default settings
                                for all events in this account that do not have their own design settings.
                            {% endblocktrans %}
                        </p>
                        {% bootstrap_field sform.primary_color layout="control" %}
                        {% bootstrap_field sform.theme_color_success layout="control" %}
                        {% bootstrap_field sform.theme_color_danger layout="control" %}
                        {% bootstrap_field sform.theme_color_background layout="control" %}
                        {% bootstrap_field sform.theme_round_borders layout="control" %}
                        {% bootstrap_field sform.primary_font layout="control" %}
                        {% bootstrap_field sform.favicon layout="control" %}
                    </fieldset>
                    <fieldset>
                        <legend>{% trans "Gift cards" %}</legend>
                        {% bootstrap_field sform.giftcard_expiry_years layout="control" %}
                        {% bootstrap_field sform.giftcard_length layout="control" %}
                    </fieldset>
                </div>
            </div>
            <div class="col-xs-12 col-lg-2">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">
                            {% trans "Change history" %}
                        </h3>
                    </div>
                    {% include "pretixcontrol/includes/logs.html" with obj=organizer %}
                </div>
            </div>
        </div>
        <div class="form-group submit-group">
            <button type="submit" class="btn btn-primary btn-save">
                {% trans "Save" %}
            </button>
        </div>
    </form>
{% endblock %}
