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