From 77e64c23263808925f73b5b468f46e845332137e Mon Sep 17 00:00:00 2001 From: Ben Thomson Date: Wed, 28 Aug 2024 20:58:31 +0800 Subject: [PATCH] Allow toggling to preview context in People form Test case for https://github.com/wintercms/winter/issues/1065 --- controllers/people/_form_toggle.htm | 13 +++++++++---- controllers/people/preview.htm | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/controllers/people/_form_toggle.htm b/controllers/people/_form_toggle.htm index 0254122..4795cf1 100644 --- a/controllers/people/_form_toggle.htm +++ b/controllers/people/_form_toggle.htm @@ -1,7 +1,7 @@ exists - ? 'winter/test/people/update/'.$formModel->id - : 'winter/test/people/create'; + $uriPrefix = ($formContext === 'create') + ? 'winter/test/people/create' + : 'winter/test/people/' . $formContext . '/' . $formModel->id; ?>
@@ -10,9 +10,14 @@

Alternate views

-
\ No newline at end of file + diff --git a/controllers/people/preview.htm b/controllers/people/preview.htm index 7fa5602..1b52ba3 100644 --- a/controllers/people/preview.htm +++ b/controllers/people/preview.htm @@ -7,6 +7,8 @@ fatalError): ?> + makePartial('form_toggle') ?> +
formRenderPreview() ?>