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