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