fix-admin and crudify user admin

This commit is contained in:
2021-09-22 18:18:49 +02:00
parent f93c2d8d32
commit b5c2dd7bd2
21 changed files with 247 additions and 185 deletions

View File

@@ -0,0 +1,8 @@
{% extends '@ChillMain/Admin/layout_permissions.html.twig' %}
{% block title %}{{ ('crud.' ~ crud_name ~ '.index.title')|trans({'%crud_name%': crud_name}) }}{% endblock %}
{% block content %}
{% embed '@ChillMain/CRUD/_index.html.twig' %}
{% endembed %}
{% endblock content %}

View File

@@ -1,17 +1,15 @@
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
{% block vertical_menu_content %}
{% endblock %}
{% block admin_content %}
<h1>{{ 'Administration interface'|trans }}</h1>
{{ 'welcome_message_raw'|trans|raw }}
<div>
<h2>{{ 'Configuration alerts'|trans }}</h2>
<p>{{ 'Here you can check the configuration of your instance.'|trans }}</p>
{{ chill_widget('configuration_warnings', {}) }}
</div>
{% endblock %}
<p>{{ 'Welcome to the admin section !'|trans }}</p>
{{ chill_menu('admin_index', {
'layout': '@ChillMain/Admin/menu_admin_index.html.twig'
}) }}
{% endblock %}

View File

@@ -1,37 +1,14 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{#
The layout of the admin section. All the page / template of the admin section must use this
layout.
#}
{% extends "@ChillMain/layoutWithVerticalMenu.html.twig" %}
{% block navigation_search_bar %}{% endblock %}
{% block navigation_section_menu %}
{{ chill_menu('admin_section', {
'layout': '@ChillMain/Menu/adminSection.html.twig',
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
}) }}
{% endblock %}
{% block layout_wvm_content %}
{% block admin_content %}<!-- block personcontent empty -->
<h2>{{ 'Welcome to the admin section !'|trans }}</h2>
{% block admin_content %}
<!-- block admin content emty -->
{% endblock %}
{% endblock %}
{% endblock %}

View File

@@ -1,5 +1,5 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
@@ -20,7 +20,7 @@
{% block vertical_menu_content %}
{{ chill_menu('admin_permissions', {
'layout': '@ChillMain/Menu/admin_permissions.html.twig',
'layout': '@ChillMain/Admin/menu_admin_permissions.html.twig',
}) }}
{% endblock %}
@@ -28,4 +28,4 @@
{% block admin_content %}<!-- block personcontent empty -->
<h1>{{ 'Permissions management of your chill installation' |trans }}</h1>
{% endblock %}
{% endblock %}
{% endblock %}

View File

@@ -0,0 +1,18 @@
<div class="{{ 'menu-' ~ menus.name }}">
<ul>
{% for menu in menus %}
<li>
<a class=""
href="{{ menu.uri }}">
<h3>{{ menu.label|trans }}</h3>
{% if menu.extras.explain is defined %}
<div class="" >
{{ menu.extras.explain|trans }}
</div>
{% endif %}
</a>
</li>
{% endfor %}
</ul>
</div>

View File

@@ -1,5 +1,5 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
@@ -17,7 +17,7 @@
#}
{#
Layout for a vertical menu (like admin, export) to use with the
Layout for a vertical menu (like admin, export) to use with the
layout ../layoutWithVerticalMenu.html.twig.
#}
@@ -25,13 +25,9 @@
<li class="title">
{% block v_menu_title %}<!-- title of the verticalMenu is empty -->{% endblock %}
</li>
{% for route in routes %}
<li class="{% apply spaceless %}
{% if route.key == activeRouteKey %}
active
{% endif %}
{% endapply %} ">
<a href="{{ path(route.key, args ) }}" >{{ route.label|trans }}</a>
{% for menu in menus %}
<li class="{% if menu is knp_menu_current %}current {% endif %}">
<a href="{{ menu.uri }}" >{{ menu.label|trans }}</a>
</li>
{% endfor %}
</ul>
</ul>

View File

@@ -1,9 +1,66 @@
{% extends '@ChillMain/Admin/layout_permissions.html.twig' %}
{% block title %}{{ 'user list'|trans|capitalize }}{% endblock %}
{% extends '@ChillMain/Admin/Permission/layout_crud_permission_index.html.twig' %}
{% block admin_content -%}
<h1>{{ 'user list'|trans|capitalize }}</h1>
{% embed '@ChillMain/CRUD/_index.html.twig' %}
{% block table_entites_thead_tr %}
<th>{{ 'crud.admin_user.index.is_active'|trans }}</th>
<th>{{ 'crud.admin_user.index.usernames'|trans }}</th>
<th>{{ 'crud.admin_user.index.mains'|trans }}</th>
<th>&nbsp;</th>
{% endblock %}
{% block table_entities_tbody %}
{% for entity in entities %}
<tr>
<td>
{% if entity.isEnabled %}
<i class="fa fa-check chill-green"></i>
{% else %}
<i class="fa fa-times chill-red"></i>
{% endif %}
</td>
<td>
{{ entity.username }}
<br/>
{{ entity.label }}
<br/>
{{ entity.email }}
</td>
<td>
{% if entity.userJob %}
{{ entity.userJob.label|localize_translatable_string }}
<br/>
{% endif %}
{% if entity.mainScope %}
{{ entity.mainScope.name|localize_translatable_string }}
<br/>
{% endif %}
{% if entity.mainCenter %}
{{ entity.mainCenter.name }}
{% endif %}
</td>
<td>
<ul class="record_actions">
<li>
<a class="btn btn-edit" href="{{ path('admin_user_edit', { 'id': entity.id }) }}"></a>
</li>
<li>
<a class="btn btn-edit chill-red" href="{{ path('admin_user_edit_password', { 'id' : entity.id }) }}">{{ 'Edit password'|trans }}</a>
</li>
{% if is_granted('ROLE_ALLOWED_TO_SWITCH') %}
<li>
<a class="btn chill-blue" href="{{ path('chill_main_homepage', {'_switch_user': entity.username }) }}" title="{{ "Impersonate"|trans|e('html_attr') }}"><i class="fa fa-universal-access"></i></a>
</li>
{% endif %}
</ul>
</td>
</tr>
{% endfor %}
{% endblock %}
{% endembed %}
{% endblock %}
{#
<table class="records_list">
<thead>
@@ -51,3 +108,5 @@
</ul>
{% endblock admin_content %}
#}