xref: /webtrees/resources/views/modules/timeline-chart/page.phtml (revision 78606cf427772fbdc5222ff607ee23f43078f94b)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\I18N;
6use Fisharebest\Webtrees\Individual;
7use Fisharebest\Webtrees\Tree;
8use Illuminate\Support\Collection;
9
10/**
11 * @var string                     $ajax_url
12 * @var Collection<int,Individual> $individuals
13 * @var array<string,string>       $remove_urls
14 * @var string                     $reset_url
15 * @var string                     $title
16 * @var Tree                       $tree
17 * @var string                     $zoom_in_url
18 * @var string                     $zoom_out_url
19 */
20
21?>
22
23<h2 class="wt-page-title">
24    <?= $title ?>
25</h2>
26
27<form method="post" class="wt-page-options wt-page-options-timeline-chart d-print-none">
28    <div class="row">
29        <label class="col-sm-3 col-form-label wt-page-options-label" for="add">
30            <?= I18N::translate('Individual') ?>
31        </label>
32        <div class="col-sm-9 wt-page-options-value">
33            <?= view('components/select-individual', ['name' => 'add', 'id' => 'add', 'tree' => $tree, 'required' => true]) ?>
34        </div>
35    </div>
36
37    <div class="row mb-3">
38        <div class="col-form-label col-sm-3 wt-page-options-label"></div>
39        <div class="col-sm-9 wt-page-options-value">
40            <input class="btn btn-primary" type="submit" value="<?= /* I18N: A button label. */
41            I18N::translate('add') ?>">
42            <a class="btn btn-secondary" href="<?= e($reset_url) ?>">
43                <?= /* I18N: A button label. */
44                I18N::translate('reset') ?>
45            </a>
46        </div>
47    </div>
48
49    <div class="row mb-3">
50        <div class="col-form-label col-sm-3 wt-page-options-label"></div>
51        <div class="col-sm-9 wt-page-options-value">
52            <a href="<?= e($zoom_in_url) ?>" title="<?= I18N::translate('Zoom in') ?>">
53                <?= view('icons/zoom-in') ?>
54            </a>
55            <a href="<?= e($zoom_out_url) ?>" title="<?= I18N::translate('Zoom out') ?>">
56                <?= view('icons/zoom-out') ?>
57            </a>
58        </div>
59    </div>
60
61    <?= csrf_field() ?>
62</form>
63
64<div class="row my-4">
65    <?php foreach ($individuals as $n => $individual) : ?>
66        <div class="col-md-6 col-lg-4 col-xl-3 person<?= $n % 6 ?>">
67            <?= view('icons/sex', ['sex' => $individual->sex()]) ?>
68            <a href="<?= e($individual->url()) ?>">
69                <?= $individual->fullName() ?>
70                <?php if ($individual->alternateName() !== '') : ?>
71                    <br>
72                    <?= $individual->alternateName() ?>
73                <?php endif ?>
74            </a>
75            <a href="<?= e($remove_urls[$individual->xref()]) ?>">
76                <?= I18N::translate('Remove individual') ?>
77            </a>
78            <?php if ($individual->getBirthDate()->isOK()) : ?>
79                <br>
80                <label>
81                    <input type="checkbox" name="agebar<?= $n ?>" onclick="$('#agebox<?= $n ?>').toggle();">
82                    <?= /* I18N: an age indicator, which can be dragged around the screen */
83                    I18N::translate('Show an age cursor') ?>
84                </label>
85            <?php endif ?>
86        </div>
87    <?php endforeach ?>
88</div>
89
90<div class="wt-ajax-load wt-page-content wt-chart wt-timeline-chart" data-wt-ajax-url="<?= e($ajax_url) ?>"></div>
91