{% extends "base.html" %}
{% load i18n %}
{% block title %}{{ _("Edit Settings") }}{% endblock %}
{% block content_title %}{{ _("Edit Settings") }}{% endblock %}
{% block content %}

    {% if auth_forbidden %}
    <h3 class="errors">{{ _("Access Forbidden") }}</h3>
    <p>{{ _("You have not necessary rights to access current page.") }}</p>
    {% else %}
    <form action="" method="post">
        {% csrf_token %}

        {% if form.errors %}
        <ul class="messages">
            <li class="error">{{ _("Settings cannot be saved cause of validation issues. Check for errors below.") }}</li>
        </ul>
        {% endif %}

        <dl class="fields">
        {% for f in form %}
            <dt><label for="{{ f.auto_id }}">{{ f.label }}</label></dt>
            <dd class="field">{{ f }}</dd>
            {% if f.errors %}<dd class="errors">{{ f.errors|join:" " }}</dd>{% endif %}
            {% if f.help_text %}<dd class="help">{{ f.help_text }}</dd>{% endif %}
        {% endfor %}
        </dl>

        <p class="buttons">
            <button type="submit">{{ _("Submit") }}</button>
            <button><a href="{% url setman_revert %}" title="{{ _("Revert all settings to default values") }}">{{ _("Revert") }}</a></button>
        </p>
    </form>

    <p>{% url home as home_url %}{% blocktrans %}Back to <a href="{{ home_url }}">home page</a>.{% endblocktrans %}</p>
    {% endif %}

{% endblock %}
