{% extends 'base.html' %}
{% load i18n %}
{% load bootstrap_toolkit %}
{% load django_bootstrap_breadcrumbs %}
{% load tags %}
{% load common_tags %}

{% block title %}{% trans "Edit your site preferences" %}{% endblock %}

{% block breadcrumbs %}
    {{ block.super }}
    {% breadcrumb_safe 'Users' None %}
    {% breadcrumb request.user.userprofile.get_display_name 'user_page' request.user.username %}
    {% breadcrumb 'Settings' None %}
    {% breadcrumb 'Preferences' None %}
{% endblock %}

{% block content %}
    <div class="row-fluid">
        {% include 'user/profile/edit/navigation.html' %}
        <div class="span9">
            {% if READONLY_MODE %}
                {% include 'readonly_mode.html' %}
            {% else %}
                <form id="profile-edit-preferences-form" class="form-horizontal" method="post"
                      action="{% url 'profile_save_preferences' %}">{% csrf_token %}
                    {{ form|as_bootstrap }}

                    <div class="form-actions">
                        <button class="btn btn-primary btn-block-mobile {% button_loading_class %}" type="submit">
                            {% trans "Save" %}
                            {% button_loading_indicator %}
                        </button>
                    </div>
                </form>
            {% endif %} {# READONLY #}
        </div>
    </div>
{% endblock %}

