blob: f55fe8509f66098424f752d6f53afbc1bdf6e6bf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
<?php
use Fisharebest\Webtrees\Http\RequestHandlers\AddChildToFamilyPage;
use Fisharebest\Webtrees\Http\RequestHandlers\ReorderChildrenPage;
use Fisharebest\Webtrees\I18N;
?>
<div class="align-self-center">
<div class="badge badge-secondary m-2">
<?php if ($family->children()->count() === 0) : ?>
<?= I18N::translate('No children') ?>
<?php else : ?>
<?= I18N::plural('%s child', '%s children', $family->children()->count(), I18N::number($family->children()->count())) ?>
<?php endif ?>
</div>
<?php foreach ($family->children() as $n => $child) : ?>
<div class="d-flex">
<?= view('chart-box', ['individual' => $child]) ?>
<div class="wt-chart-horizontal-spacer">
<?php if ($family->children()->count() === 1) : ?>
<div class="wt-chart-horizontal-line"></div>
<?php elseif ($n === 0) : ?>
<div class="wt-chart-horizontal-first-child"></div>
<?php elseif ($n + 1 === $family->children()->count()) : ?>
<div class="wt-chart-horizontal-last-child"></div>
<?php else : ?>
<div class="wt-chart-horizontal-middle-child"><div class="wt-chart-horizontal-line"></div></div>
<?php endif ?>
</div>
</div>
<?php endforeach ?>
<?php if ($family->canEdit()) : ?>
<div class="wt-chart-box">
<a class="btn btn-link" href="<?= e(route(AddChildToFamilyPage::class, ['gender' => 'M', 'tree' => $family->tree()->name(), 'xref' => $family->xref()])) ?>">
<?= I18N::translate('Add a son') ?>
</a>
|
<a class="btn btn-link" href="<?= e(route(AddChildToFamilyPage::class, ['gender' => 'F', 'tree' => $family->tree()->name(), 'xref' => $family->xref()])) ?>">
<?= I18N::translate('Add a daughter') ?>
</a>
<br>
<?php if ($family->numberOfChildren() > 1) : ?>
<a class="btn btn-link" href="<?= e(route(ReorderChildrenPage::class, ['tree' => $family->tree()->name(), 'xref' => $family->xref()])) ?>">
<?= I18N::translate('Re-order children') ?>
</a>
<?php endif ?>
</div>
<?php endif ?>
</div>
<?php if ($family->children()->count() !== 1) : ?>
<div class="wt-chart-horizontal-spacer">
<div class="wt-chart-horizontal-line"></div>
</div>
<?php endif ?>
|