1 {% extends "::base.html.twig" %}
3 {% block title %}{{ parent() }}users{% endblock %}
7 <link rel="stylesheet" href="{{ asset('mixstore/css/user/admin.css') }}">
12 {% if is_granted('ROLE_SUPER_ADMIN') %}
16 <h4>Click on a line to toggle privileges. Admins in <span class="blue">blue</span>. Super-admin(s) in <span class="red">red</span></h4>
25 {% for user in users %}
26 <tr id="{{ user.id }}"
27 {% if 'ROLE_SUPER_ADMIN' in user.roles %}
29 {% elseif 'ROLE_ADMIN' in user.roles %}
30 {{ 'class="user blue"' }}
35 <td>{{ user.name }}</td>
36 <td>{{ user.surname }}</td>
37 <td>{{ user.email }}</td>
38 <td><a href="{{ path('mixstore_user_admin_delete', { id: user.id }) }}">Delete</a></td>
49 {% block javascripts %}
52 $( "tr" ).click(function()
54 //do nothing if super-admin is clicked
55 if ($(this).attr('class').indexOf("red") >= 0)
58 //save id for use in AJAX call
59 id = $(this).attr('id');
61 //http://stackoverflow.com/questions/13584591/how-to-integrate-ajax-with-symfony2
63 "{{ path('mixstore_user_admin_toggle') }}",
67 $('#' + id).toggleClass("blue");