This repository has been archived by the owner on Feb 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html.twig
98 lines (95 loc) · 3.45 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{% extends '::base.html.twig' %}
{% block header_title %}
<h2>
{{ 'user.header.index'|trans|capitalize }}
</h2>
{% endblock %}
{% block header_navigation %}
<a class="btn btn-success" href="{{ path('sumo_coders.user.route.add_user') }}">
{{ icon('plus') }}
{{ 'user.actions.add.user'|trans|capitalize }}
</a>
<a class="btn btn-success" href="{{ path('sumo_coders.user.route.add_admin') }}">
{{ icon('plus') }}
{{ 'user.actions.add.admin'|trans|capitalize }}
</a>
{% endblock %}
{% block main %}
<table class="table table-hover">
<thead>
<tr>
<th>{{ 'user.datagrid.email'|trans|capitalize }}</th>
<th>{{ 'user.datagrid.type'|trans|capitalize }}</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr{% if user.isBlocked() %} class="text-muted"{% endif %}>
<td>{{ user.email }}</td>
<td>
{% if user is admin %}
{{ 'user.types.admin'|trans }}
{% else %}
{{ 'user.types.user'|trans }}
{% endif %}
</td>
<td class="action">
{% if not user.isBlocked() and app.user.canSwitchTo(user) %}
{# todo switch route to homepage? #}
<a
href="{{ path('sumocoders_frameworkexample_bootstrap_select2') }}?_switch_user={{ user.username }}"
class="fa fa-refresh confirm"
data-toggle="tooltip"
title="{{ 'user.datagrid.actions.switchTo'|trans }}"
data-message="{{ 'user.dialogs.messages.confirmSwitch'|trans({'%user%': user.username}) }}"
>
<span class="hide">{{ 'user.datagrid.actions.switchTo'|trans }}</span>
</a>
{% endif %}
</td>
<td class="action">
<a
{% if user is admin %}
href="{{ path('sumo_coders.user.route.edit_admin', {'id': user.id}) }}"
{% else %}
href="{{ path('sumo_coders.user.route.edit_user', {'id': user.id}) }}"
{% endif %}
class="fa fa-pencil"
data-toggle="tooltip"
title="{{ 'datagrids.actions.edit'|trans }}"
>
<span class="hide">
{{ 'datagrids.actions.edit'|trans }}
</span>
</a>
</td>
<td class="action">
<a
href="{{ path('sumo_coders.user.route.block', {'id': user.id}) }}"
{% if user.isBlocked() %}
class="fa fa-check confirm" data-toggle="tooltip"
title="{{ 'user.datagrid.actions.unblock'|trans }}"
data-message="{{ 'user.dialogs.messages.confirmUnblock'|trans({'%user%': user.username}) }}"
{% else %}
class="fa fa-ban confirm" data-toggle="tooltip"
title="{{ 'user.datagrid.actions.block'|trans }}"
data-message="{{ 'user.dialogs.messages.confirmBlock'|trans({'%user%': user.username}) }}"
{% endif %}
>
<span class="hide">
{% if user.isBlocked() %}
{{ 'user.datagrid.actions.unblock'|trans }}
{% else %}
{{ 'user.datagrid.actions.block'|trans }}
{% endif %}
</span>
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}