xref: /webtrees/resources/views/admin/merge-records-step-2.phtml (revision dae8440ab1203b4eb5e333de33e187c1dfc5b759)
1<?php use Fisharebest\Webtrees\GedcomRecord; ?>
2<?php use Fisharebest\Webtrees\I18N; ?>
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 action="<?= e(route('merge-records', ['ged' => $tree->name(), 'xref1' => $record1->xref(), 'xref2' => $record2->xref()])) ?>" method="POST">
9    <?= csrf_field() ?>
10    <p>
11        <?= I18N::translate('Select the facts and events to keep from both records.') ?>
12    </p>
13    <div class="card mb-4">
14        <div class="card-header">
15            <h2 class="card-title">
16                <?= I18N::translate('The following facts and events were found in both records.') ?>
17            </h2>
18        </div>
19        <div class="card-body">
20            <?php if (!empty($facts)) : ?>
21                <table class="table table-bordered table-sm">
22                    <thead>
23                        <tr>
24                            <th>
25                                <?= I18N::translate('Select') ?>
26                            </th>
27                            <th>
28                                <?= I18N::translate('Details') ?>
29                            </th>
30                        </tr>
31                    </thead>
32                    <tbody>
33                        <?php foreach ($facts as $fact_id => $fact) : ?>
34                            <tr>
35                                <td>
36                                    <input type="checkbox" name="keep1[]" value="<?= $fact->id() ?>" checked>
37                                </td>
38                                <td>
39                                    <div class="gedcom-data" dir="ltr"><?= e($fact->gedcom()) ?></div>
40                                    <?php if ($fact->target() instanceof GedcomRecord) : ?>
41                                        <a href="<?= e($fact->target()->url()) ?>">
42                                            <?= $fact->target()->getFullName() ?>
43                                        </a>
44                                    <?php endif ?>
45                                </td>
46                            </tr>
47                        <?php endforeach ?>
48                    </tbody>
49                </table>
50            <?php else : ?>
51                <p>
52                    <?= I18N::translate('No matching facts found') ?>
53                </p>
54            <?php endif ?>
55        </div>
56    </div>
57
58    <div class="row">
59        <div class="col-sm-6">
60            <div class="card">
61                <div class="card-header">
62                    <h2 class="card-title">
63                        <?= /* I18N: the name of an individual, source, etc. */ I18N::translate('The following facts and events were only found in the record of %s.', '<a href="' . e($record1->url()) . '">' . $record1->getFullName()) . '</a>' ?>
64                    </h2>
65                </div>
66                <div class="card-body">
67                    <?php if (!empty($facts1)) : ?>
68                        <table class="table table-bordered table-sm">
69                            <thead>
70                                <tr>
71                                    <th>
72                                        <?= I18N::translate('Select') ?>
73                                    </th>
74                                    <th>
75                                        <?= I18N::translate('Details') ?>
76                                    </th>
77                                </tr>
78                            </thead>
79                            <tbody>
80                                <?php foreach ($facts1 as $fact_id => $fact) : ?>
81                                    <tr>
82                                        <td>
83                                            <input type="checkbox" name="keep1[]" value="<?= $fact->id() ?>" checked>
84                                        </td>
85                                        <td>
86                                            <div class="gedcom-data" dir="ltr"><?= e($fact->gedcom()) ?></div>
87                                            <?php if ($fact->target() instanceof GedcomRecord) : ?>
88                                                <a href="<?= e($fact->target()->url()) ?>">
89                                                    <?= $fact->target()->getFullName() ?>
90                                                </a>
91                                            <?php endif ?>
92                                        </td>
93                                    </tr>
94                                <?php endforeach ?>
95                            </tbody>
96                        </table>
97                    <?php else : ?>
98                        <p>
99                            <?= I18N::translate('No matching facts found') ?>
100                        </p>
101                    <?php endif ?>
102                </div>
103            </div>
104        </div>
105        <div class="col-sm-6">
106            <div class="card">
107                <div class="card-header">
108                    <h2 class="card-title">
109                        <?= /* I18N: the name of an individual, source, etc. */ I18N::translate('The following facts and events were only found in the record of %s.', '<a href="' . e($record2->url()) . '">' . $record2->getFullName()) . '</a>' ?>
110                    </h2>
111                </div>
112                <div class="card-body">
113                    <?php if (!empty($facts2)) : ?>
114                        <table class="table table-bordered table-sm">
115                            <thead>
116                                <tr>
117                                    <th>
118                                        <?= I18N::translate('Select') ?>
119                                    </th>
120                                    <th>
121                                        <?= I18N::translate('Details') ?>
122                                    </th>
123                                </tr>
124                            </thead>
125                            <tbody>
126                                <?php foreach ($facts2 as $fact_id => $fact) : ?>
127                                    <tr>
128                                        <td>
129                                            <input type="checkbox" name="keep2[]" value="<?= $fact->id() ?>" checked>
130                                        </td>
131                                        <td>
132                                            <div class="gedcom-data" dir="ltr"><?= e($fact->gedcom()) ?></div>
133                                            <?php if ($fact->target() instanceof GedcomRecord) : ?>
134                                                <a href="<?= e($fact->target()->url()) ?>">
135                                                    <?= $fact->target()->getFullName() ?>
136                                                </a>
137                                            <?php endif ?>
138                                        </td>
139                                    </tr>
140                                <?php endforeach ?>
141                            </tbody>
142                        </table>
143                    <?php else : ?>
144                        <p>
145                            <?= I18N::translate('No matching facts found') ?>
146                        </p>
147                    <?php endif ?>
148                </div>
149            </div>
150        </div>
151    </div>
152
153    <button type="submit" class="btn btn-primary">
154        <?= view('icons/save') ?>
155        <?= I18N::translate('save') ?>
156    </button>
157</form>
158