xref: /webtrees/resources/views/edit/edit-fact.phtml (revision 273a564e3de4d5154e894fa56a60fe99383cf8b2)
1<?php
2
3use Fisharebest\Webtrees\Fact;
4use Fisharebest\Webtrees\Http\RequestHandlers\EditFactAction;
5use Fisharebest\Webtrees\Http\RequestHandlers\EditRawFactPage;
6use Fisharebest\Webtrees\I18N;
7use Fisharebest\Webtrees\Tree;
8
9/**
10 * @var bool   $can_edit_raw
11 * @var Fact   $fact
12 * @var string $title
13 * @var Tree   $tree
14 * @var string $url
15 */
16
17?>
18
19<h2 class="wt-page-title"><?= $title ?></h2>
20
21<form method="post" action="<?= e(route(EditFactAction::class, ['tree' => $tree->name(), 'xref' => $fact->record()->xref(), 'fact_id' => $fact->id()])) ?>" class="wt-page-content">
22    <?= csrf_field() ?>
23    <input type="hidden" name="url" value="<?= e($url) ?>">
24
25    <?= view('edit/edit-gedcom-fields', ['gedcom' => $fact->insertMissingSubtags(), 'hierarchy' => explode(':', $fact->tag()), 'tree' => $fact->record()->tree(), 'prefix' => '']) ?>
26
27    <div class="form-group row">
28        <div class="col-sm-3 wt-page-options-label">
29        </div>
30        <div class="col-sm-9 wt-page-options-value">
31            <div class="form-group">
32                <?= view('components/checkbox', ['label' => I18N::translate('Keep the existing “last change” information'), 'name' => 'keep_chan', 'checked' => (bool) $tree->getPreference('NO_UPDATE_CHAN')]) ?>
33            </div>
34
35            <button class="btn btn-primary" type="submit">
36                <?= view('icons/save') ?>
37                <?= /* I18N: A button label. */
38                I18N::translate('save') ?>
39            </button>
40            <a class="btn btn-secondary" href="<?= e($url) ?>">
41                <?= view('icons/cancel') ?>
42                <?= /* I18N: A button label. */
43                I18N::translate('cancel') ?>
44            </a>
45            <?php if ($can_edit_raw) : ?>
46                <a class="btn btn-link" href="<?= e(route(EditRawFactPage::class, ['xref' => $fact->record()->xref(), 'fact_id' => $fact->id(), 'tree' => $tree->name(), 'url' => $url])) ?>">
47                    <?= I18N::translate('Edit the raw GEDCOM') ?>
48                </a>
49            <?php endif; ?>
50        </div>
51    </div>
52</form>
53
54<?= view('modals/on-screen-keyboard') ?>
55<?= view('modals/ajax') ?>
56<?= view('edit/initialize-calendar-popup') ?>
57