xref: /webtrees/resources/views/admin/users.phtml (revision 4a9a60957058ca2a34e30a0d6f783e1540606590)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
6use Fisharebest\Webtrees\Http\RequestHandlers\UserListData;
7use Fisharebest\Webtrees\I18N;
8use Fisharebest\Webtrees\View;
9
10/**
11 * @var string $filter
12 * @var string $title
13 */
14
15?>
16
17<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), $title]]) ?>
18
19<h1><?= $title ?></h1>
20
21<table class="table table-sm table-bordered table-user-list"
22    <?= view('lists/datatables-attributes') ?>
23>
24    <thead>
25        <tr>
26            <th><?= I18N::translate('Edit') ?></th>
27            <th><!-- user id --></th>
28            <th><?= I18N::translate('Username') ?></th>
29            <th><?= I18N::translate('Real name') ?></th>
30            <th><?= I18N::translate('Email address') ?></th>
31            <th><?= I18N::translate('Language') ?></th>
32            <th><!-- date registered --></th>
33            <th><?= I18N::translate('Date registered') ?></th>
34            <th><!-- last login --></th>
35            <th><?= I18N::translate('Last signed in') ?></th>
36            <th><?= I18N::translate('Verified') ?></th>
37            <th><?= I18N::translate('Approved') ?></th>
38        </tr>
39    </thead>
40    <tbody>
41    </tbody>
42</table>
43
44<?php View::push('javascript') ?>
45<script>
46  $(".table-user-list").dataTable({
47    processing:          true,
48    serverSide:          true,
49    ajax:                {
50      url: "<?= e(route(UserListData::class)) ?>"
51    },
52    autoWidth:           false,
53    sorting:             [[2, "asc"]],
54    columns:             [
55      /* details           */ {sortable: false},
56      /* user-id           */ {visible: false},
57      /* user_name         */ null,
58      /* real_name         */ null,
59      /* email             */ null,
60      /* language          */ null,
61      /* registered (sort) */ {visible: false},
62      /* registered        */ {dataSort: 6},
63      /* last_login (sort) */ {visible: false},
64      /* last_login        */ {dataSort: 8},
65      /* verified          */ null,
66      /* approved          */ null
67    ]
68  }).fnFilter("<?= e($filter) ?>"); // Pre-fill the search box
69</script>
70<?php View::endpush() ?>
71