xref: /webtrees/resources/views/family-page-children.phtml (revision 17dd427e21d166f4db62f430a276515adf98d90d)
1<?php
2
3use Fisharebest\Webtrees\I18N;
4
5?>
6
7<div class="align-self-center">
8    <div class="badge badge-secondary m-2">
9        <?php if ($family->children()->count() === 0): ?>
10            <?= I18N::translate('No children') ?>
11        <?php else: ?>
12            <?= I18N::plural('%s child', '%s children', $family->children()->count(), I18N::number($family->children()->count())) ?>
13        <?php endif ?>
14    </div>
15    <?php foreach ($family->children() as $n => $child): ?>
16        <div class="d-flex">
17            <?= view('chart-box', ['individual' => $child]) ?>
18            <div class="wt-chart-horizontal-spacer">
19                <?php if ($family->children()->count() === 1): ?>
20                    <div class="wt-chart-horizontal-line"></div>
21                <?php elseif ($n === 0): ?>
22                    <div class="wt-chart-horizontal-first-child"></div>
23                <?php elseif ($n + 1 === $family->children()->count()): ?>
24                    <div class="wt-chart-horizontal-last-child"></div>
25                <?php else: ?>
26                    <div class="wt-chart-horizontal-middle-child"><div class="wt-chart-horizontal-line"></div></div>
27                <?php endif ?>
28            </div>
29        </div>
30    <?php endforeach ?>
31    <div class="wt-chart-box">
32        <a class="btn btn-link" href="<?= e(route('add-child-to-family', ['gender' => 'U', 'ged' => $family->tree()->name(), 'xref' => $family->xref()])) ?>">
33            <?= I18N::translate('Add a child') ?>
34        </a>
35        <br>
36        <?php if ($family->numberOfChildren() > 1) : ?>
37            <a class="btn btn-link" href="<?= e(route('reorder-children', ['ged' => $family->tree()->name(), 'xref' => $family->xref()])) ?>">
38                <?= I18N::translate('Re-order children') ?>
39            </a>
40        <?php endif ?>
41    </div>
42</div>
43<?php if ($family->children()->count() !== 1): ?>
44    <div class="wt-chart-horizontal-spacer">
45        <div class="wt-chart-horizontal-line"></div>
46    </div>
47<?php endif ?>
48