xref: /webtrees/resources/views/lists/anniversaries-list.phtml (revision cd51dbdfbd6a6a2e8b78479e839819cddc801c34)
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