xref: /webtrees/resources/views/admin/trees-duplicates.phtml (revision b8fc901f205cd6af65496b916bf63547a3065a2f)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
4use Fisharebest\Webtrees\Http\RequestHandlers\MergeRecordsPage;
5use Fisharebest\Webtrees\I18N;
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<?php foreach ($duplicates as $category => $records) : ?>
14    <h2><?= $category ?></h2>
15
16    <?php if (!empty($records)) : ?>
17        <ul>
18            <?php foreach ($records as $duplicates) : ?>
19                <li>
20                    <?= $duplicates[0]->fullName() ?>
21                    <?php foreach ($duplicates as $record) : ?>
2223                        <a href="<?= e($record->url()) ?>">
24                            <?= $record->xref() ?>
25                        </a>
26                    <?php endforeach ?>
27                    <?php if (count($duplicates) === 2) : ?>
2829                        <a href="<?= e(route(MergeRecordsPage::class, ['tree' => $tree->name(), 'xref1' => $duplicates[0]->xref(), 'xref2' => $duplicates[1]->xref()])) ?>">
30                            <?= I18N::translate('Merge') ?>
31                        </a>
32                    <?php endif ?>
33                </li>
34            <?php endforeach ?>
35        </ul>
36    <?php else : ?>
37        <p><?= I18N::translate('No duplicates have been found.') ?></p>
38    <?php endif ?>
39<?php endforeach ?>
40