xref: /webtrees/resources/views/modules/pedigree-chart/chart-up.phtml (revision ac71572d8462e396ed5a307f05b29381e49f9e6e)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Individual;
6use Illuminate\Support\Collection;
7
8/**
9 * @var Collection|Individual[] $ancestors   Indexed by sosa number
10 * @var int                     $generation  Draw this generation
11 * @var int                     $generations Final generation to draw
12 * @var Collection|string[]     $links       Links to extend the tree
13 * @var int                     $sosa        Draw this individual
14 * @var string                  $spacer
15 */
16?>
17
18<div class="d-flex flex-column">
19    <?php if ($generation < $generations) : ?>
20        <div class="d-flex">
21            <?= view('modules/pedigree-chart/chart-up', ['ancestors' => $ancestors, 'sosa' => $sosa * 2, 'generation' => $generation + 1, 'generations' => $generations, 'links' => $links, 'spacer' => $spacer]) ?>
22
23            <?= view('modules/pedigree-chart/chart-up', ['ancestors' => $ancestors, 'sosa' => $sosa * 2 + 1, 'generation' => $generation + 1, 'generations' => $generations, 'links' => $links, 'spacer' => $spacer]) ?>
24        </div>
25    <?php endif ?>
26
27    <div class="position-relative d-flex justify-content-center wt-pedigree-generation wt-generation-fwd-<?= $generation ?> wt-generation-rev-<?= 1 + $generations - $generation ?>">
28        <!-- lines to the next generation -->
29        <?php if ($generation < $generations) : ?>
30            <div class="wt-pedigree-lines position-absolute"></div>
31        <?php endif ?>
32
33        <div class="d-flex flex-column align-items-center position-relative">
34            <?php if ($generation === $generations) : ?>
35                <?= $links->get($sosa, $spacer) ?>
36            <?php endif ?>
37
38            <?= view('chart-box', ['individual' => $ancestors->get($sosa)]) ?>
39
40            <?php if ($sosa === 1) : ?>
41                <?= $links->get(1) ?>
42            <?php endif ?>
43        </div>
44    </div>
45</div>
46
47