xref: /webtrees/resources/views/edit/raw-gedcom-fact.phtml (revision 9db6d3cb480383d6d4c2fa55571321d4e8062394)
13b3db8adSGreg Roach<?php
23b3db8adSGreg Roach
3*9db6d3cbSGreg Roachuse Fisharebest\Webtrees\Fact;
43b3db8adSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\EditRawFactAction;
53b3db8adSGreg Roachuse Fisharebest\Webtrees\I18N;
69d7cdf93SGreg Roachuse Fisharebest\Webtrees\Webtrees;
73b3db8adSGreg Roach
8*9db6d3cbSGreg Roach/**
9*9db6d3cbSGreg Roach * @var Fact        $fact
10*9db6d3cbSGreg Roach * @var string      $title
11*9db6d3cbSGreg Roach * @var string|null $url
12*9db6d3cbSGreg Roach */
13*9db6d3cbSGreg Roach
143b3db8adSGreg Roach?>
15dd6b2bfcSGreg Roach
16dd6b2bfcSGreg Roach<h2 class="wt-page-title"><?= $title ?></h2>
17dd6b2bfcSGreg Roach
183b3db8adSGreg Roach<form method="post" action="<?= e(route(EditRawFactAction::class, ['tree' => $tree->name(), 'xref' => $fact->record()->xref(), 'fact_id' => $fact->id()])) ?>" class="wt-page-content">
19dd6b2bfcSGreg Roach    <?= csrf_field() ?>
20*9db6d3cbSGreg Roach    <input type="hidden" name="url" value="<?= e($url ?? $fact->record()->url()) ?>">
21dd6b2bfcSGreg Roach
22dd6b2bfcSGreg Roach    <p class="text-muted small">
23dd6b2bfcSGreg Roach        <?= 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.') ?>
24dd6b2bfcSGreg Roach    </p>
25dd6b2bfcSGreg Roach    <p class="text-muted small">
269d7cdf93SGreg Roach        <?= /* 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>') ?>
27dd6b2bfcSGreg Roach    </p>
28dd6b2bfcSGreg Roach
29dd6b2bfcSGreg Roach    <div class="card my-2">
30dd6b2bfcSGreg Roach        <label class="card-header py-1 px-2 d-flex" for="gedcom">
31dd6b2bfcSGreg Roach            <?= $fact->summary() ?>
32dd6b2bfcSGreg Roach        </label>
33c67a93abSGreg Roach        <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>
34dd6b2bfcSGreg Roach    </div>
35dd6b2bfcSGreg Roach
36dd6b2bfcSGreg Roach    <div class="row form-group">
37dd6b2bfcSGreg Roach        <div class="col-sm-9 offset-sm-3">
38dd6b2bfcSGreg Roach            <button class="btn btn-primary" type="submit">
39d993d560SGreg Roach                <?= view('icons/save') ?>
40dd6b2bfcSGreg Roach                <?= /* I18N: A button label. */ I18N::translate('save') ?>
41dd6b2bfcSGreg Roach            </button>
42e7766c08SGreg Roach            <a class="btn btn-secondary" href="<?= e($fact->record()->url()) ?>">
43d993d560SGreg Roach                <?= view('icons/cancel') ?>
44dd6b2bfcSGreg Roach                <?= /* I18N: A button label. */ I18N::translate('cancel') ?>
45dd6b2bfcSGreg Roach            </a>
46dd6b2bfcSGreg Roach        </div>
47dd6b2bfcSGreg Roach    </div>
48dd6b2bfcSGreg Roach</form>
49dd6b2bfcSGreg Roach
50