xref: /webtrees/resources/views/modules/faq/config.phtml (revision 81443e3cbe4eef5ccdcf8dae716a7e35f7417b60)
171378461SGreg Roach<?php
271378461SGreg Roach
30c0910bfSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
43213013eSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ModulesAllPage;
571378461SGreg Roachuse Fisharebest\Webtrees\I18N;
67c2c99faSGreg Roachuse Fisharebest\Webtrees\Tree;
77c2c99faSGreg Roachuse Illuminate\Support\Collection;
87c2c99faSGreg Roach
97c2c99faSGreg Roach/**
1036779af1SGreg Roach * @var Collection<int,object> $faqs
117c2c99faSGreg Roach * @var string                 $max_block_order
127c2c99faSGreg Roach * @var string                 $min_block_order
137c2c99faSGreg Roach * @var string                 $title
147c2c99faSGreg Roach * @var Tree                   $tree
157c2c99faSGreg Roach * @var array<string,string>   $tree_names
167c2c99faSGreg Roach */
1771378461SGreg Roach
1871378461SGreg Roach?>
19dd6b2bfcSGreg Roach
203213013eSGreg Roach<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route(ModulesAllPage::class) => I18N::translate('Modules'), $title]]) ?>
21dd6b2bfcSGreg Roach
22dd6b2bfcSGreg Roach<h1><?= $title ?></h1>
23dd6b2bfcSGreg Roach
24dd6b2bfcSGreg Roach<p>
25dd6b2bfcSGreg Roach    <?= /* I18N: FAQ = “Frequently Asked Question” */
26dd6b2bfcSGreg 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.') ?>
27dd6b2bfcSGreg Roach    <?= I18N::translate('You may use HTML to format the answer and to add links to other websites.') ?>
28dd6b2bfcSGreg Roach</p>
29dd6b2bfcSGreg Roach
30315eb316SGreg Roach<form method="post" class="row">
31315eb316SGreg Roach    <div class="col-auto">
32315eb316SGreg Roach        <div class="input-group">
33315eb316SGreg Roach            <?= view('components/select', ['name' => 'tree', 'selected' => $tree->name(), 'options' => $tree_names, 'aria_label' => I18N::translate('Family tree')]) ?>
34dd6b2bfcSGreg Roach            <input type="submit" class="btn btn-primary" value="<?= I18N::translate('show') ?>">
35315eb316SGreg Roach        </div>
36315eb316SGreg Roach    </div>
37*81443e3cSGreg Roach
38*81443e3cSGreg Roach    <?= csrf_field() ?>
39dd6b2bfcSGreg Roach</form>
40dd6b2bfcSGreg Roach
41dd6b2bfcSGreg Roach<p>
42d72b284aSGreg Roach    <a href="<?= e(route('module', ['module' => 'faq', 'action' => 'AdminEdit', 'tree' => $tree->name()])) ?>" class="btn btn-link">
43dd6b2bfcSGreg Roach        <?= view('icons/add') ?>
44dd6b2bfcSGreg Roach        <?= /* I18N: FAQ = “Frequently Asked Question” */
45dd6b2bfcSGreg Roach        I18N::translate('Add an FAQ') ?>
46dd6b2bfcSGreg Roach    </a>
47dd6b2bfcSGreg Roach</p>
48dd6b2bfcSGreg Roach
49dd6b2bfcSGreg Roach<table class="table table-bordered">
50315eb316SGreg Roach    <caption>
51315eb316SGreg Roach        <?= I18N::translate('Frequently asked questions') ?>
52315eb316SGreg Roach    </caption>
53315eb316SGreg Roach
54dd6b2bfcSGreg Roach    <thead>
55dd6b2bfcSGreg Roach        <tr>
56dd6b2bfcSGreg Roach            <th><?= I18N::translate('Sort order') ?></th>
57dd6b2bfcSGreg Roach            <th><?= I18N::translate('Family tree') ?></th>
58dd6b2bfcSGreg Roach            <th><?= I18N::translate('Question') ?></th>
591d1f373cSGreg Roach            <th><?= I18N::translate('Move up') ?></th>
601d1f373cSGreg Roach            <th><?= I18N::translate('Move down') ?></th>
611d1f373cSGreg Roach            <th><?= I18N::translate('Edit') ?></th>
621d1f373cSGreg Roach            <th><?= I18N::translate('Delete') ?></th>
63dd6b2bfcSGreg Roach        </tr>
64dd6b2bfcSGreg Roach    </thead>
65315eb316SGreg Roach
66dd6b2bfcSGreg Roach    <tbody>
67dd6b2bfcSGreg Roach        <?php foreach ($faqs as $faq) : ?>
68dd6b2bfcSGreg Roach            <tr class="faq_edit_pos">
69dd6b2bfcSGreg Roach                <td>
70f118193aSGreg Roach                    <?= I18N::number($faq->block_order) ?>
71dd6b2bfcSGreg Roach                </td>
72dd6b2bfcSGreg Roach                <td>
73dd6b2bfcSGreg Roach                    <?php if ($faq->gedcom_id === null) : ?>
74dd6b2bfcSGreg Roach                        <?= I18N::translate('All') ?>
75dd6b2bfcSGreg Roach                    <?php else : ?>
76cc13d6d8SGreg Roach                        <?= e($tree->title()) ?>
77dd6b2bfcSGreg Roach                    <?php endif ?>
78dd6b2bfcSGreg Roach                </td>
79dd6b2bfcSGreg Roach                <td>
80dd6b2bfcSGreg Roach                    <?= e($faq->header) ?>
81dd6b2bfcSGreg Roach                </td>
82dd6b2bfcSGreg Roach                <td>
837c2c99faSGreg Roach                    <?php if ($faq->block_order !== $min_block_order) : ?>
84d4786c66SGreg Roach                        <a href="#" data-wt-post-url="<?= e(route('module', ['module' => 'faq', 'action' => 'AdminMoveUp', 'block_id' => $faq->block_id])) ?>" class="btn btn-secondary">
85dd6b2bfcSGreg Roach                            <?= view('icons/arrow-up') ?>
861d1f373cSGreg Roach                        </a>
87dd6b2bfcSGreg Roach                    <?php endif ?>
88dd6b2bfcSGreg Roach                </td>
89dd6b2bfcSGreg Roach                <td>
907c2c99faSGreg Roach                    <?php if ($faq->block_order !== $max_block_order) : ?>
91d4786c66SGreg Roach                        <a href="#" data-wt-post-url="<?= e(route('module', ['module' => 'faq', 'action' => 'AdminMoveDown', 'block_id' => $faq->block_id])) ?>" class="btn btn-secondary">
92dd6b2bfcSGreg Roach                        <?= view('icons/arrow-down') ?>
931d1f373cSGreg Roach                        </a>
94dd6b2bfcSGreg Roach                    <?php endif ?>
95dd6b2bfcSGreg Roach                </td>
96dd6b2bfcSGreg Roach                <td>
97315eb316SGreg Roach                    <a href="<?= e(route('module', ['module' => 'faq', 'action' => 'AdminEdit', 'block_id' => $faq->block_id, 'tree' => $tree->name()])) ?>" aria-label="<?= I18N::translate('Edit') ?>" class="btn btn-primary">
98dd6b2bfcSGreg Roach                        <?= view('icons/edit') ?>
99dd6b2bfcSGreg Roach                    </a>
100dd6b2bfcSGreg Roach                </td>
101dd6b2bfcSGreg Roach                <td>
102d4786c66SGreg Roach                    <a href="#" data-wt-post-url="<?= e(route('module', ['module' => 'faq', 'action' => 'AdminDelete', 'block_id' => $faq->block_id])) ?>" data-wt-confirm="<?= I18N::translate('Are you sure you want to delete “%s”?', e($faq->header)) ?>" aria-label="<?= I18N::translate('Delete') ?>" class="btn btn-danger">
103dd6b2bfcSGreg Roach                        <?= view('icons/delete') ?>
1041d1f373cSGreg Roach                    </a>
105dd6b2bfcSGreg Roach                </td>
106dd6b2bfcSGreg Roach            </tr>
107dd6b2bfcSGreg Roach        <?php endforeach ?>
108dd6b2bfcSGreg Roach    </tbody>
109dd6b2bfcSGreg Roach</table>
110