xref: /webtrees/resources/views/lists/anniversaries-list.phtml (revision cd51dbdfbd6a6a2e8b78479e839819cddc801c34)
148f08416SGreg Roach<?php
248f08416SGreg Roach
348f08416SGreg Roachuse Fisharebest\Webtrees\Carbon;
448f08416SGreg Roachuse Fisharebest\Webtrees\Fact;
548f08416SGreg Roachuse Fisharebest\Webtrees\Individual;
6*cd51dbdfSGreg Roachuse Illuminate\Support\Collection;
748f08416SGreg Roach
8*cd51dbdfSGreg Roach/**
9*cd51dbdfSGreg Roach * @var Collection<Fact> $facts
10*cd51dbdfSGreg Roach */
1148f08416SGreg Roach
1248f08416SGreg Roach?>
1348f08416SGreg Roach
1448f08416SGreg Roach<?php foreach ($facts as $fact) : ?>
1548f08416SGreg Roach    <?php $record = $fact->record(); ?>
1648f08416SGreg Roach    <a href="<?= e($record->url()) ?>" class="list_item name2">
1748f08416SGreg Roach        <?= $record->fullName() ?>
1848f08416SGreg Roach    </a>
1948f08416SGreg Roach    <?php if ($record instanceof Individual) : ?>
2008362db4SGreg Roach        <?= view('icons/sex', ['sex' => $record->sex()]) ?>
2148f08416SGreg Roach    <?php endif ?>
2248f08416SGreg Roach    <div class="indent">
2339c990acSGreg Roach        <?= $fact->label() . ' — ' . $fact->date()->display(true) ?>
2439c990acSGreg Roach        (<?= Carbon::now()->subYears($fact->anniv)->local()->diffForHumans() ?>)
2548f08416SGreg Roach        <?php if ($fact->place()->gedcomName() !== '') : ?>
2648f08416SGreg Roach            — <a href="<?= e($fact->place()->url()) ?>" title="<?= strip_tags($fact->place()->fullName()) ?>">
2748f08416SGreg Roach                <?= $fact->place()->shortName() ?>
2848f08416SGreg Roach            </a>
2948f08416SGreg Roach        <?php endif ?>
3048f08416SGreg Roach    </div>
3148f08416SGreg Roach<?php endforeach ?>
32