blob: cb04e3be88ac15e3d9a065cfd4cecca6372f82c1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
<?php
use Fisharebest\Webtrees\Http\RequestHandlers\ModuleAction;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\View;
?>
<h2 class="wt-page-title">
<?= $title ?>
</h2>
<form method="post" class="wt-page-options wt-page-options-relationships-chart d-print-none">
<?= csrf_field() ?>
<div class="row form-group">
<label class="col-sm-3 col-form-label wt-page-options-label" for="xref">
<?= I18N::translate('Individual 1') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
<?= view('components/select-individual', ['name' => 'xref', 'individual' => $individual1, 'tree' => $tree]) ?>
</div>
</div>
<div class="row form-group">
<label class="col-sm-3 col-form-label wt-page-options-label" for="xref2">
<?= I18N::translate('Individual 2') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
<?= view('components/select-individual', ['name' => 'xref2', 'individual' => $individual2, 'tree' => $tree]) ?>
</div>
</div>
<fieldset class="form-group">
<div class="row">
<legend class="col-form-label col-sm-3 wt-page-options-label">
</legend>
<div class="col-sm-9 wt-page-options-value">
<?php if ($ancestors_only) : ?>
<input type="hidden" name="ancestors" value="1">
<?= I18N::translate('Find relationships via ancestors') ?>
<?php else : ?>
<?= view('components/radios', ['name' => 'ancestors', 'options' => $ancestors_options, 'selected' => $ancestors]) ?>
<?php endif ?>
</div>
</div>
</fieldset>
<fieldset class="form-group">
<div class="row">
<legend class="col-form-label col-sm-3 wt-page-options-label">
</legend>
<div class="col-sm-9 wt-page-options-value">
<?php if ($max_recursion === 0) : ?>
<?= I18N::translate('Find the closest relationships') ?>
<input type="hidden" name="recursion" value="0">
<?php else : ?>
<?= view('components/radios', ['name' => 'recursion', 'options' => $recursion_options, 'selected' => $recursion]) ?>
<?php endif ?>
</div>
</div>
</fieldset>
<div class="row form-group">
<div class="col-form-label col-sm-3 wt-page-options-label"></div>
<div class="col-sm-9 wt-page-options-value">
<button class="btn btn-primary" type="submit">
<?= /* I18N: A button label. */ I18N::translate('view') ?>
</button>
<button class="btn btn-link" id="btn-swap-individuals" type="button">
<?= /* I18N: Reverse the order of two individuals */
I18N::translate('Swap individuals') ?>
</button>
</div>
</div>
</form>
<?php if ($individual1 !== null && $individual2 !== null) : ?>
<div class="wt-ajax-load wt-page-content wt-chart wt-chart-relationships" data-ajax-url="<?= e($ajax_url) ?>"></div>
<?php endif ?>
<?php View::push('javascript') ?>
<script>
$('#btn-swap-individuals').click(function () {
// Swap the name attributes
document.getElementById("xref").name = "xref2";
document.getElementById("xref2").name = "xref";
document.querySelector(".wt-page-options-relationships-chart").submit();
});
</script>
<?php View::endpush() ?>
|