xref: /webtrees/resources/views/edit/edit-fact.phtml (revision 98ebe5e457a6f4c1618b893965b4a0f135dc8b4b)
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 $gedcom
13 * @var string $hidden_url
14 * @var string $title
15 * @var Tree   $tree
16 * @var string $url
17 */
18
19?>
20
21<h2 class="wt-page-title"><?= $title ?></h2>
22
23<form method="post" action="<?= e(route(EditFactAction::class, ['tree' => $tree->name(), 'xref' => $fact->record()->xref(), 'fact_id' => $fact->id()])) ?>" class="wt-page-content">
24    <input type="hidden" name="url" value="<?= e($url) ?>">
25
26    <?= view('edit/edit-gedcom-fields', ['gedcom' => $gedcom, 'hierarchy' => explode(':', $fact->tag()), 'tree' => $fact->record()->tree(), 'prefix' => '']) ?>
27
28    <div class="row mb-3">
29        <div class="col-sm-3 wt-page-options-label">
30        </div>
31        <div class="col-sm-9 wt-page-options-value">
32            <div class="mb-3">
33                <?= view('components/checkbox', ['label' => I18N::translate('Keep the existing “last change” information'), 'name' => 'keep_chan', 'checked' => (bool) $tree->getPreference('NO_UPDATE_CHAN')]) ?>
34            </div>
35
36            <button class="btn btn-primary" type="submit">
37                <?= view('icons/save') ?>
38                <?= /* I18N: A button label. */
39                I18N::translate('save') ?>
40            </button>
41
42            <a class="btn btn-secondary" href="<?= e($url) ?>">
43                <?= view('icons/cancel') ?>
44                <?= /* I18N: A button label. */
45                I18N::translate('cancel') ?>
46            </a>
47
48            <?php if ($hidden_url !== '') : ?>
49                <a class="btn btn-link" href="<?= e($hidden_url) ?>">
50                    <?= I18N::translate('Edit with all GEDCOM tags') ?>
51                </a>
52            <?php endif; ?>
53
54            <?php if ($can_edit_raw) : ?>
55                <a class="btn btn-link" href="<?= e(route(EditRawFactPage::class, ['xref' => $fact->record()->xref(), 'fact_id' => $fact->id(), 'tree' => $tree->name(), 'url' => $url])) ?>">
56                    <?= I18N::translate('Edit the raw GEDCOM') ?>
57                </a>
58            <?php endif; ?>
59        </div>
60    </div>
61
62    <?= csrf_field() ?>
63</form>
64
65<?= view('modals/on-screen-keyboard') ?>
66<?= view('modals/ajax') ?>
67<?= view('edit/initialize-calendar-popup') ?>
68