xref: /webtrees/resources/views/statistics/families/top10-list-age.phtml (revision 050c0bce7a32e90a2464e43124b663679e68bf20)
1<?php
2declare(strict_types=1);
3
4use Fisharebest\Webtrees\Family;
5use Fisharebest\Webtrees\I18N;
6use Fisharebest\Webtrees\Individual;
7
8/* @var array      $records */
9/* @var Family     $family */
10/* @var Individual $child1 */
11/* @var Individual $child2 */
12?>
13
14<?php if ($records): ?>
15    <ul class="list-group list-group-flush">
16        <?php foreach ($records as $record): ?>
17            <?php $child1 = $record['child1']; ?>
18            <?php $child2 = $record['child2']; ?>
19            <?php $family = $record['family']; ?>
20            <li class="list-group-item d-flex justify-content-between align-items-center">
21                <span>
22                    <a href="<?= e($child2->url()) ?>"><?= $child2->fullName() ?></a> <?= I18N::translate('and') ?> <a href="<?= e($child1->url()) ?>"><?= $child1->fullName() ?></a>
23                    <br>
24                    <a href="<?= e($family->url()) ?>">[<?= I18N::translate('View this family') ?>]</a>
25                </span>
26                <span class="badge badge-secondary badge-pill ml-3"><?= $record['age'] ?></span>
27            </li>
28        <?php endforeach; ?>
29    </ul>
30<?php else: ?>
31    <div class="card-body">
32        <?= I18N::translate('This information is not available.') ?>
33    </div>
34<?php endif; ?>
35