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