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