1d70512abSGreg Roach<?php 2d70512abSGreg Roach 3d70512abSGreg Roachuse Fisharebest\Webtrees\I18N; 4e24053e5SGreg Roachuse Fisharebest\Webtrees\View; 5e24053e5SGreg Roachuse Illuminate\Support\Collection; 6e24053e5SGreg Roach 7e24053e5SGreg Roach/** 8*dc270d8cSGreg Roach * @var int $id 901221f27SGreg Roach * @var int $limit_low 1001221f27SGreg Roach * @var int $limit_high 11*dc270d8cSGreg Roach * @var Collection<stdClass> $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> 34cb867caaSGreg Roach <?php View::endPush() ?> 35e24053e5SGreg Roach <?php endif ?> 36e24053e5SGreg Roach 3701221f27SGreg Roach <div class="<?= $n >= $limit_low && $yahrzeits->count() > $limit_high ? 'd-none' : '' ?>"> 38dd6b2bfcSGreg Roach <a href="<?= e($yahrzeit->individual->url()) ?>" class="list_item name2"> 3939ca88baSGreg Roach <?= $yahrzeit->individual->fullName() ?> 40dd6b2bfcSGreg Roach </a> 4108362db4SGreg Roach <small><?= view('icons/sex', ['sex' => $yahrzeit->individual->sex()]) ?></small> 42dd6b2bfcSGreg Roach <div class="indent"> 436676e53aSGreg Roach <?= $yahrzeit->fact->date()->display(true, null, false) ?>, 446676e53aSGreg Roach <?= $yahrzeit->yahrzeit_date->display(true, null, false) ?>, 45dd6b2bfcSGreg Roach <?= I18N::translate('%s year anniversary', $yahrzeit->fact->anniv) ?> 46dd6b2bfcSGreg Roach </div> 47e24053e5SGreg Roach </div> 48dd6b2bfcSGreg Roach<?php endforeach ?> 49