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