xref: /webtrees/resources/views/modules/faq/config.phtml (revision 1d1f373cc23093682b1736881f66a527f62ccc46)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
4use Fisharebest\Webtrees\I18N;
5
6?>
7
8<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route('modules') => I18N::translate('Modules'), $title]]) ?>
9
10<h1><?= $title ?></h1>
11
12<p>
13    <?= /* I18N: FAQ = “Frequently Asked Question” */
14    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.') ?>
15    <?= I18N::translate('You may use HTML to format the answer and to add links to other websites.') ?>
16</p>
17
18<p>
19<form method="get" action="<?= e(route('module', ['module' => $module, 'action' => 'Admin'])) ?>" class="form form-inline">
20    <input type="hidden" name="route" value="<?= e('/module/' . $module . '/Admin') ?>">
21    <label for="tree" class="sr-only">
22        <?= I18N::translate('Family tree') ?>
23    </label>
24    <?= view('components/select', ['name' => 'tree', 'selected' => $tree->name(), 'options' => $tree_names]) ?>
25    <input type="submit" class="btn btn-primary" value="<?= I18N::translate('show') ?>">
26</form>
27</p>
28
29<p>
30    <a href="<?= e(route('module', ['module' => 'faq', 'action' => 'AdminEdit', 'tree' => $tree->name()])) ?>" class="btn btn-link">
31        <?= view('icons/add') ?>
32        <?= /* I18N: FAQ = “Frequently Asked Question” */
33        I18N::translate('Add an FAQ') ?>
34    </a>
35</p>
36
37<table class="table table-bordered">
38    <thead>
39        <tr>
40            <th><?= I18N::translate('Sort order') ?></th>
41            <th><?= I18N::translate('Family tree') ?></th>
42            <th><?= I18N::translate('Question') ?></th>
43            <th><?= I18N::translate('Move up') ?></th>
44            <th><?= I18N::translate('Move down') ?></th>
45            <th><?= I18N::translate('Edit') ?></th>
46            <th><?= I18N::translate('Delete') ?></th>
47        </tr>
48    </thead>
49    <tbody>
50        <?php foreach ($faqs as $faq) : ?>
51            <tr class="faq_edit_pos">
52                <td>
53                    <?= I18N::number($faq->block_order + 1) ?>
54                </td>
55                <td>
56                    <?php if ($faq->gedcom_id === null) : ?>
57                        <?= I18N::translate('All') ?>
58                    <?php else : ?>
59                        <?= e($tree->title()) ?>
60                    <?php endif ?>
61                </td>
62                <td>
63                    <?= e($faq->header) ?>
64                </td>
65                <td>
66                    <?php if ($faq->block_order != $min_block_order) : ?>
67                        <a href="#" data-post-url="<?= e(route('module', ['module' => 'faq', 'action' => 'AdminMoveUp', 'block_id' => $faq->block_id])) ?>" class="btn btn-secondary">
68                            <?= view('icons/arrow-up') ?>
69                        </a>
70                    <?php endif ?>
71                </td>
72                <td>
73                    <?php if ($faq->block_order != $max_block_order) : ?>
74                        <a href="#" data-post-url="<?= e(route('module', ['module' => 'faq', 'action' => 'AdminMoveDown', 'block_id' => $faq->block_id])) ?>" class="btn btn-secondary">
75                        <?= view('icons/arrow-down') ?>
76                        </a>
77                    <?php endif ?>
78                </td>
79                <td>
80                    <a href="<?= e(route('module', ['module' => 'faq', 'action' => 'AdminEdit', 'block_id' => $faq->block_id, 'tree' => $tree->name()])) ?>" class="btn btn-primary">
81                        <?= view('icons/edit') ?>
82                    </a>
83                </td>
84                <td>
85                    <a href="#" data-post-url="<?= e(route('module', ['module' => 'faq', 'action' => 'AdminDelete', 'block_id' => $faq->block_id])) ?>" data-confirm="<?= I18N::translate('Are you sure you want to delete “%s”?', e($faq->header)) ?>" class="btn btn-danger">
86                        <?= view('icons/delete') ?>
87                    </a>
88                </td>
89            </tr>
90        <?php endforeach ?>
91    </tbody>
92</table>
93