summaryrefslogtreecommitdiff
path: root/resources/views/admin/merge-records-step-1.phtml
blob: c029598270b83dad703aa383aa40b400a83a8d00 (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
91
92
93
94
95
96
97
98
99
<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\View; ?>

<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('admin-trees') => I18N::translate('Manage family trees'), $title]]) ?>

<h1><?= $title ?></h1>

<form>
    <input type="hidden" name="route" value="merge-records">
    <input type="hidden" name="ged" value="<?= e($tree->name()) ?>">
    <div class="row form-group">
        <label class="col-sm-3 col-form-label" for="record-type">
            <?= I18N::translate('Select two records to merge.') ?>
        </label>
        <div class="col-sm-9">
            <select class="form-control" id="record-type">
                <option value="individual"><?= I18N::translate('Individuals') ?></option>
                <option value="family"><?= I18N::translate('Families') ?></option>
                <option value="source"><?= I18N::translate('Sources') ?></option>
                <option value="repository"><?= I18N::translate('Repositories') ?></option>
                <option value="note"><?= I18N::translate('Notes') ?></option>
                <option value="media"><?= I18N::translate('Media objects') ?></option>
            </select>
        </div>
    </div>

    <label class="row form-group">
        <span class="col-sm-3 col-form-label">
            <?= I18N::translate('First record') ?>
        </span>
        <span class="col-sm-9 select-record select-individual">
            <?= FunctionsEdit::formControlIndividual($tree, $individual1, ['name' => 'xref1', 'class' => 'form-control', 'style' => 'width:100%;']) ?>
        </span>
        <span class="col-sm-9 select-record select-family d-none">
            <?= FunctionsEdit::formControlFamily($tree, $family1, ['name' => 'xref1', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
        </span>
        <span class="col-sm-9 select-record select-source d-none">
            <?= FunctionsEdit::formControlSource($tree, $source1, ['name' => 'xref1', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
        </span>
        <span class="col-sm-9 select-record select-repository d-none">
            <?= FunctionsEdit::formControlRepository($tree, $repository1, ['name' => 'xref1', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
        </span>
        <span class="col-sm-9 select-record select-note d-none">
            <?= FunctionsEdit::formControlNote($tree, $note1, ['name' => 'xref1', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
        </span>
        <span class="col-sm-9 select-record select-media d-none">
            <?= FunctionsEdit::formControlMediaObject($tree, $media2, ['name' => 'xref1', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
        </span>
    </label>

    <label class="row form-group">
        <span class="col-sm-3 col-form-label">
            <?= I18N::translate('Second record') ?>
        </span>
        <span class="col-sm-9 select-record select-individual">
            <?= FunctionsEdit::formControlIndividual($tree, $individual2, ['name' => 'xref2', 'class' => 'form-control', 'style' => 'width:100%;']) ?>
        </span>
        <span class="col-sm-9 select-record select-family d-none">
            <?= FunctionsEdit::formControlFamily($tree, $family2, ['name' => 'xref2', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
        </span>
        <span class="col-sm-9 select-record select-source d-none">
            <?= FunctionsEdit::formControlSource($tree, $source2, ['name' => 'xref2', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
        </span>
        <span class="col-sm-9 select-record select-repository d-none">
            <?= FunctionsEdit::formControlRepository($tree, $repository2, ['name' => 'xref2', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
        </span>
        <span class="col-sm-9 select-record select-note d-none">
            <?= FunctionsEdit::formControlNote($tree, $note2, ['name' => 'xref2', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
        </span>
        <span class="col-sm-9 select-record select-media d-none">
            <?= FunctionsEdit::formControlMediaObject($tree, $media2, ['name' => 'xref2', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
        </span>
    </label>

    <div class="row form-group">
        <div class="col-sm-3">
        </div>
        <div class="col-sm-9">
            <button class="btn btn-primary" type="submit">
            <?= view('icons/save') ?>
                <?= I18N::translate('continue') ?>
            </button>
        </div>
    </div>
</form>

<?php View::push('javascript') ?>
<script>
  'use strict';

  // Disabled elements do not get submitted with the form.
  $('#record-type').change(function() {
    $('.select-record').addClass('d-none').attr("disabled", true);
    $('.select-' + $(this).val()).removeClass('d-none').attr("disabled", false);
    // Recalculate width of previously hidden elements
  });
</script>
<?php View::endpush() ?>