{% extends 'base.html' %}
{% load i18n bootstrap3 %}

{% block breadcrumb %}
    <ol class="breadcrumb">
        <li><span class="glyphicon glyphicon-home"></span></li>
        <li><a href="{% url 'acc_app:accounts_list' %}">{% trans 'Administrators' %}</a></li>
        <li><a href="{% url 'acc_app:other_profile' userprofile.pk %}">{{ userprofile.username }}</a></li>
        <li><a href="{% url 'acc_app:setup_perms_object' userprofile.pk %}">{% trans 'Object permission options' %}</a></li>
        <li><a href="{% url 'acc_app:perms_klasses' userprofile.pk klass %}">&lt;{{ klass }}&gt; {{ klass_name }}</a></li>
        <li class="active">{{ obj }}</li>
    </ol>
{% endblock %}


{% block page-header %}
    {% trans 'Pick object for edit permissions' %}
{% endblock %}


{% block main %}
    {% if userprofile.is_superuser %}
        <div class="alert alert-info alert-dismissable">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
            <span class="glyphicon glyphicon-info-sign"></span>
            {% trans 'Profile is superuser, permissions to change it makes no sense' %}
        </div>
    {% endif %}

    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">{% trans 'Change permission for that object' %}</h3>
        </div>
        <div class="panel-body">

            <form role="form" action="{% url 'acc_app:perms_edit' userprofile.pk klass obj.pk %}" method="post">{% csrf_token %}

            {% bootstrap_form form %}

            <div class="btn-group">
                <button type="submit" class="btn btn-sm btn-primary">
                    <span class="glyphicon glyphicon-save"></span> {% trans 'Save' %}
                </button>
                <button type="reset" class="btn btn-sm btn-default">
                    <span class="glyphicon glyphicon-remove-circle"></span> {% trans 'Reset' %}
                </button>
            </div>
            </form>
        </div>
    </div>
{% endblock %}
