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