{% extends "base.html" %}
{% load i18n %}

{% block head %}
    <link rel="stylesheet" href="{{ STATIC_URL }}trainings/css/django-admin-widgets.css" type="text/css" media="screen" charset="utf-8" />

    <script type="text/javascript" src="{{ STATIC_URL }}trainings/js/django-admin.multiselect.js"></script>
    <script type="text/javascript">
        $(function(){
            jQuery.each($("select[multiple]"), function () {
                // "Groups" can be any label you want
                SelectFilter.init(this.id, "{% trans 'Group' %}", 0, "/static/admin/");
            });
        });
    </script>
{% endblock %}

{% block subtitle %}
    {% if newuser %}
        {% trans 'Edit user' %} {{newuser}}
    {% else %}
        {% trans 'Add user' %}
    {% endif %}
{% endblock %}

{% block actions %}
    <a class="btn btn-primary" href="{% url 'accounts:user-list' %}">
        {% trans 'Back' %}
    </a>
{% endblock %}

{% block main %}
    <form action="" method="post">{% csrf_token %}
        <div class="panel panel-default">
            <table class="table table-bordered">
                {% include 'extras/form.html' %}
            </table>
            <div class="panel-footer clearfix">
                <div class="pull-right">
                    <input class="btn btn-default" type="submit" value="{% trans 'Save and add another' %}" name="_addanother"/>
                    <input class="btn btn-primary" type="submit" value="{% trans 'Save' %}" name="_save"/>
                </div>
            </div>
        </div>
    </form>
{% endblock %}
