tinternet.net/core/Resources/views/user/user_admin/index.html.twig

76 lines
3.1 KiB
Twig
Raw Normal View History

2021-03-23 21:49:56 +01:00
{% extends '@Core/admin/layout.html.twig' %}
2021-03-17 17:17:43 +01:00
2021-04-11 17:15:51 +02:00
{% block title %}{{ 'Users'|trans }} - {{ parent() }}{% endblock %}
2021-03-17 17:17:43 +01:00
{% block body %}
2021-04-11 17:15:51 +02:00
<div class="bg-light pl-5 pr-4 pt-5 {% if pager.paginationData.pageCount < 2 %}pb-5{% endif %}">
2021-03-17 17:17:43 +01:00
<div class="d-flex">
<div class="mr-auto w-50">
2021-03-24 17:09:13 +01:00
<h1 class="display-5">{{ 'Users'|trans }}</h1>
2021-03-17 17:17:43 +01:00
</div>
<div class="ml-auto">
<div class="btn-group">
<a href="{{ path('admin_user_new') }}" class="btn btn-primary">
<span class="fa fa-plus pr-1"></span>
2021-03-24 17:09:13 +01:00
{{ 'New'|trans }}
2021-03-17 17:17:43 +01:00
</a>
</div>
</div>
</div>
{{ knp_pagination_render(pager) }}
</div>
2021-04-21 10:25:34 +02:00
<div class="table-responsive">
<table class="table">
<thead class="thead-light">
<tr>
<th class="col-10 miw-200">{{ 'Username'|trans }}</th>
<th class="col-2 miw-100 text-right">{{ 'Actions'|trans }}</th>
</tr>
</thead>
<tbody>
{% for item in pager %}
{% set edit = path('admin_user_edit', {entity: item.id}) %}
{% set show = path('admin_user_show', {entity: item.id}) %}
2021-03-17 17:17:43 +01:00
2021-04-21 10:25:34 +02:00
<tr data-dblclick="{{ edit }}">
<td class="col-10 miw-200">
<a href="{{ show }}" class="font-weight-bold text-body d-block">
{{ item.displayName }}
</a>
2021-03-17 17:17:43 +01:00
2021-04-21 10:25:34 +02:00
{{ item.email }}
</td>
<td class="col-2 miw-100 text-right">
<a href="{{ edit }}" class="btn btn-sm btn-primary mr-1">
<span class="fa fa-edit"></span>
</a>
<button type="submit" form="form-delete-{{ item.id }}" class="btn btn-sm btn-danger">
<span class="fa fa-trash"></span>
</button>
2021-03-17 17:17:43 +01:00
2021-04-21 10:25:34 +02:00
<form method="post" action="{{ path('admin_user_delete', {entity: item.id}) }}" id="form-delete-{{ item.id }}" data-form-confirm>
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ item.id) }}">
</form>
</td>
</tr>
{% else %}
<tr>
<td class="col-12 text-center p-4 text-black-50">
<div class="display-1">
<span class="fa fa-search"></span>
</div>
<div class="display-5 mt-3">
{{ 'No result'|trans }}
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
2021-03-17 17:17:43 +01:00
{% endblock %}