{% extends 'base.html.twig' %}
{% block title %}Edit Shop{% endblock %}
{% block body %}
<div class="d-flex justify-content-between">
<h3>{{ shop.name }}</h3>
<a href="{{ path('app_shop_index') }}">{{ "back to list"|trans }}</a>
</div>
{# { include('shop/_delete_form.html.twig') }#}
<h1>{{ "Users"|trans }}</h1>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>{{ knp_pagination_sortable(users, 'Email'|trans, 'u.email') }}</th>
<th>{{ knp_pagination_sortable(users, 'Firstname'|trans, 'u.firstname') }}</th>
<th>{{ knp_pagination_sortable(users, 'Lastname'|trans, 'u.lastname') }}</th>
<th>{{ knp_pagination_sortable(users, 'Company'|trans, 'c.name') }}</th>
<th>{{ "Phone"|trans }}</th>
{% if is_granted('ROLE_SUPER_ADMIN') %}
<th>{{ knp_pagination_sortable(users, 'Shop'|trans, 's.name') }}</th>
<th>Sup Admin</th>
<th>Admin</th>
<th>User</th>
{% endif %}
<th></th>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td>{{ user.email }}</td>
<td>{{ user.firstname }}</td>
<td>{{ user.lastname }}</td>
<td>{{ user.company?user.company:'' }}</td>
<td>{{ user.phone }}</td>
{% if is_granted('ROLE_SUPER_ADMIN') %}
<td>{{ user.shop }}</td>
<td>{% if user.isGranted('ROLE_SUPER_ADMIN') %}<i class="bi bi-check-square"></i>{% endif %}</td>
<td>{% if user.isGranted('ROLE_ADMIN') %}<i class="bi bi-check-square"></i>{% endif %}</td>
<td>{% if user.isGranted('ROLE_USER') %}<i class="bi bi-check-square"></i>{% endif %}</td>
{% endif %}
<td>
<a href="{{ path('app_user_edit', {'id': user.id}) }}">detail</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="6">{{ "no records found"|trans }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="d-flex justify-content-between">
<div class="navigation">
{{ knp_pagination_render(users) }}
</div>
</div>
{% endblock %}