{% extends "pretixcontrol/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block title %}{% trans "Account settings" %}{% endblock %}
{% block content %}
<h1>{% trans "Account settings" %}</h1>
<form action="" method="post" class="form-horizontal">
    {% csrf_token %}
    {% bootstrap_form_errors form %}
    <fieldset>
        <legend>{% trans "General settings" %}</legend>
        {% bootstrap_field form.fullname layout='horizontal' %}
        {% bootstrap_field form.locale layout='horizontal' %}
        {% bootstrap_field form.timezone layout='horizontal' %}
    </fieldset>
    <fieldset>
        <legend>{% trans "Login settings" %}</legend>
        {% bootstrap_field form.old_pw layout='horizontal' %}
        {% bootstrap_field form.email layout='horizontal' %}
        {% bootstrap_field form.new_pw layout='horizontal' %}
        {% bootstrap_field form.new_pw_repeat layout='horizontal' %}
        <div class="form-group">
            <label class="col-md-3 control-label" for="id_new_pw_repeat">{% trans "Two-factor authentication" %}</label>
            <div class="col-md-9 static-form-row">
                {% if user.require_2fa %}
                    <span class="label label-success">{% trans "Enabled" %}</span>
                    <a href="{% url "control:user.settings.2fa" %}">
                        {% trans "Change two-factor settings" %}
                    </a>
                {% else %}
                    <span class="label label-default">{% trans "Disabled" %}</span>
                    <a href="{% url "control:user.settings.2fa" %}">
                        {% trans "Enable" %}
                    </a>
                {% endif %}
            </div>
        </div>
        <div class="form-group">
            <label class="col-md-3 control-label" for="id_new_pw_repeat">{% trans "Account history" %}</label>
            <div class="col-md-9 static-form-row">
                <a href="{% url "control:user.settings.history" %}">
                    <span class="fa fa-history"></span>
                    {% trans "Show account history" %}
                </a>
            </div>
        </div>
    </fieldset>
    <div class="form-group submit-group">
        <button type="submit" class="btn btn-primary btn-save">
            {% trans "Save" %}
        </button>
    </div>
</form>
{% endblock %}
