user admin: use flex-table and flex-bloc in twig

This commit is contained in:
nobohan 2022-03-07 11:13:11 +01:00
parent efbd9b0185
commit 9b06ccc3e6

View File

@ -1,60 +1,60 @@
{% extends '@ChillMain/Admin/Permission/layout_crud_permission_index.html.twig' %} {% extends '@ChillMain/Admin/Permission/layout_crud_permission_index.html.twig' %}
{% block admin_content -%} {% block admin_content -%}
{% embed '@ChillMain/CRUD/_index.html.twig' %}
{% block table_entities_thead_tr %} <h1>{{"Users"|trans}}</h1>
<th>{{ 'crud.admin_user.index.is_active'|trans }}</th> {% for entity in entities %}
<th>{{ 'crud.admin_user.index.usernames'|trans }}</th> <div class="flex-table">
<th>{{ 'crud.admin_user.index.mains'|trans }}</th> <div class="item-bloc">
<th>&nbsp;</th> <div class="item-row">
{% endblock %} <div class="item-col">
{% block table_entities_tbody %} {{ entity.label }}
{% for entity in entities %}
<tr data-username="{{ entity.username|e('html_attr') }}">
<td>
{% if entity.isEnabled %} {% if entity.isEnabled %}
<i class="fa fa-check chill-green"></i> <i class="fa fa-check chill-green"></i>
{% else %} {% else %}
<i class="fa fa-times chill-red"></i> <i class="fa fa-times chill-red"></i>
{% endif %} {% endif %}
</td> </div>
<td> <div class="item-col"><i>{{ entity.email }}</i></div>
{{ entity.username }} </div>
<br/> <div class="item-row">
{{ entity.label }} <div class="item-col">
<br/> login: {{ entity.username|e('html_attr') }}
{{ entity.email }} </div>
</td> <div class="item-col">
<td>
{% if entity.userJob %} {% if entity.userJob %}
{{ entity.userJob.label|localize_translatable_string }} {{ entity.userJob.label|localize_translatable_string }}
<br/>
{% endif %} {% endif %}
</div>
</div>
<div class="item-row">
<div class="item-col">
{% if entity.mainScope %} {% if entity.mainScope %}
{{ entity.mainScope.name|localize_translatable_string }} {{ entity.mainScope.name|localize_translatable_string }}
<br/>
{% endif %} {% endif %}
{% if entity.mainCenter %} {% if entity.mainCenter %}
{{ entity.mainCenter.name }} , {{ entity.mainCenter.name }}
{% endif %} {% endif %}
</td> </div>
<td> </div>
<ul class="record_actions"> <div class="item-row">
<ul class="record_actions">
<li>
<a class="btn btn-edit" href="{{ path('chill_crud_admin_user_edit', { 'id': entity.id }) }}"></a>
</li>
<li>
<a class="btn btn-chill-red" href="{{ path('admin_user_edit_password', { 'id' : entity.id }) }}" title="{{ 'Edit password'|trans|e('html_attr') }}"><i class="fa fa-ellipsis-h"></i></a>
</li>
{% if is_granted('ROLE_ALLOWED_TO_SWITCH') %}
<li> <li>
<a class="btn btn-edit" href="{{ path('chill_crud_admin_user_edit', { 'id': entity.id }) }}"></a> <a class="btn btn-chill-blue" href="{{ path('chill_main_homepage', {'_switch_user': entity.username }) }}" title="{{ "Impersonate"|trans|e('html_attr') }}"><i class="fa fa-user-secret"></i></a>
</li> </li>
<li> {% endif %}
<a class="btn btn-chill-red" href="{{ path('admin_user_edit_password', { 'id' : entity.id }) }}" title="{{ 'Edit password'|trans|e('html_attr') }}"><i class="fa fa-ellipsis-h"></i></a> </ul>
</li> </div>
{% if is_granted('ROLE_ALLOWED_TO_SWITCH') %} </div>
<li>
<a class="btn btn-chill-blue" href="{{ path('chill_main_homepage', {'_switch_user': entity.username }) }}" title="{{ "Impersonate"|trans|e('html_attr') }}"><i class="fa fa-user-secret"></i></a> </div>
</li> {% endfor %}
{% endif %}
</ul> {% endblock %}
</td>
</tr>
{% endfor %}
{% endblock %}
{% endembed %}
{% endblock %}