xref: /webtrees/resources/views/modules/yahrzeit/list.phtml (revision b4c5c807eb501a4b2f3da3cb8eb38981bf4a3a25)
1d70512abSGreg Roach<?php
2d70512abSGreg Roach
3d70512abSGreg Roachuse Fisharebest\Webtrees\I18N;
4e24053e5SGreg Roachuse Fisharebest\Webtrees\View;
5e24053e5SGreg Roachuse Illuminate\Support\Collection;
6e24053e5SGreg Roach
7e24053e5SGreg Roach/**
8dc270d8cSGreg Roach * @var int                    $id
901221f27SGreg Roach * @var int                    $limit_low
1001221f27SGreg Roach * @var int                    $limit_high
1136779af1SGreg Roach * @var Collection<int,object> $yahrzeits
12e24053e5SGreg Roach */
13d70512abSGreg Roach
14d70512abSGreg Roach?>
15dd6b2bfcSGreg Roach
16e24053e5SGreg Roach<?php foreach ($yahrzeits as $n => $yahrzeit) : ?>
1701221f27SGreg Roach    <?php if ($n === $limit_low && $yahrzeits->count() > $limit_high) : ?>
18e24053e5SGreg Roach        <div>
19e24053e5SGreg Roach            <button class="btn btn-sm btn-secondary" id="show-more-<?= e($id) ?>">
20e24053e5SGreg Roach                <?= view('icons/add') ?>
21e24053e5SGreg Roach                <?= /* I18N: button label */ I18N::translate('show more') ?>
22e24053e5SGreg Roach            </button>
23e24053e5SGreg Roach        </div>
24cb867caaSGreg Roach
25cb867caaSGreg Roach        <?php View::push('javascript') ?>
26cb867caaSGreg Roach        <script>
27cb867caaSGreg Roach            document.getElementById("show-more-<?= e($id) ?>").addEventListener("click", function (ev) {
28cb867caaSGreg Roach                document.querySelectorAll("#block-<?= e($id) ?> .d-none").forEach(function (el) {
29cb867caaSGreg Roach                    el.classList.remove("d-none");
30cb867caaSGreg Roach                });
31cb867caaSGreg Roach                ev.target.parentNode.removeChild(ev.target);
32cb867caaSGreg Roach            });
33cb867caaSGreg Roach        </script>
34*b4c5c807SGreg Roach        <?php View::endpush() ?>
35e24053e5SGreg Roach    <?php endif ?>
36e24053e5SGreg Roach
3701221f27SGreg Roach    <div class="<?= $n >= $limit_low && $yahrzeits->count() > $limit_high ? 'd-none' : '' ?>">
387a821518SGreg Roach        <a href="<?= e($yahrzeit->individual->url()) ?>" class="list_item">
3939ca88baSGreg Roach            <?= $yahrzeit->individual->fullName() ?>
40dd6b2bfcSGreg Roach        </a>
4108362db4SGreg Roach        <small><?= view('icons/sex', ['sex' => $yahrzeit->individual->sex()]) ?></small>
42dd6b2bfcSGreg Roach        <div class="indent">
4366ecd017SGreg Roach            <?= $yahrzeit->fact->date()->display($yahrzeit->individual->tree()) ?>,
4466ecd017SGreg Roach            <?= $yahrzeit->yahrzeit_date->display($yahrzeit->individual->tree()) ?>,
45dd6b2bfcSGreg Roach            <?= I18N::translate('%s year anniversary', $yahrzeit->fact->anniv) ?>
46dd6b2bfcSGreg Roach        </div>
47e24053e5SGreg Roach    </div>
48dd6b2bfcSGreg Roach<?php endforeach ?>
49