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