xref: /webtrees/resources/views/modules/clippings/show.phtml (revision c4cbcd7b5d2995f2119e8970ddb302651026bf90)
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                            <button type="submit" class="btn btn-link" title="<?= I18N::translate('Remove') ?>">
47                                <?= view('icons/delete') ?>
48                            </button>
49
50                            <?= csrf_field() ?>
51                        </form>
52                    </td>
53                </tr>
54            <?php endforeach ?>
55        </tbody>
56    </table>
57<?php endif ?>
58