xref: /webtrees/resources/views/modules/recent_changes/changes-table.phtml (revision f1d723354d7de5d20a8e2996ee1fe0d3217955e5)
1<?php use Fisharebest\Webtrees\I18N; ?>
2<?php use Fisharebest\Webtrees\View; ?>
3
4<table class="table table-sm datatables wt-table-changes" data-filter="false" data-info="false" data-paging="false">
5    <thead>
6        <tr>
7            <th>
8                <span class="sr-only">
9                    <?= I18N::translate('Type') ?>
10                </span>
11            </th>
12            <th>
13                <?= I18N::translate('Record') ?>
14            </th>
15            <th>
16                <?= I18N::translate('Last change') ?>
17            </th>
18            <?php if ($show_user) : ?>
19                <th>
20                    <?= I18N::translate('User') ?>
21                </th>
22            <?php endif ?>
23        </tr>
24    </thead>
25    <tbody>
26        <?php foreach ($records as $record) : ?>
27            <tr>
28                <td data-sort="<?= $record::RECORD_TYPE ?>" class="text-centre">
29                    <?php if ($record::RECORD_TYPE === 'INDI') : ?>
30                        <?= view('icons/individual') ?>
31                        <span class="sr-only"><?= I18N::translate('Individual') ?></span>
32                    <?php elseif ($record::RECORD_TYPE === 'FAM') : ?>
33                        <?= view('icons/family') ?>
34                        <span class="sr-only"><?= I18N::translate('Family') ?></span>
35                    <?php elseif ($record::RECORD_TYPE === 'OBJE') : ?>
36                        <?= view('icons/media') ?>
37                        <span class="sr-only"><?= I18N::translate('Media') ?></span>
38                    <?php elseif ($record::RECORD_TYPE === 'NOTE') : ?>
39                        <?= view('icons/note') ?>
40                        <span class="sr-only"><?= I18N::translate('Note') ?></span>
41                    <?php elseif ($record::RECORD_TYPE === 'SOUR') : ?>
42                        <?= view('icons/source') ?>
43                        <span class="sr-only"><?= I18N::translate('Source') ?></span>
44                    <?php elseif ($record::RECORD_TYPE === 'SUBM') : ?>
45                        <?= view('icons/submitter') ?>
46                        <span class="sr-only"><?= I18N::translate('Submitter') ?></span>
47                    <?php elseif ($record::RECORD_TYPE === 'REPO') : ?>
48                        <?= view('icons/repository') ?>
49                        <span class="sr-only"><?= I18N::translate('Repository') ?></span>
50                    <?php endif ?>
51                </td>
52
53                <td data-sort="<?= e($record->sortName()) ?>">
54                    <a href="<?= e($record->url()) ?>"><?= $record->fullName() ?></a>
55                </td>
56
57                <td data-sort="<?= $record->lastChangeTimestamp()->unix() ?>">
58                    <?= view('components/datetime', ['timestamp' => $record->lastChangeTimestamp()]) ?>
59                </td>
60
61                <?php if ($show_user) : ?>
62                    <td>
63                        <?= e($record->lastChangeUser()) ?>
64                    </td>
65                <?php endif ?>
66            </tr>
67        <?php endforeach ?>
68    </tbody>
69</table>
70
71<?php View::push('javascript') ?>
72<script>
73  $(".wt-table-changes").dataTable();
74</script>
75<?php View::endpush() ?>
76