xref: /webtrees/resources/views/lists/anniversaries-table.phtml (revision 0999990b36236eec02be2ee4f380b67733f7bb38)
1d70512abSGreg Roach<?php
2d70512abSGreg Roach
3cd51dbdfSGreg Roachuse Fisharebest\Webtrees\Fact;
4d70512abSGreg Roachuse Fisharebest\Webtrees\I18N;
5cd51dbdfSGreg Roachuse Fisharebest\Webtrees\Individual;
6cd51dbdfSGreg Roachuse Fisharebest\Webtrees\View;
7cd51dbdfSGreg Roachuse Illuminate\Support\Collection;
8d70512abSGreg Roach
942a132ddSGreg Roach/**
10cd51dbdfSGreg Roach * @var Collection<Fact> $facts
1101221f27SGreg Roach * @var int              $limit_high
1201221f27SGreg Roach * @var int              $limit_low
13*0999990bSGreg Roach * @var array<mixed>     $order
1442a132ddSGreg Roach */
1542a132ddSGreg Roach
16d70512abSGreg Roach?>
1748f08416SGreg Roach
1842a132ddSGreg Roach<div class="table-responsive">
19e24053e5SGreg Roach    <table
20e24053e5SGreg Roach        class="table table-sm datatable wt-table-events"
21e24053e5SGreg Roach        <?= view('lists/datatables-attributes') ?>
2201221f27SGreg Roach        <?php if ($facts->count() < e($limit_high)) : ?>
23e24053e5SGreg Roach            data-paging="false"
24e24053e5SGreg Roach        <?php endif ?>
25e24053e5SGreg Roach        data-filter="false"
26e24053e5SGreg Roach        data-info="false"
27e24053e5SGreg Roach        data-length-change="false"
2801221f27SGreg Roach        data-page-length="<?= e($limit_low) ?>"
29*0999990bSGreg Roach        data-order="<?= e(json_encode($order ?? [])) ?>"
30e24053e5SGreg Roach    >
3148f08416SGreg Roach        <thead>
3248f08416SGreg Roach            <tr>
3348f08416SGreg Roach                <th>
3448f08416SGreg Roach                    <?= I18N::translate('Record') ?>
3548f08416SGreg Roach                </th>
3648f08416SGreg Roach                <th>
3748f08416SGreg Roach                    <?= I18N::translate('Date') ?>
3848f08416SGreg Roach                </th>
3948f08416SGreg Roach                <th>
4048f08416SGreg Roach                    <?= view('icons/anniversary') ?>
4148f08416SGreg Roach                    <span class="sr-only"><?= I18N::translate('Anniversary') ?></span>
4248f08416SGreg Roach                </th>
4348f08416SGreg Roach                <th>
4448f08416SGreg Roach                    <?= I18N::translate('Event') ?>
4548f08416SGreg Roach                </th>
4648f08416SGreg Roach            </tr>
4748f08416SGreg Roach        </thead>
4848f08416SGreg Roach        <tbody>
4948f08416SGreg Roach            <?php foreach ($facts as $fact) : ?>
5048f08416SGreg Roach                <?php $record = $fact->record(); ?>
5148f08416SGreg Roach                <tr>
5248f08416SGreg Roach                    <td data-sort="<?= e($record->sortName()) ?>">
5348f08416SGreg Roach                        <a href="<?= e($record->url()) ?>">
5448f08416SGreg Roach                            <?= $record->fullName() ?>
5548f08416SGreg Roach                        </a>
5648f08416SGreg Roach                        <?php if ($record instanceof Individual) : ?>
5708362db4SGreg Roach                            <small><?= view('icons/sex', ['sex' => $record->sex()]) ?></small>
5848f08416SGreg Roach                        <?php endif ?>
5948f08416SGreg Roach                    </td>
60cd51dbdfSGreg Roach                    <td data-sort="<?= $fact->jd ?>">
6139c990acSGreg Roach                        <?= $fact->date()->display(true) ?>
6248f08416SGreg Roach                    </td>
6348f08416SGreg Roach                    <td data-sort="<?= $fact->anniv ?>">
6448f08416SGreg Roach                        <?= $fact->anniv ?>
6548f08416SGreg Roach                    </td>
6648f08416SGreg Roach                    <td data-sort="<?= $fact->label() ?>">
6748f08416SGreg Roach                        <?= $fact->label() ?>
6848f08416SGreg Roach                    </td>
6948f08416SGreg Roach                </tr>
7048f08416SGreg Roach            <?php endforeach ?>
7148f08416SGreg Roach        </tbody>
7248f08416SGreg Roach    </table>
7342a132ddSGreg Roach</div>
7448f08416SGreg Roach
7548f08416SGreg Roach<?php View::push('javascript') ?>
7648f08416SGreg Roach<script>
7748f08416SGreg Roach  $(".wt-table-events").dataTable();
7848f08416SGreg Roach</script>
7948f08416SGreg Roach<?php View::endpush() ?>
80