xref: /webtrees/resources/views/edit/raw-gedcom-fact.phtml (revision 0e3117798ee1781780c6cc2f31abb8b65e3655ac)
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' => $fact->record()->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    <div class="form-text">
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    </div>
25    <div class="form-text">
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    </div>
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 mb-3">
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