xref: /webtrees/resources/views/admin/merge-records-step-1.phtml (revision 6ccdf4f0fd1b65a5d54259c969912382ce49629d)
1<?php use Fisharebest\Webtrees\I18N; ?>
2<?php use Fisharebest\Webtrees\View; ?>
3
4<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('admin-trees') => I18N::translate('Manage family trees'), $title]]) ?>
5
6<h1><?= $title ?></h1>
7
8<form>
9    <input type="hidden" name="route" value="merge-records">
10    <input type="hidden" name="ged" value="<?= e($tree->name()) ?>">
11    <div class="row form-group">
12        <label class="col-sm-3 col-form-label" for="record-type">
13            <?= I18N::translate('Select two records to merge.') ?>
14        </label>
15        <div class="col-sm-9">
16            <select class="form-control" id="record-type">
17                <option value="individual"><?= I18N::translate('Individuals') ?></option>
18                <option value="family"><?= I18N::translate('Families') ?></option>
19                <option value="source"><?= I18N::translate('Sources') ?></option>
20                <option value="repository"><?= I18N::translate('Repositories') ?></option>
21                <option value="note"><?= I18N::translate('Notes') ?></option>
22                <option value="media"><?= I18N::translate('Media objects') ?></option>
23            </select>
24        </div>
25    </div>
26
27    <label class="row form-group">
28        <span class="col-sm-3 col-form-label">
29            <?= I18N::translate('First record') ?>
30        </span>
31        <span class="col-sm-9 select-record select-individual">
32            <?= view('components/select-individual', ['name' => 'xref1', 'id' => 'indi-xref-1', 'individual' => $individual1, 'tree' => $tree]) ?>
33        </span>
34        <span class="col-sm-9 select-record select-family d-none">
35            <?= view('components/select-family', ['name' => 'xref1', 'id' => 'fam-xref-1', 'family' => $family1, 'tree' => $tree, 'disabled' => true]) ?>
36        </span>
37        <span class="col-sm-9 select-record select-source d-none">
38            <?= view('components/select-source', ['name' => 'xref1', 'id' => 'sour-xref-1', 'source' => $source1, 'tree' => $tree, 'disabled' => true]) ?>
39        </span>
40        <span class="col-sm-9 select-record select-repository d-none">
41            <?= view('components/select-repository', ['name' => 'xref1', 'id' => 'repo-xref-1', 'repository' => $repository1, 'tree' => $tree, 'disabled' => true]) ?>
42        </span>
43        <span class="col-sm-9 select-record select-note d-none">
44            <?= view('components/select-note', ['name' => 'xref1', 'id' => 'note-xref-1', 'note' => $note1, 'tree' => $tree, 'disabled' => true]) ?>
45        </span>
46        <span class="col-sm-9 select-record select-media d-none">
47            <?= view('components/select-media', ['name' => 'xref1', 'id' => 'media-xref-1', 'media' => $media1, 'tree' => $tree, 'disabled' => true]) ?>
48        </span>
49    </label>
50
51    <label class="row form-group">
52        <span class="col-sm-3 col-form-label">
53            <?= I18N::translate('Second record') ?>
54        </span>
55        <span class="col-sm-9 select-record select-individual">
56            <?= view('components/select-individual', ['name' => 'xref2', 'id' => 'indi-xref-2', 'individual' => $individual2, 'tree' => $tree]) ?>
57        </span>
58        <span class="col-sm-9 select-record select-family d-none">
59            <?= view('components/select-family', ['name' => 'xref2', 'id' => 'fam-xref-2', 'family' => $family2, 'tree' => $tree, 'disabled' => true]) ?>
60        </span>
61        <span class="col-sm-9 select-record select-source d-none">
62            <?= view('components/select-source', ['name' => 'xref2', 'id' => 'sour-xref-2', 'source' => $source2, 'tree' => $tree, 'disabled' => true]) ?>
63        </span>
64        <span class="col-sm-9 select-record select-repository d-none">
65            <?= view('components/select-repository', ['name' => 'xref2', 'id' => 'repo-xref-2', 'repository' => $repository2, 'tree' => $tree, 'disabled' => true]) ?>
66        </span>
67        <span class="col-sm-9 select-record select-note d-none">
68            <?= view('components/select-note', ['name' => 'xref2', 'id' => 'note-xref-2', 'note' => $note2, 'tree' => $tree, 'disabled' => true]) ?>
69        </span>
70        <span class="col-sm-9 select-record select-media d-none">
71            <?= view('components/select-media', ['name' => 'xref2', 'id' => 'obje-xref-2', 'media' => $media2, 'tree' => $tree, 'disabled' => true]) ?>
72        </span>
73    </label>
74
75    <div class="row form-group">
76        <div class="col-sm-3">
77        </div>
78        <div class="col-sm-9">
79            <button class="btn btn-primary" type="submit">
80            <?= view('icons/save') ?>
81                <?= I18N::translate('continue') ?>
82            </button>
83        </div>
84    </div>
85</form>
86
87<?php View::push('javascript') ?>
88<script>
89  "use strict";
90
91  // Disabled elements do not get submitted with the form.
92  $("#record-type").change(function() {
93      $(".select-record").addClass('d-none');
94      $(".select-" + $(this).val()).removeClass('d-none');
95      $(".select-record select").attr("disabled", true);
96      $(".select-" + $(this).val() + " select").attr("disabled", false);
97  });
98</script>
99<?php View::endpush() ?>
100