xref: /webtrees/resources/views/modules/stories/edit.phtml (revision 3f0247b283a74c64ac885446380ea81de9cf779e)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
4use Fisharebest\Webtrees\Http\RequestHandlers\ModulesAllPage;
5use Fisharebest\Webtrees\I18N;
6use Fisharebest\Webtrees\Individual;
7use Fisharebest\Webtrees\Tree;
8
9/**
10 * @var int           $block_id
11 * @var Individual    $individual
12 * @var array<string> $languages
13 * @var string        $story_body
14 * @var string        $story_title
15 * @var string        $title
16 * @var Tree          $tree
17 * @var string        $url
18 */
19
20?>
21
22<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route(ModulesAllPage::class) => I18N::translate('Modules'), route('module', ['module' => 'stories', 'action' => 'Admin', 'tree' => $tree->name()]) => I18N::translate('Stories'), $title]]) ?>
23
24<h1><?= $title ?></h1>
25
26<form method="post" action="<?= e(route('module', ['module' => 'stories', 'action' => 'AdminEdit', 'block_id' => $block_id, 'tree' => $tree->name()])) ?>" class="form-horizontal">
27    <input type="hidden" name="url" value="<?= e($url) ?>">
28
29    <div class="row mb-3">
30        <label for="xref" class="col-sm-3 col-form-label">
31            <?= I18N::translate('Individual') ?>
32        </label>
33        <div class="col-sm-9">
34            <?= view('components/select-individual', ['name' => 'xref', 'individual' => $individual, 'tree' => $tree]) ?>
35        </div>
36    </div>
37
38    <div class="row mb-3">
39        <label for="story-title" class="col-sm-3 col-form-label">
40            <?= I18N::translate('Story title') ?>
41        </label>
42        <div class="col-sm-9">
43            <input type="text" class="form-control" name="story_title" id="story-title" value="<?= e($story_title) ?>">
44        </div>
45    </div>
46
47    <div class="row mb-3">
48        <label for="story-body" class="col-sm-3 col-form-label">
49            <?= I18N::translate('Story') ?>
50        </label>
51        <div class="col-sm-9">
52            <textarea name="story_body" id="story-body" class="html-edit form-control" rows="10"><?= e($story_body) ?></textarea>
53        </div>
54    </div>
55
56    <div class="row mb-3">
57        <label class="col-sm-3 col-form-label">
58            <?= I18N::translate('Show this block for which languages') ?>
59        </label>
60        <div class="col-sm-9">
61            <?= view('edit/language-checkboxes', ['languages' => $languages]) ?>
62        </div>
63    </div>
64
65    <div class="row mb-3">
66        <div class="offset-sm-3 col-sm-9">
67            <button type="submit" class="btn btn-primary">
68                <?= view('icons/save') ?>
69                <?= I18N::translate('save') ?>
70            </button>
71
72            <a href="<?= e($url ?: route('module', ['module' => 'stories', 'action' => 'Admin', 'tree' => $tree->name()])) ?>" class="btn btn-secondary">
73                <?= view('icons/cancel') ?>
74                <?= I18N::translate('cancel') ?>
75            </a>
76        </div>
77    </div>
78
79    <?= csrf_field() ?>
80</form>
81