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