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