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