Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fisharebest committed Aug 8, 2020
1 parent 1654344 commit c531f07
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/Http/RequestHandlers/EditFactPage.php
Expand Up @@ -77,7 +77,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
'fact' => $fact,
'title' => $title,
'tree' => $tree,
'url' => $request->getQueryParams()['url'] ?? null,
'url' => $request->getQueryParams()['url'] ?? $record->url(),
]);
}
}
13 changes: 6 additions & 7 deletions resources/views/edit/edit-fact.phtml
Expand Up @@ -11,11 +11,10 @@ use Fisharebest\Webtrees\Tree;
use Ramsey\Uuid\Uuid;

/**
* @var bool $can_edit_raw
* @var Fact $fact
* @var string $title
* @var Tree $tree
* @var string|null $url
* @var bool $can_edit_raw
* @var Fact $fact
* @var string $title
* @var Tree $tree
*/

?>
Expand All @@ -24,7 +23,7 @@ use Ramsey\Uuid\Uuid;

<form method="post" action="<?= e(route(EditFactAction::class, ['tree' => $tree->name(), 'xref' => $fact->record()->xref(), 'fact_id' => $fact->id()])) ?>" class="wt-page-content">
<?= csrf_field() ?>
<input type="hidden" name="url" value="<?= e($url ?? $fact->record()->url()) ?>">
<input type="hidden" name="url" value="<?= e($url) ?>">

<?php FunctionsEdit::createEditForm($fact) ?>

Expand Down Expand Up @@ -135,7 +134,7 @@ use Ramsey\Uuid\Uuid;
I18N::translate('cancel') ?>
</a>
<?php if ($can_edit_raw) : ?>
<a class="btn btn-link" href="<?= e(route(EditRawFactPage::class, ['xref' => $fact->record()->xref(), 'fact_id' => $fact->id(), 'tree' => $tree->name(), 'url' => $url ?? $fact->record()->url()])) ?>">
<a class="btn btn-link" href="<?= e(route(EditRawFactPage::class, ['xref' => $fact->record()->xref(), 'fact_id' => $fact->id(), 'tree' => $tree->name(), 'url' => $url])) ?>">
<?= I18N::translate('Edit the raw GEDCOM') ?>
</a>
<?php endif; ?>
Expand Down

0 comments on commit c531f07

Please sign in to comment.