xref: /webtrees/resources/views/modules/ancestors-chart/page.phtml (revision b6c326d8b8798b83b744c4d4a669df5aa9f3e0c2)
19b5537c3SGreg Roach<?php use Fisharebest\Webtrees\I18N; ?>
29b5537c3SGreg Roach<?php use Fisharebest\Webtrees\View; ?>
39b5537c3SGreg Roach
49b5537c3SGreg Roach<h2 class="wt-page-title">
59b5537c3SGreg Roach    <?= $title ?>
69b5537c3SGreg Roach</h2>
79b5537c3SGreg Roach
89b5537c3SGreg Roach<form class="wt-page-options wt-page-options-ancestors-chart d-print-none">
99b5537c3SGreg Roach    <input type="hidden" name="route" value="module">
109b5537c3SGreg Roach    <input type="hidden" name="module" value="<?= e($module_name) ?>">
119b5537c3SGreg Roach    <input type="hidden" name="action" value="Chart">
129b5537c3SGreg Roach    <input type="hidden" name="ged" value="<?= e($tree->name()) ?>">
139b5537c3SGreg Roach
149b5537c3SGreg Roach    <div class="row form-group">
159b5537c3SGreg Roach        <label class="col-sm-3 col-form-label wt-page-options-label" for="xref">
169b5537c3SGreg Roach            <?= I18N::translate('Individual') ?>
179b5537c3SGreg Roach        </label>
189b5537c3SGreg Roach        <div class="col-sm-9 wt-page-options-value">
19*b6c326d8SGreg Roach            <?= view('components/select-individual', ['name' => 'xref', 'individual' => $individual, 'tree' => $tree]) ?>
209b5537c3SGreg Roach        </div>
219b5537c3SGreg Roach    </div>
229b5537c3SGreg Roach
239b5537c3SGreg Roach    <div class="row form-group">
249b5537c3SGreg Roach        <label class="col-sm-3 col-form-label wt-page-options-label" for="generations">
259b5537c3SGreg Roach            <?= I18N::translate('Generations') ?>
269b5537c3SGreg Roach        </label>
279b5537c3SGreg Roach        <div class="col-sm-9 wt-page-options-value">
289b5537c3SGreg Roach            <input class="form-control" id="generations" name="generations" type="number" min="<?= e($minimum_generations) ?>" max="<?= e($maximum_generations) ?>" value="<?= e($generations) ?>" required>
299b5537c3SGreg Roach        </div>
309b5537c3SGreg Roach    </div>
319b5537c3SGreg Roach
329b5537c3SGreg Roach    <fieldset class="form-group">
339b5537c3SGreg Roach        <div class="row">
349b5537c3SGreg Roach            <legend class="col-form-label col-sm-3 wt-page-options-label">
359b5537c3SGreg Roach                <?= I18N::translate('Layout') ?>
369b5537c3SGreg Roach            </legend>
379b5537c3SGreg Roach            <div class="col-sm-9 wt-page-options-value">
38*b6c326d8SGreg Roach                <?= view('components/radios-inline', ['name' => 'chart_style', 'options' => $chart_styles, 'selected' => $chart_style]) ?>
39*b6c326d8SGreg Roach                <?= view('components/checkbox', ['label' => I18N::translate('Show cousins'), 'name' => 'show_cousins', 'disabled' => $chart_style !== 'booklet', 'checked' => $show_cousins]) ?>
409b5537c3SGreg Roach            </div>
419b5537c3SGreg Roach        </div>
429b5537c3SGreg Roach    </fieldset>
439b5537c3SGreg Roach
449b5537c3SGreg Roach    <div class="row form-group">
459b5537c3SGreg Roach        <div class="col-form-label col-sm-3 wt-page-options-label"></div>
469b5537c3SGreg Roach        <div class="col-sm-9 wt-page-options-value">
479b5537c3SGreg Roach            <input class="btn btn-primary" type="submit" value="<?= /* I18N: A button label. */ I18N::translate('view') ?>">
489b5537c3SGreg Roach        </div>
499b5537c3SGreg Roach    </div>
509b5537c3SGreg Roach</form>
519b5537c3SGreg Roach
52242a7862SGreg Roach<div class="wt-ajax-load wt-page-content wt-chart wt-chart-ancestors" data-ajax-url="<?= e($ajax_url) ?>"></div>
539b5537c3SGreg Roach
549b5537c3SGreg Roach<?php View::push('javascript') ?>
559b5537c3SGreg Roach<script>
569b5537c3SGreg Roach    // The "show cousins" option is only available for the "booklet" style.
579b5537c3SGreg Roach    $("input[name=chart_style]").change(function () {
589b5537c3SGreg Roach        $("input[name=show_cousins]").prop("disabled", $(this).val() !== "booklet");
599b5537c3SGreg Roach    });
609b5537c3SGreg Roach</script>
619b5537c3SGreg Roach<?php View::endpush() ?>
62