xref: /webtrees/resources/views/admin/trees-duplicates.phtml (revision fcfa147e10aaa6c7ff580c29bd6e5b88666befc1)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
4use Fisharebest\Webtrees\I18N;
5
6?>
7
8<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route('manage-trees') => I18N::translate('Manage family trees'), $title]]) ?>
9
10<h1><?= $title ?></h1>
11
12<?php foreach ($duplicates as $category => $records) : ?>
13    <h2><?= $category ?></h2>
14
15    <?php if (!empty($records)) : ?>
16        <ul>
17            <?php foreach ($records as $duplicates) : ?>
18                <li>
19                    <?= $duplicates[0]->fullName() ?>
20                    <?php foreach ($duplicates as $record) : ?>
2122                        <a href="<?= e($record->url()) ?>">
23                            <?= $record->xref() ?>
24                        </a>
25                    <?php endforeach ?>
26                    <?php if (count($duplicates) === 2) : ?>
2728                        <a href="<?= e(route('merge-records', ['tree' => $tree->name(), 'xref1' => $duplicates[0]->xref(), 'xref2' => $duplicates[1]->xref()])) ?>">
29                            <?= I18N::translate('Merge') ?>
30                        </a>
31                    <?php endif ?>
32                </li>
33            <?php endforeach ?>
34        </ul>
35    <?php else : ?>
36        <p><?= I18N::translate('No duplicates have been found.') ?></p>
37    <?php endif ?>
38<?php endforeach ?>
39