{% extends "sentry/bases/account.html" %}

{% load crispy_forms_tags %}
{% load i18n %}
{% load sentry_helpers %}

{% block title %}{% trans "Account Settings" %} | {{ block.super }}{% endblock %}

{% block inner %}
    <form action="" method="post">
        {% csrf_token %}
        {{ form|as_crispy_errors }}
        <p>{% trans "To make changes to your account, you must first enter your current password." %}</p>
        {% with form.old_password as field %}
            {% if field %}
                {{ field|as_crispy_field }}
            {% endif %}
        {% endwith %}
        <hr>
        <fieldset class="control-group">
            <label>Username</label>
            <div class="controls">
                {{ request.user.username }}
            </div>
        </fieldset>
        {% with form.first_name as field %}
            {{ field|as_crispy_field }}
        {% endwith %}
        {% with form.email as field %}
            {{ field|as_crispy_field }}
        {% endwith %}
        <fieldset class="control-group">
            <label>Avatar</label>
            <div class="controls">
                <img class="avatar" src="{% gravatar_url user.email size 32 %}">
                <a href="http://gravatar.com/">Change your avatar at Gravatar.com</a>
            </div>
        </fieldset>
        <hr>
        <p>{% trans "You may also optionally change your password." %}</p>
        {% with form.new_password as field %}
            {{ field|as_crispy_field }}
        {% endwith %}

        <fieldset class="form-actions">
            <button type="submit" class="btn btn-primary">{% trans "Save Changes" %}</button>
        </fieldset>
    </form>
{% endblock %}
