{% extends "authentic2/manager/base.html" %}
{% load i18n staticfiles django_tables2 %}

{% block breadcrumb %}
  {{ block.super }}
  <a href="{% url 'a2-manager-users' %}">{% trans 'Users' %}</a>
  <a href="{% url 'a2-manager-user-detail' pk=object.pk %}">{{ object.get_full_name }}</a>
  <a href="#">{% trans "Roles" %}</a>
{% endblock %}

{% block page_title %}
{% trans "Edit User Roles" %}
{% endblock %}

{% block extrascripts %}
  {{ block.super }}
  <script>
  $(function () {
    $('.indeterminate').each(function (i, elem) {
       elem.indeterminate = true;
    })
  })
  </script>
{% endblock %}

{% block sidebar %}
  <aside id="sidebar">
    {% include "authentic2/manager/search_form.html" %}
  </aside>
{% endblock %}

{% block main %}
 {% with row_link=1 url_name="a2-manager-role-members" %}
   {% render_table table "authentic2/manager/user_roles_table.html" %}
 {% endwith %}

 {% if view.can_change %}
   <form method="post" class="manager-m2m-add-form">
           {% csrf_token %}
           {{ form }}
           <button>{% trans "Add" %}</button>
   </form>
 {% endif %}
{% endblock %}
