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