xref: /webtrees/resources/views/family-page-children.phtml (revision 7c7d1e03066c50e172e4a6239e322c1e0cd62040)
117dd427eSGreg Roach<?php
217dd427eSGreg Roach
3*7c7d1e03SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\AddChildToFamilyPage;
45229eadeSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ReorderChildrenPage;
517dd427eSGreg Roachuse Fisharebest\Webtrees\I18N;
617dd427eSGreg Roach
717dd427eSGreg Roach?>
817dd427eSGreg Roach
917dd427eSGreg Roach<div class="align-self-center">
1017dd427eSGreg Roach    <div class="badge badge-secondary m-2">
1117dd427eSGreg Roach        <?php if ($family->children()->count() === 0) : ?>
1217dd427eSGreg Roach            <?= I18N::translate('No children') ?>
1317dd427eSGreg Roach        <?php else : ?>
1417dd427eSGreg Roach            <?= I18N::plural('%s child', '%s children', $family->children()->count(), I18N::number($family->children()->count())) ?>
1517dd427eSGreg Roach        <?php endif ?>
1617dd427eSGreg Roach    </div>
1717dd427eSGreg Roach    <?php foreach ($family->children() as $n => $child) : ?>
1817dd427eSGreg Roach        <div class="d-flex">
1917dd427eSGreg Roach            <?= view('chart-box', ['individual' => $child]) ?>
2017dd427eSGreg Roach            <div class="wt-chart-horizontal-spacer">
2117dd427eSGreg Roach                <?php if ($family->children()->count() === 1) : ?>
2217dd427eSGreg Roach                    <div class="wt-chart-horizontal-line"></div>
2317dd427eSGreg Roach                <?php elseif ($n === 0) : ?>
2417dd427eSGreg Roach                    <div class="wt-chart-horizontal-first-child"></div>
2517dd427eSGreg Roach                <?php elseif ($n + 1 === $family->children()->count()) : ?>
2617dd427eSGreg Roach                    <div class="wt-chart-horizontal-last-child"></div>
2717dd427eSGreg Roach                <?php else : ?>
2817dd427eSGreg Roach                    <div class="wt-chart-horizontal-middle-child"><div class="wt-chart-horizontal-line"></div></div>
2917dd427eSGreg Roach                <?php endif ?>
3017dd427eSGreg Roach            </div>
3117dd427eSGreg Roach        </div>
3217dd427eSGreg Roach    <?php endforeach ?>
330d55b628SGreg Roach    <?php if ($family->canEdit()) : ?>
3417dd427eSGreg Roach        <div class="wt-chart-box">
35*7c7d1e03SGreg Roach            <a class="btn btn-link" href="<?= e(route(AddChildToFamilyPage::class, ['gender' => 'M', 'tree' => $family->tree()->name(), 'xref' => $family->xref()])) ?>">
365eca9df6SGreg Roach                <?= I18N::translate('Add a son') ?>
375eca9df6SGreg Roach            </a>
385eca9df6SGreg Roach            |
39*7c7d1e03SGreg Roach            <a class="btn btn-link" href="<?= e(route(AddChildToFamilyPage::class, ['gender' => 'F', 'tree' => $family->tree()->name(), 'xref' => $family->xref()])) ?>">
405eca9df6SGreg Roach                <?= I18N::translate('Add a daughter') ?>
4117dd427eSGreg Roach            </a>
4217dd427eSGreg Roach            <br>
4317dd427eSGreg Roach            <?php if ($family->numberOfChildren() > 1) : ?>
445229eadeSGreg Roach                <a class="btn btn-link" href="<?= e(route(ReorderChildrenPage::class, ['tree' => $family->tree()->name(), 'xref' => $family->xref()])) ?>">
4517dd427eSGreg Roach                    <?= I18N::translate('Re-order children') ?>
4617dd427eSGreg Roach                </a>
4717dd427eSGreg Roach            <?php endif ?>
4817dd427eSGreg Roach        </div>
490d55b628SGreg Roach    <?php endif ?>
5017dd427eSGreg Roach</div>
5117dd427eSGreg Roach<?php if ($family->children()->count() !== 1) : ?>
5217dd427eSGreg Roach    <div class="wt-chart-horizontal-spacer">
5317dd427eSGreg Roach        <div class="wt-chart-horizontal-line"></div>
5417dd427eSGreg Roach    </div>
5517dd427eSGreg Roach<?php endif ?>
56