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