xref: /webtrees/resources/views/modules/lifespans-chart/chart.phtml (revision e11ffd0c922a07c13f23d38c7d9c82edce5298f5)
1<?php use Fisharebest\Webtrees\Gedcom; ?>
2
3<p class="wt-lifespans-subtitle">
4    <?= $subtitle ?>
5</p>
6
7<div class="wt-lifespans-scale">
8    <?php for ($year = $start_year; $year < $end_year; $year += 10) :
9        ?><div class="wt-lifespans-decade"><?= $year ?></div><?php
10    endfor ?>
11</div>
12
13<div class="wt-lifespans-individuals position-relative" style="height: <?= (5 + $max_rows) * 1.5 ?>rem; width: <?= ($end_year - $start_year) * 7 ?>px;">
14    <?php foreach ($lifespans as $lifespan) : ?>
15    <a href="<?= e($lifespan->id) ?>" data-toggle="collapse" data-target="#<?= e($lifespan->id) ?>" aria-expanded="false" aria-controls="<?= e($lifespan->id) ?>">
16        <div class="wt-lifespans-individual position-absolute text-nowrap text-truncate" dir="auto" style="background: <?= $lifespan->background ?>; <?= $dir === 'ltr' ? 'left' : 'right' ?>:<?= ($lifespan->birth_year - $start_year) * 7 ?>px; top:<?= $lifespan->row * 1.5 ?>rem; width:<?= ($lifespan->death_year - $lifespan->birth_year) * 7 + 5 ?>px;">
17            <?= $lifespan->individual->getFullName() ?>
18            <?= strip_tags($lifespan->individual->getLifespan()) ?>
19        </div>
20    </a>
21
22    <div class="wt-lifespans-summary collapse position-absolute" id="<?= e($lifespan->id) ?>" style="<?= $dir === 'ltr' ? 'left' : 'right' ?>:<?= (min($lifespan->birth_year, $end_year - 50) - $start_year) * 7 ?>px; top:<?= ($lifespan->row + 1) * 1.5 ?>rem; width:350px;">
23        <a class="wt-lifespans-summary-link" href="<?= e($lifespan->individual->url()) ?>">
24            <?= $lifespan->individual->getFullName() ?>
25        </a>
26
27        <?php foreach ($lifespan->individual->facts(array_merge(Gedcom::BIRTH_EVENTS, Gedcom::DEATH_EVENTS), true) as $fact) : ?>
28            <?= $fact->summary() ?>
29        <?php endforeach ?>
30    </div>
31    <?php endforeach ?>
32</div>
33
34