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