xref: /webtrees/resources/views/modules/hourglass-chart/parents.phtml (revision 1270d2767576ed4a83917769b0ee3613e3b010bf)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Family;
6use Fisharebest\Webtrees\Individual;
7
8/**
9 * @var Family $family
10 * @var int    $generations
11 */
12
13?>
14
15<div class="d-flex">
16    <div class="wt-chart-horizontal-spacer">
17        <div class="wt-chart-horizontal-line"></div>
18    </div>
19    <div class="align-self-center">
20        <div class="d-flex">
21            <div class="wt-chart-horizontal-spacer">
22                <div class="wt-chart-horizontal-first-parent"></div>
23            </div>
24
25            <div class="align-self-center">
26                <?= view('chart-box', ['individual' => $family->husband()]) ?>
27            </div>
28
29            <?php if ($family->husband() instanceof Individual && $family->husband()->childFamilies()->first() instanceof Family) : ?>
30                <?php if ($generations > 1) : ?>
31                    <?= view('modules/hourglass-chart/parents', ['family' => $family->husband()->childFamilies()->first(), 'generations' => $generations - 1]) ?>
32                <?php else : ?>
33                    <div class="align-self-center">
34                        <div class="hourglass-arrow" data-wt-chart-xref="<?= route('module', ['module' => 'hourglass_chart', 'action' => 'Ancestors', 'xref' => $family->husband()->childFamilies()->first()->xref(), 'tree' => $family->husband()->childFamilies()->first()->tree()->name()]) ?>">
35                            <?= view('icons/arrow-right') ?>
36                        </div>
37                    </div>
38                <?php endif ?>
39            <?php endif ?>
40        </div>
41
42        <div class="d-flex">
43            <div class="wt-chart-horizontal-spacer">
44                <div class="wt-chart-horizontal-last-parent"></div>
45            </div>
46
47            <div class="align-self-center">
48                <?= view('chart-box', ['individual' => $family->wife()]) ?>
49            </div>
50
51            <?php if ($family->wife() instanceof Individual && $family->wife()->childFamilies()->first() instanceof Family) : ?>
52                <?php if ($generations > 1) : ?>
53                    <?= view('modules/hourglass-chart/parents', ['family' => $family->wife()->childFamilies()->first(), 'generations' => $generations - 1]) ?>
54                <?php else : ?>
55                    <div class="align-self-center">
56                        <div class="align-self-center">
57                            <div class="hourglass-arrow" data-wt-chart-xref="<?= route('module', ['module' => 'hourglass_chart', 'action' => 'Ancestors', 'xref' => $family->wife()->childFamilies()->first()->xref(), 'tree' => $family->wife()->childFamilies()->first()->tree()->name()]) ?>">
58                                <?= view('icons/arrow-right') ?>
59                            </div>
60                        </div>
61                    </div>
62                <?php endif ?>
63            <?php endif ?>
64        </div>
65    </div>
66</div>
67