xref: /webtrees/resources/views/edit/raw-gedcom-fact.phtml (revision b6017f990d38d8c56e04c0096ce9a7e8745ad4ba)
1<?php
2
3use Fisharebest\Webtrees\Fact;
4use Fisharebest\Webtrees\Http\RequestHandlers\EditRawFactAction;
5use Fisharebest\Webtrees\I18N;
6use Fisharebest\Webtrees\Webtrees;
7
8/**
9 * @var Fact        $fact
10 * @var string      $title
11 * @var string|null $url
12 */
13
14?>
15
16<h2 class="wt-page-title"><?= $title ?></h2>
17
18<form method="post" action="<?= e(route(EditRawFactAction::class, ['tree' => $tree->name(), 'xref' => $fact->record()->xref(), 'fact_id' => $fact->id()])) ?>" class="wt-page-content">
19    <?= csrf_field() ?>
20    <input type="hidden" name="url" value="<?= e($url ?? $fact->record()->url()) ?>">
21
22    <p class="text-muted small">
23        <?= I18N::translate('This page allows you to bypass the usual forms, and edit the underlying data directly. It is an advanced option, and you should not use it unless you understand the GEDCOM format. If you make a mistake here, it can be difficult to fix.') ?>
24    </p>
25    <p class="text-muted small">
26        <?= /* I18N: %s is a URL */ I18N::translate('You can download a copy of the GEDCOM specification from %s.', '<a href="' . e(Webtrees::GEDCOM_PDF) . '">' . e(Webtrees::GEDCOM_PDF) . '</a>') ?>
27    </p>
28
29    <div class="card my-2">
30        <label class="card-header py-1 px-2 d-flex" for="gedcom">
31            <?= $fact->summary() ?>
32        </label>
33        <textarea class="card-body form-control py-1 px-2" id="gedcom" name="gedcom" rows="<?= 5 + preg_match_all('/\n/', $fact->gedcom()) ?>" dir="ltr"><?= e($fact->gedcom()) ?></textarea>
34    </div>
35
36    <div class="row form-group">
37        <div class="col-sm-9 offset-sm-3">
38            <button class="btn btn-primary" type="submit">
39                <?= view('icons/save') ?>
40                <?= /* I18N: A button label. */ I18N::translate('save') ?>
41            </button>
42            <a class="btn btn-secondary" href="<?= e($fact->record()->url()) ?>">
43                <?= view('icons/cancel') ?>
44                <?= /* I18N: A button label. */ I18N::translate('cancel') ?>
45            </a>
46        </div>
47    </div>
48</form>
49
50