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