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