xref: /webtrees/resources/views/lists/anniversaries-list.phtml (revision a1fa78f3cc9422045943b25684e91929d56a8016)
1<?php
2
3use Fisharebest\Webtrees\Carbon;
4use Fisharebest\Webtrees\Fact;
5use Fisharebest\Webtrees\Individual;
6use Illuminate\Support\Collection;
7
8/**
9 * @var Collection<Fact> $facts
10 */
11
12?>
13
14<?php foreach ($facts as $fact) : ?>
15    <?php $record = $fact->record(); ?>
16    <a href="<?= e($record->url()) ?>" class="list_item name2">
17        <?= $record->fullName() ?>
18    </a>
19    <?php if ($record instanceof Individual) : ?>
20        <?= view('icons/sex', ['sex' => $record->sex()]) ?>
21    <?php endif ?>
22    <div class="indent">
23        <?= $fact->label() . ' — ' . $fact->date()->display(true) ?>
24        (<?= Carbon::now()->subYears($fact->anniv)->local()->diffForHumans() ?>)
25        <?php if ($fact->place()->gedcomName() !== '') : ?>
26            — <a href="<?= e($fact->place()->url()) ?>" title="<?= strip_tags($fact->place()->fullName()) ?>">
27                <?= $fact->place()->shortName() ?>
28            </a>
29        <?php endif ?>
30    </div>
31<?php endforeach ?>
32