xref: /webtrees/resources/views/modules/ancestors-chart/page.phtml (revision 0010d42b5dcc725e166945c3345a365d5aa115e3)
1<?php use Fisharebest\Webtrees\Bootstrap4; ?>
2<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
3<?php use Fisharebest\Webtrees\I18N; ?>
4<?php use Fisharebest\Webtrees\View; ?>
5
6<h2 class="wt-page-title">
7    <?= $title ?>
8</h2>
9
10<form class="wt-page-options wt-page-options-ancestors-chart d-print-none">
11    <input type="hidden" name="route" value="module">
12    <input type="hidden" name="module" value="<?= e($module_name) ?>">
13    <input type="hidden" name="action" value="Chart">
14    <input type="hidden" name="ged" value="<?= e($tree->name()) ?>">
15
16    <div class="row form-group">
17        <label class="col-sm-3 col-form-label wt-page-options-label" for="xref">
18            <?= I18N::translate('Individual') ?>
19        </label>
20        <div class="col-sm-9 wt-page-options-value">
21            <?= FunctionsEdit::formControlIndividual($tree, $individual, ['id' => 'xref', 'name' => 'xref']) ?>
22        </div>
23    </div>
24
25    <div class="row form-group">
26        <label class="col-sm-3 col-form-label wt-page-options-label" for="generations">
27            <?= I18N::translate('Generations') ?>
28        </label>
29        <div class="col-sm-9 wt-page-options-value">
30            <input class="form-control" id="generations" name="generations" type="number" min="<?= e($minimum_generations) ?>" max="<?= e($maximum_generations) ?>" value="<?= e($generations) ?>" required>
31        </div>
32    </div>
33
34    <fieldset class="form-group">
35        <div class="row">
36            <legend class="col-form-label col-sm-3 wt-page-options-label">
37                <?= I18N::translate('Layout') ?>
38            </legend>
39            <div class="col-sm-9 wt-page-options-value">
40                <?= Bootstrap4::radioButtons('chart_style', $chart_styles, $chart_style, true) ?>
41                <?= Bootstrap4::checkbox(I18N::translate('Show cousins'), false, ['name' => 'show_cousins', 'disabled' => $chart_style !== 'booklet', 'checked' => $show_cousins]) ?>
42            </div>
43        </div>
44    </fieldset>
45
46    <div class="row form-group">
47        <div class="col-form-label col-sm-3 wt-page-options-label"></div>
48        <div class="col-sm-9 wt-page-options-value">
49            <input class="btn btn-primary" type="submit" value="<?= /* I18N: A button label. */ I18N::translate('view') ?>">
50        </div>
51    </div>
52</form>
53
54<div class="wt-ajax-load wt-page-content wt-chart wt-ancestors-chart" data-ajax-url="<?= e($ajax_url) ?>"></div>
55
56<?php View::push('javascript') ?>
57<script>
58    // The "show cousins" option is only available for the "booklet" style.
59    $("input[name=chart_style]").change(function () {
60        $("input[name=show_cousins]").prop("disabled", $(this).val() !== "booklet");
61    });
62</script>
63<?php View::endpush() ?>
64