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