xref: /webtrees/resources/views/lists/anniversaries-table.phtml (revision d70512ab02636ee884ef6d7907223ed02c754ff5)
1<?php
2
3use Fisharebest\Webtrees\I18N;
4
5?>
6<?php use Fisharebest\Webtrees\Individual; ?>
7<?php use Fisharebest\Webtrees\View; ?>
8
9<table class="table table-sm datatable wt-table-events" data-info="false" data-paging="false" data-searching="false" data-sorting="<?= e('[[1, "asc" ]]') ?>">
10    <thead>
11        <tr>
12            <th>
13                <?= I18N::translate('Record') ?>
14            </th>
15            <th>
16                <?= I18N::translate('Date') ?>
17            </th>
18            <th>
19                <?= view('icons/anniversary') ?>
20                <span class="sr-only"><?= I18N::translate('Anniversary') ?></span>
21            </th>
22            <th>
23                <?= I18N::translate('Event') ?>
24            </th>
25        </tr>
26    </thead>
27    <tbody>
28        <?php foreach ($facts as $fact) : ?>
29            <?php $record = $fact->record(); ?>
30            <tr>
31                <td data-sort="<?= e($record->sortName()) ?>">
32                    <a href="<?= e($record->url()) ?>">
33                        <?= $record->fullName() ?>
34                    </a>
35                    <?php if ($record instanceof Individual) : ?>
36                        <small><?= view('icons/sex', ['sex' => $record->sex()]) ?></small>
37                    <?php endif ?>
38                </td>
39                <td data-sort="<?= $fact->date()->julianDay() ?>">
40                    <?= $fact->date()->display(true) ?>
41                </td>
42                <td data-sort="<?= $fact->anniv ?>">
43                    <?= $fact->anniv ?>
44                </td>
45                <td data-sort="<?= $fact->label() ?>">
46                    <?= $fact->label() ?>
47                </td>
48            </tr>
49        <?php endforeach ?>
50    </tbody>
51</table>
52
53<?php View::push('javascript') ?>
54<script>
55  $(".wt-table-events").dataTable();
56</script>
57<?php View::endpush() ?>
58