2021-09-02 18:34:25 +02:00
|
|
|
<?= $this->extend('_layout') ?>
|
2020-07-10 14:20:25 +02:00
|
|
|
|
2020-07-16 12:08:23 +02:00
|
|
|
<?= $this->section('title') ?>
|
2020-10-02 17:38:16 +02:00
|
|
|
<?= lang('User.all_users') ?>
|
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|
|
|
|
<?= $this->section('pageTitle') ?>
|
2020-08-04 13:25:22 +02:00
|
|
|
<?= lang('User.all_users') ?> (<?= count($users) ?>)
|
2020-07-16 12:08:23 +02:00
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|
2020-10-02 17:38:16 +02:00
|
|
|
<?= $this->section('headerRight') ?>
|
2021-09-21 17:51:04 +02:00
|
|
|
<Button uri="<?= route_to('user-create') ?>" variant="primary" iconLeft="user-add"><?= lang('User.create') ?></Button>
|
2020-10-02 17:38:16 +02:00
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|
2020-07-16 12:08:23 +02:00
|
|
|
|
2020-07-10 14:20:25 +02:00
|
|
|
<?= $this->section('content') ?>
|
|
|
|
|
2020-10-02 17:38:16 +02:00
|
|
|
<?= data_table(
|
|
|
|
[
|
|
|
|
[
|
|
|
|
'header' => lang('User.list.user'),
|
2023-06-12 16:47:38 +02:00
|
|
|
'cell' => function ($user) {
|
2020-10-02 17:38:16 +02:00
|
|
|
return '<div class="flex flex-col">' .
|
2022-03-04 15:33:48 +01:00
|
|
|
esc($user->username) .
|
2021-11-05 15:36:34 +01:00
|
|
|
'<span class="text-sm text-skin-muted">' .
|
2020-10-02 17:38:16 +02:00
|
|
|
$user->email .
|
|
|
|
'</span></div>';
|
|
|
|
},
|
|
|
|
],
|
|
|
|
[
|
2022-10-15 13:22:08 +02:00
|
|
|
'header' => lang('User.list.role'),
|
2023-06-12 16:47:38 +02:00
|
|
|
'cell' => function ($user) {
|
2022-10-15 13:22:08 +02:00
|
|
|
$role = get_group_info(get_instance_group($user))['title'];
|
|
|
|
|
|
|
|
if ((bool) $user->is_owner) {
|
|
|
|
$role = '<div class="inline-flex items-center"><span class="mr-2 focus:ring-accent" tabindex="0" data-tooltip="bottom" title="' . lang('Auth.instance_groups.owner.title') . '">' . icon('shield-user') . '</span>' . $role . '</div>';
|
2022-09-07 11:33:10 +02:00
|
|
|
}
|
|
|
|
|
2022-10-15 13:22:08 +02:00
|
|
|
return $role . '<IconButton uri="' . route_to('user-edit', $user->id) . '" glyph="edit" variant="info">' . lang('User.edit_role', [
|
2022-09-07 11:33:10 +02:00
|
|
|
'username' => esc($user->username),
|
|
|
|
]) . '</IconButton>';
|
2020-10-02 17:38:16 +02:00
|
|
|
},
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'header' => lang('Common.actions'),
|
2023-06-12 16:47:38 +02:00
|
|
|
'cell' => function ($user) {
|
2021-11-05 15:36:34 +01:00
|
|
|
return '<button id="more-dropdown-' . $user->id . '" type="button" class="inline-flex items-center p-1 focus:ring-accent" data-dropdown="button" data-dropdown-target="more-dropdown-' . $user->id . '-menu" aria-haspopup="true" aria-expanded="false">' . icon('more') . '</button>' .
|
2021-10-18 18:44:07 +02:00
|
|
|
'<DropdownMenu id="more-dropdown-' . $user->id . '-menu" labelledby="more-dropdown-' . $user->id . '" items="' . esc(json_encode([
|
|
|
|
[
|
2023-06-12 16:47:38 +02:00
|
|
|
'type' => 'link',
|
2021-10-18 18:44:07 +02:00
|
|
|
'title' => lang('User.delete'),
|
2023-06-12 16:47:38 +02:00
|
|
|
'uri' => route_to('user-delete', $user->id),
|
2021-10-18 18:44:07 +02:00
|
|
|
'class' => 'font-semibold text-red-600',
|
|
|
|
],
|
|
|
|
])) . '" />';
|
2020-10-02 17:38:16 +02:00
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
2021-05-06 16:00:48 +02:00
|
|
|
$users,
|
2020-10-02 17:38:16 +02:00
|
|
|
) ?>
|
2020-07-10 14:20:25 +02:00
|
|
|
|
2020-10-22 19:41:59 +02:00
|
|
|
<?= $this->endSection() ?>
|