xref: /webtrees/resources/views/modules/hourglass-chart/parents.phtml (revision 26420f84cb96928cdc566963a4499db677a38ff9)
1<?php
2
3use Fisharebest\Webtrees\Family;
4
5/**
6 * @var Family $family
7 * @var int    $generations
8 */
9
10?>
11
12<div class="d-flex">
13    <div class="align-self-center">
14        <div class="d-flex">
15            <div class="wt-chart-horizontal-spacer">
16                <div class="wt-chart-horizontal-first-parent"></div>
17            </div>
18
19            <div class="align-self-center">
20                <?= view('chart-box', ['individual' => $family->husband()]) ?>
21            </div>
22
23            <?php if ($family->husband() && $family->husband()->primaryChildFamily()): ?>
24                <div class="wt-chart-horizontal-spacer">
25                    <div class="wt-chart-horizontal-line"></div>
26                </div>
27
28                <?php if ($generations > 1): ?>
29                    <?= view('modules/hourglass-chart/parents', ['family' => $family->husband()->primaryChildFamily(), 'generations' => $generations - 1]) ?>
30                <?php else: ?>
31                    <div class="align-self-center">
32                        <div class="hourglass-arrow" data-xref="<?= route('module', ['module' => 'hourglass_chart', 'action' => 'Ancestors', 'xref' => $family->husband()->primaryChildFamily()->xref(), 'ged' => $family->husband()->primaryChildFamily()->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() && $family->wife()->primaryChildFamily()): ?>
50                <div class="wt-chart-horizontal-spacer">
51                    <div class="wt-chart-horizontal-line"></div>
52                </div>
53
54                <?php if ($generations > 1): ?>
55                    <?= view('modules/hourglass-chart/parents', ['family' => $family->wife()->primaryChildFamily(), 'generations' => $generations - 1]) ?>
56                <?php else: ?>
57                    <div class="align-self-center">
58                        <div class="align-self-center">
59                            <div class="hourglass-arrow" data-xref="<?= route('module', ['module' => 'hourglass_chart', 'action' => 'Ancestors', 'xref' => $family->wife()->primaryChildFamily()->xref(), 'ged' => $family->wife()->primaryChildFamily()->tree()->name()]) ?>">
60                                <?= view('icons/arrow-right') ?>
61                            </div>
62                        </div>
63                    </div>
64                <?php endif ?>
65            <?php endif ?>
66        </div>
67    </div>
68</div>
69