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