xref: /webtrees/resources/views/modules/clippings/show.phtml (revision 3d2c98d1066d5e178a3d1ceb3bdc58b7ba8ee926)
1<?php
2
3use Fisharebest\Webtrees\GedcomRecord;
4use Fisharebest\Webtrees\I18N;
5use Fisharebest\Webtrees\Tree;
6
7/**
8 * @var string              $module
9 * @var array<GedcomRecord> $records
10 * @var string              $title
11 * @var Tree $tree
12 */
13
14?>
15
16<h2 class="wt-page-title"><?= $title ?></h2>
17
18<p>
19    <?= I18N::translate('The clippings cart allows you to take extracts from this family tree and download them as a GEDCOM file.') ?>
20</p>
21
22<?php if ($records === []) : ?>
23<p>
24    <?= I18N::translate('Your clippings cart is empty.') ?>
25</p>
26<?php else : ?>
27    <table class="table wt-facts-table">
28        <thead>
29            <tr>
30                <th><?= I18N::translate('Record') ?></th>
31                <th><?= I18N::translate('Remove') ?></th>
32            </tr>
33        </thead>
34        <tbody>
35            <?php foreach ($records as $record) : ?>
36                <tr>
37                    <td>
38                        <?= view('icons/record', ['record' => $record]) ?>
39
40                        <a href="<?= e($record->url()) ?>">
41                            <?= $record->fullName() ?>
42                        </a>
43                    </td>
44                    <td>
45                        <form method="post" action="<?= e(route('module', ['module' => $module, 'action' => 'Remove', 'tree' => $tree->name(), 'xref' => $record->xref()])) ?>">
46                            <?= csrf_field() ?>
47                            <button type="submit" class="btn btn-link" title="<?= I18N::translate('Remove') ?>">
48                                <?= view('icons/delete') ?>
49                            </button>
50                        </form>
51                    </td>
52                </tr>
53            <?php endforeach ?>
54        </tbody>
55    </table>
56<?php endif ?>
57