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