{% extends 'base.html' %}

{% load i18n %}

{% block title %}{% trans "Configuration" %} – {{ block.super }}{% endblock %}

{% block content %}
<h1>
    {% trans 'Configuration' %}
    <small>{% trans active_config_collection_view.title %}</small>
    <small class="pull-right">
        <div class="btn-toolbar">
            <div class="btn-group">
            {% for config_collection_dict in config_collection_list %}
                <a href="/config/{{ config_collection_dict.config_collection.url }}/" class="btn btn-mini {% if config_collection_dict.active %}active{% endif %}">
                    {% trans config_collection_dict.config_collection.title %}
                </a>
            {% endfor %}
            </div>
        </div>
    </small>
</h1>
<form action="" method="post">{% csrf_token %}
    {% for group in groups %}
        <fieldset>
            <legend>{{ group.title }}</legend>
            {% for field in form %}
                {% if field.name in group.get_field_names %}
                    <div class="control-group {% if field.errors %}error{% endif%}">
                        <label for="id_{{ field.name }}">{{ field.label }}{% if field.field.required %}<span class="required">*</span>{% endif %}:</label>
                        {{ field }}
                        {% if field.errors %}
                            <span class="help-inline">{{ field.errors }}</span>
                        {% endif %}
                        {% if field.help_text %}
                            <span class="help-inline">{{ field.help_text }}</span>
                        {% endif %}
                    </div>
                {% endif %}
            {% endfor %}
        </fieldset>
    {% empty %}
        {% include 'form.html' %}
    {% endfor %}
    <p>
        {% include 'formbuttons_save.html' %}
        <a href="/config/{{ active_config_collection_view.url }}/" class="btn">{% trans 'Cancel' %}</a>
    </p>
    <small>* {% trans 'required' %}</small>
</form>
{% endblock %}
