xref: /webtrees/resources/views/modules/pedigree-chart/chart-left.phtml (revision 1270d2767576ed4a83917769b0ee3613e3b010bf)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Individual;
6use Illuminate\Support\Collection;
7
8/**
9 * @var Collection<int,Individual> $ancestors   Indexed by sosa number
10 * @var int                        $generation  Draw this generation
11 * @var int                        $generations Final generation to draw
12 * @var Collection<int,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">
19    <?php if ($generation < $generations) : ?>
20        <div class="d-flex flex-column">
21            <?= view('modules/pedigree-chart/chart-left', ['ancestors' => $ancestors, 'sosa' => $sosa * 2, 'generation' => $generation + 1, 'generations' => $generations, 'links' => $links, 'spacer' => $spacer]) ?>
22
23            <?= view('modules/pedigree-chart/chart-left', ['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 flex-column 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 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