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