From 8a189196899989fd611a710bbbfc6bbbf31b73cc Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Fri, 17 Sep 2021 16:59:01 +0200 Subject: Move New Venue form to a separate partial. --- includes/admin/views/_edit_concert_form.php | 9 ++------ includes/admin/views/_new_venue_form.php | 34 +++++++++++++++++++++++++++++ includes/admin/views/giglog_admin_page.php | 11 ++++++++-- 3 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 includes/admin/views/_new_venue_form.php (limited to 'includes') diff --git a/includes/admin/views/_edit_concert_form.php b/includes/admin/views/_edit_concert_form.php index 61f2bf4..7b0164e 100644 --- a/includes/admin/views/_edit_concert_form.php +++ b/includes/admin/views/_edit_concert_form.php @@ -45,7 +45,7 @@ if (!class_exists("GiglogAdmin_EditConcertForm")) else $c = new GiglogAdmin_Concert((object)[]); - $content='

Form to create/edit concerts and venues


'; + $content='
'; $content.='
' .'
CONCERT DETAILS

' . wp_nonce_field( plugin_basename( __FILE__ ), 'giglog_edit_concert_nonce' ) @@ -71,12 +71,7 @@ if (!class_exists("GiglogAdmin_EditConcertForm")) .''.$this->user_dropdown_for_role($c,'rev2').'
'; $content.='
'; - $content.='
VENUE DETAILS

' - .'

' - .'
' - .'

' - .'
'; - $content.='
'; + return $content; } } diff --git a/includes/admin/views/_new_venue_form.php b/includes/admin/views/_new_venue_form.php new file mode 100644 index 0000000..d17f5e0 --- /dev/null +++ b/includes/admin/views/_new_venue_form.php @@ -0,0 +1,34 @@ + +// SPDX-FileCopyrightText: 2021 Harald Eilertsen +// +// SPDX-License-Identifier: AGPL-3.0-or-later + +if ( !class_exists( "GiglogAdmin_NewVenueForm" ) ) +{ + class GiglogAdmin_NewVenueForm + { + public function render() : string + { + return + '
' + . '

VENUE DETAILS

' + . '
' + . '
' + . '
' + . ' ' + . ' ' + . '
' + . '
' + . ' ' + . ' ' + . '
' + . '
' + . ' ' + . '
' + . '
' + . '' + . '
'; + } + } +} diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php index fa853fb..b7f6247 100644 --- a/includes/admin/views/giglog_admin_page.php +++ b/includes/admin/views/giglog_admin_page.php @@ -9,6 +9,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { require_once __DIR__ . '/../../venue.php'; require_once __DIR__ . '/_concerts_table.php'; require_once __DIR__ . '/_edit_concert_form.php'; + require_once __DIR__ . '/_new_venue_form.php'; class GiglogAdmin_AdminPage { @@ -52,8 +53,14 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
render(); + $edit_form = new GiglogAdmin_EditConcertForm(); + $venue_form = new GiglogAdmin_NewVenueForm(); ?> +
+

Form to create/edit concerts and venues

+
+
+ render() . $venue_form->render(); ?> +