-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html.twig
63 lines (59 loc) · 1.99 KB
/
index.html.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{% extends 'base.html.twig' %}
{% block subtitle %}{{ 'List users'|trans }}{% endblock %}
{% block content_container %}
{% include 'widgets/breadcrumb.html.twig' with {items: [
{label: 'User'|trans, path: path('user_index')},
]} %}
{% embed 'widgets/content-navbar.html.twig' with { title: block('subtitle') } %}
{% block nav_items %}
{% if is_granted('ROLE_ALLOWED_TO_EDIT_USER') %}
<li class="nav-item">
<a href="{{ path('user_new') }}" class="nav-link">{{ 'Add'|trans }}</a>
</li>
{% endif %}
{% endblock %}
{% endembed %}
<div class="table-responsive">
<table class="table table-sm table-hover">
<thead>
<tr>
<th>{{ 'Id'|trans }}</th>
<th>{{ 'Email'|trans }}</th>
<th>{{ 'Roles'|trans }}</th>
<th>{{ 'Display name'|trans }}</th>
<th>{{ 'Last logged in at'|trans }}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td>{{ user.id }}</td>
<td>{{ user.email }}</td>
<td>
{% for role in user.roles %}
{% if role == 'ROLE_USER' %}
<span class="badge badge-secondary">{{ 'ROLE_ALLOWED_TO_VIEW'|trans }}</span>
{% else %}
<span class="badge badge-secondary">{{ role|trans }}</span>
{% endif %}
{% endfor %}
</td>
<td>{{ user.displayName }}</td>
<td>{{ user.lastLoggedInAt|date('Y/m/d H:i:s') }}</td>
<td>
<a href="{{ path('user_show', {id: user.id}) }}">{{ 'Show'|trans }}</a>
{% if is_granted('ROLE_ALLOWED_TO_EDIT_USER') %}
<a href="{{ path('user_edit', {id: user.id}) }}" class="ml-sm-3">{{ 'Edit'|trans }}</a>
{% endif %}
</td>
</tr>
{% else %}
<tr>
<td colspan="100" class="text-muted">{{ 'No data.'|trans }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}