xref: /webtrees/resources/views/modules/faq/config.phtml (revision 242a78626998a767db1568b24919e94ae4b38ac3)
1<?php use Fisharebest\Webtrees\Bootstrap4; ?>
2<?php use Fisharebest\Webtrees\I18N; ?>
3
4<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('modules') => I18N::translate('Modules'), $title]]) ?>
5
6<h1><?= $title ?></h1>
7
8<p>
9    <?= /* I18N: FAQ = “Frequently Asked Question” */
10    I18N::translate('FAQs are lists of questions and answers, which allow you to explain the site’s rules, policies, and procedures to your visitors. Questions are typically concerned with privacy, copyright, user-accounts, unsuitable content, requirement for source-citations, etc.') ?>
11    <?= I18N::translate('You may use HTML to format the answer and to add links to other websites.') ?>
12</p>
13
14<p>
15<form class="form form-inline">
16    <input type="hidden" name="route" value="module">
17    <input type="hidden" name="module" value="faq">
18    <input type="hidden" name="action" value="Admin">
19    <label for="ged" class="sr-only">
20        <?= I18N::translate('Family tree') ?>
21    </label>
22    <?= Bootstrap4::select($tree_names, $tree->name(), ['id' => 'ged', 'name' => 'ged']) ?>
23    <input type="submit" class="btn btn-primary" value="<?= I18N::translate('show') ?>">
24</form>
25</p>
26
27<p>
28    <a href="<?= e(route('module', ['module' => 'faq', 'action' => 'AdminEdit', 'ged' => $tree->name()])) ?>" class="btn btn-link">
29        <?= view('icons/add') ?>
30        <?= /* I18N: FAQ = “Frequently Asked Question” */
31        I18N::translate('Add an FAQ') ?>
32    </a>
33</p>
34
35<table class="table table-bordered">
36    <thead>
37        <tr>
38            <th><?= I18N::translate('Sort order') ?></th>
39            <th><?= I18N::translate('Family tree') ?></th>
40            <th><?= I18N::translate('Question') ?></th>
41            <th><span class="sr-only"><?= I18N::translate('Move up') ?></span></th>
42            <th><span class="sr-only"><?= I18N::translate('Move down') ?></span></th>
43            <th><span class="sr-only"><?= I18N::translate('Edit') ?></span></th>
44            <th><span class="sr-only"><?= I18N::translate('Delete') ?></span></th>
45        </tr>
46    </thead>
47    <tbody>
48        <?php foreach ($faqs as $faq) : ?>
49            <tr class="faq_edit_pos">
50                <td>
51                    <?= I18N::number($faq->block_order + 1) ?>
52                </td>
53                <td>
54                    <?php if ($faq->gedcom_id === null) : ?>
55                        <?= I18N::translate('All') ?>
56                    <?php else : ?>
57                        <?= e($tree->title()) ?>
58                    <?php endif ?>
59                </td>
60                <td>
61                    <?= e($faq->header) ?>
62                </td>
63                <td>
64                    <?php if ($faq->block_order != $min_block_order) : ?>
65                        <form action="<?= e(route('module', ['module' => 'faq', 'action' => 'AdminMoveUp', 'block_id' => $faq->block_id, 'ged' => $tree->name()])) ?>" method="post">
66                            <?= csrf_field() ?>
67                            <button type="submit" class="btn btn-secondary">
68                                <?= view('icons/arrow-up') ?>
69                                <?= I18N::translate('Move up') ?>
70                            </button>
71                        </form>
72                    <?php endif ?>
73                </td>
74                <td>
75                    <?php if ($faq->block_order != $max_block_order) : ?>
76                        <form action="<?= e(route('module', ['module' => 'faq', 'action' => 'AdminMoveDown', 'block_id' => $faq->block_id, 'ged' => $tree->name()])) ?>" method="post">
77                            <?= csrf_field() ?>
78                            <button type="submit" class="btn btn-secondary">
79                                <?= view('icons/arrow-down') ?>
80                                <?= I18N::translate('Move down') ?>
81                            </button>
82                        </form>
83                    <?php endif ?>
84                </td>
85                <td>
86                    <a href="<?= e(route('module', ['module' => 'faq', 'action' => 'AdminEdit', 'block_id' => $faq->block_id, 'ged' => $tree->name()])) ?>" class="btn btn-primary">
87                        <?= view('icons/edit') ?>
88                        <?= I18N::translate('Edit') ?>
89                    </a>
90                </td>
91                <td>
92                    <form action="<?= e(route('module', ['module' => 'faq', 'action' => 'AdminDelete', 'block_id' => $faq->block_id, 'ged' => $tree->name()])) ?>" method="post">
93                        <?= csrf_field() ?>
94                        <button type="submit" class="btn btn-danger" onclick="return confirm(this.dataset.confirm);" data-confirm="<?= I18N::translate('Are you sure you want to delete “%s”?', e($faq->header)) ?>">
95                            <?= view('icons/delete') ?>
96                            <?= I18N::translate('delete') ?>
97                        </button>
98                    </form>
99                </td>
100            </tr>
101        <?php endforeach ?>
102    </tbody>
103</table>
104