xref: /webtrees/resources/views/modules/stories/edit.phtml (revision afa67798854828b1edc33dd077960ec2b18e6140)
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    <?= csrf_field() ?>
28
29    <input type="hidden" name="url" value="<?= e($url) ?>">
30
31    <div class="row form-group">
32        <label for="xref" class="col-sm-3 col-form-label">
33            <?= I18N::translate('Individual') ?>
34        </label>
35        <div class="col-sm-9">
36            <?= view('components/select-individual', ['name' => 'xref', 'individual' => $individual, 'tree' => $tree]) ?>
37        </div>
38    </div>
39
40    <div class="row form-group">
41        <label for="story-title" class="col-sm-3 col-form-label">
42            <?= I18N::translate('Story title') ?>
43        </label>
44        <div class="col-sm-9">
45            <input type="text" class="form-control" name="story_title" id="story-title" value="<?= e($story_title) ?>">
46        </div>
47    </div>
48
49    <div class="row form-group">
50        <label for="story-body" class="col-sm-3 col-form-label">
51            <?= I18N::translate('Story') ?>
52        </label>
53        <div class="col-sm-9">
54            <textarea name="story_body" id="story-body" class="html-edit form-control" rows="10"><?= e($story_body) ?></textarea>
55        </div>
56    </div>
57
58    <div class="row form-group">
59        <label class="col-sm-3 col-form-label">
60            <?= I18N::translate('Show this block for which languages') ?>
61        </label>
62        <div class="col-sm-9">
63            <?= view('edit/language-checkboxes', ['languages' => $languages]) ?>
64        </div>
65    </div>
66
67    <div class="row form-group">
68        <div class="offset-sm-3 col-sm-9">
69            <button type="submit" class="btn btn-primary">
70                <?= view('icons/save') ?>
71                <?= I18N::translate('save') ?>
72            </button>
73
74            <a href="<?= e($url ?: route('module', ['module' => 'stories', 'action' => 'Admin', 'tree' => $tree->name()])) ?>" class="btn btn-secondary">
75                <?= view('icons/cancel') ?>
76                <?= I18N::translate('cancel') ?>
77            </a>
78        </div>
79    </div>
80</form>
81