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