mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
some finalisation for admin user
This commit is contained in:
parent
72b1916da8
commit
430177f0c7
@ -4,6 +4,7 @@ namespace Chill\MainBundle\Controller;
|
|||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\AbstractCRUDController;
|
use Chill\MainBundle\CRUD\Controller\AbstractCRUDController;
|
||||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||||
|
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Symfony\Component\Form\FormInterface;
|
use Symfony\Component\Form\FormInterface;
|
||||||
@ -84,26 +85,13 @@ class UserController extends CRUDController
|
|||||||
parent::onPrePersist($action, $entity, $form, $request);
|
parent::onPrePersist($action, $entity, $form, $request);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||||
* Finds and displays a User entity.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public function showAction($id)
|
|
||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$query->addOrderBy('e.usernameCanonical', 'ASC');
|
||||||
|
|
||||||
$user = $em->getRepository('ChillMainBundle:User')->find($id);
|
return parent::orderQuery($action, $query, $request, $paginator);
|
||||||
|
|
||||||
if (!$user) {
|
|
||||||
throw $this->createNotFoundException('Unable to find User entity.');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->render('@ChillMain/User/show.html.twig', array(
|
|
||||||
'entity' => $user,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function generateTemplateParameter(string $action, $entity, Request $request, array $defaultTemplateParameters = [])
|
protected function generateTemplateParameter(string $action, $entity, Request $request, array $defaultTemplateParameters = [])
|
||||||
{
|
{
|
||||||
// add mini-forms for edit action
|
// add mini-forms for edit action
|
||||||
|
@ -297,7 +297,7 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
|
|||||||
'class' => User::class,
|
'class' => User::class,
|
||||||
'controller' => UserController::class,
|
'controller' => UserController::class,
|
||||||
'name' => 'admin_user',
|
'name' => 'admin_user',
|
||||||
'base_path' => '/admin/main/user2',
|
'base_path' => '/admin/main/user',
|
||||||
'base_role' => 'ROLE_ADMIN',
|
'base_role' => 'ROLE_ADMIN',
|
||||||
'form_class' => UserType::class,
|
'form_class' => UserType::class,
|
||||||
'actions' => [
|
'actions' => [
|
||||||
|
@ -51,5 +51,6 @@
|
|||||||
{{ form_end(add_groupcenter_form) }}
|
{{ form_end(add_groupcenter_form) }}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||||
{% endembed %}
|
{% endembed %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
{% block admin_content -%}
|
{% block admin_content -%}
|
||||||
{% embed '@ChillMain/CRUD/_index.html.twig' %}
|
{% embed '@ChillMain/CRUD/_index.html.twig' %}
|
||||||
{% block table_entites_thead_tr %}
|
{% block table_entities_thead_tr %}
|
||||||
<th>{{ 'crud.admin_user.index.is_active'|trans }}</th>
|
<th>{{ 'crud.admin_user.index.is_active'|trans }}</th>
|
||||||
<th>{{ 'crud.admin_user.index.usernames'|trans }}</th>
|
<th>{{ 'crud.admin_user.index.usernames'|trans }}</th>
|
||||||
<th>{{ 'crud.admin_user.index.mains'|trans }}</th>
|
<th>{{ 'crud.admin_user.index.mains'|trans }}</th>
|
||||||
@ -44,7 +44,7 @@
|
|||||||
<a class="btn btn-edit" href="{{ path('chill_crud_admin_user_edit', { 'id': entity.id }) }}"></a>
|
<a class="btn btn-edit" href="{{ path('chill_crud_admin_user_edit', { 'id': entity.id }) }}"></a>
|
||||||
</li>
|
</li>
|
||||||
<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-asterisk"></i><i class="fa fa-asterisk"></i><i class="fa fa-asterisk"></i></a>
|
<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>
|
</li>
|
||||||
{% if is_granted('ROLE_ALLOWED_TO_SWITCH') %}
|
{% if is_granted('ROLE_ALLOWED_TO_SWITCH') %}
|
||||||
<li>
|
<li>
|
||||||
@ -53,7 +53,6 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -23,7 +23,7 @@ class PermissionMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilde
|
|||||||
'order' => 300
|
'order' => 300
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$menu->addChild('List users', [
|
$menu->addChild('crud.admin_user.index.title', [
|
||||||
'route' => 'chill_crud_admin_user_index'
|
'route' => 'chill_crud_admin_user_index'
|
||||||
])->setExtras(['order' => 400]);
|
])->setExtras(['order' => 400]);
|
||||||
|
|
||||||
|
@ -6,10 +6,6 @@ chill_main_admin_permissionsgroup:
|
|||||||
resource: "@ChillMainBundle/config/routes/permissionsgroup.yaml"
|
resource: "@ChillMainBundle/config/routes/permissionsgroup.yaml"
|
||||||
prefix: "{_locale}/admin/permissionsgroup"
|
prefix: "{_locale}/admin/permissionsgroup"
|
||||||
|
|
||||||
chill_main_admin_user:
|
|
||||||
resource: "@ChillMainBundle/config/routes/user.yaml"
|
|
||||||
prefix: "{_locale}/admin/user"
|
|
||||||
|
|
||||||
chill_main_admin_scope:
|
chill_main_admin_scope:
|
||||||
resource: "@ChillMainBundle/config/routes/scope.yaml"
|
resource: "@ChillMainBundle/config/routes/scope.yaml"
|
||||||
prefix: "{_locale}/admin/scope"
|
prefix: "{_locale}/admin/scope"
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
#admin_user:
|
|
||||||
# path: /
|
|
||||||
# controller: Chill\MainBundle\Controller\UserController::indexAction
|
|
||||||
#
|
|
||||||
#admin_user_show:
|
|
||||||
# path: /{id}/show
|
|
||||||
# controller: Chill\MainBundle\Controller\UserController::showAction
|
|
||||||
#
|
|
||||||
#admin_user_new:
|
|
||||||
# path: /new
|
|
||||||
# controller: Chill\MainBundle\Controller\UserController::newAction
|
|
||||||
#
|
|
||||||
#admin_user_create:
|
|
||||||
# path: /create
|
|
||||||
# controller: Chill\MainBundle\Controller\UserController::createAction
|
|
||||||
# methods: POST
|
|
||||||
#
|
|
||||||
#admin_user_edit:
|
|
||||||
# path: /{id}/edit
|
|
||||||
# controller: Chill\MainBundle\Controller\UserController::editAction
|
|
||||||
#
|
|
||||||
#admin_user_edit_password:
|
|
||||||
# path: /{id}/edit_password
|
|
||||||
# controller: Chill\MainBundle\Controller\UserController::editPasswordAction
|
|
||||||
#
|
|
||||||
#admin_user_update:
|
|
||||||
# path: /{id}/update
|
|
||||||
# controller: Chill\MainBundle\Controller\UserController::updateAction
|
|
||||||
# methods: [POST, PUT]
|
|
||||||
#
|
|
||||||
#admin_user_update_password:
|
|
||||||
# path: /{id}/update_password
|
|
||||||
# controller: Chill\MainBundle\Controller\UserController::updatePasswordAction
|
|
||||||
# methods: [POST, PUT]
|
|
||||||
#
|
|
||||||
#admin_user_delete_group_center:
|
|
||||||
# path: /{uid}/delete_link_groupcenter/{gcid}
|
|
||||||
# controller: Chill\MainBundle\Controller\UserController::deleteLinkGroupCenterAction
|
|
||||||
# methods: [DELETE]
|
|
||||||
#
|
|
||||||
#admin_user_add_group_center:
|
|
||||||
# path: /{uid}/add_link_groupcenter
|
|
||||||
# controller: Chill\MainBundle\Controller\UserController::addLinkGroupCenterAction
|
|
||||||
# methods: [POST]
|
|
@ -143,10 +143,8 @@ The role '%role%' has been removed: Le rôle "%role%" a été enlevé de ce grou
|
|||||||
The role '%role%' on circle '%scope%' has been removed: Le rôle "%role%" sur le cercle "%scope%" a été enlevé de ce groupe de permission
|
The role '%role%' on circle '%scope%' has been removed: Le rôle "%role%" sur le cercle "%scope%" a été enlevé de ce groupe de permission
|
||||||
|
|
||||||
#admin section for users
|
#admin section for users
|
||||||
List users: Liste des utilisateurs
|
|
||||||
user list: Liste des utilisateurs
|
user list: Liste des utilisateurs
|
||||||
User edit: Modification d'un utilisateur
|
User edit: Modification d'un utilisateur
|
||||||
User creation: Créer un utilisateur
|
|
||||||
User'status: Statut de l'utilisateur
|
User'status: Statut de l'utilisateur
|
||||||
Disabled, the user is not allowed to login: Désactivé, l'utilisateur n'est pas autorisé à se connecter
|
Disabled, the user is not allowed to login: Désactivé, l'utilisateur n'est pas autorisé à se connecter
|
||||||
Enabled, the user is active: Actif, l'utilisateur peut se connecter
|
Enabled, the user is active: Actif, l'utilisateur peut se connecter
|
||||||
@ -281,6 +279,16 @@ crud:
|
|||||||
success: Les données ont été enregistrées
|
success: Les données ont été enregistrées
|
||||||
view:
|
view:
|
||||||
link_duplicate: Dupliquer
|
link_duplicate: Dupliquer
|
||||||
|
## admin for users
|
||||||
|
admin_user:
|
||||||
|
index:
|
||||||
|
title: Utilisateurs
|
||||||
|
add_new: "Créer"
|
||||||
|
is_active: "Actif ?"
|
||||||
|
usernames: "Identifiants"
|
||||||
|
mains: "Champs principaux"
|
||||||
|
title_new: "Nouvel utilisateur"
|
||||||
|
title_edit: Modifier un utilisateur
|
||||||
No entities: Aucun élément
|
No entities: Aucun élément
|
||||||
|
|
||||||
CHILL_FOO_SEE: Voir un élément
|
CHILL_FOO_SEE: Voir un élément
|
||||||
|
Loading…
x
Reference in New Issue
Block a user