From 971c82f633ad2428440389780f74cc93ba1374ab Mon Sep 17 00:00:00 2001 From: Taquthh Date: Sat, 23 Nov 2024 09:30:04 +0800 Subject: [PATCH] Added custom button text and URL fields for the banner section that can be changed on the plugin settings page --- .../components/layouts/banner.blade.php | 18 +++++++-------- src/TempestTheme.php | 22 +++++++++++++++++++ 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/resources/views/frontend/website/components/layouts/banner.blade.php b/resources/views/frontend/website/components/layouts/banner.blade.php index c848ddf..348ad9a 100644 --- a/resources/views/frontend/website/components/layouts/banner.blade.php +++ b/resources/views/frontend/website/components/layouts/banner.blade.php @@ -53,30 +53,30 @@ class="text-color animate-slideUp delay-100 text-3xl md:text-4xl lg:text-5xl xl:
@php - $submissionRoute = route(App\Panel\ScheduledConference\Resources\SubmissionResource\Pages\ManageSubmissions::getRouteName(App\Providers\PanelProvider::PANEL_SCHEDULED_CONFERENCE)); - $registerRoute = route(App\Frontend\ScheduledConference\Pages\ParticipantRegister::getRouteName('scheduledConference')); + $button1 = App\Facades\Plugin::getPlugin('Tempest')->getSetting('button_first') ?? route(App\Panel\ScheduledConference\Resources\SubmissionResource\Pages\ManageSubmissions::getRouteName(App\Providers\PanelProvider::PANEL_SCHEDULED_CONFERENCE));; + $button2 = App\Facades\Plugin::getPlugin('Tempest')->getSetting('button_second') ?? route(App\Frontend\ScheduledConference\Pages\ParticipantRegister::getRouteName('scheduledConference')); + $button1Text =App\Facades\Plugin::getPlugin('Tempest')->getSetting('button_first_text') ?? 'Submission' ; + $button2Text = App\Facades\Plugin::getPlugin('Tempest')->getSetting('button_second_text') ?? 'Register' ; @endphp - - - - -
+ diff --git a/src/TempestTheme.php b/src/TempestTheme.php index 61de44a..ab96bbb 100644 --- a/src/TempestTheme.php +++ b/src/TempestTheme.php @@ -76,6 +76,24 @@ public function getFormSchema(): array ->reorderableWithButtons() ->collapsible() ->reorderableWithDragAndDrop(True), + TextInput::make('button_first_text') + ->label('Button 1 Text (Default: Submission)') + ->hint('Enter the text for the first button on the banner. By default, it is labeled "Submission".') + ->placeholder('Enter the text for button 1'), + + TextInput::make('button_first') + ->label('Button 1 URL') + ->placeholder('Enter the URL for the first button (e.g., https://example.com)'), + + TextInput::make('button_second_text') + ->label('Button 2 Text (Default: Register)') + ->hint('Enter the text for the second button on the banner. By default, it is labeled "Register".') + ->placeholder('Enter the text for button 2'), + + TextInput::make('button_second') + ->label('Button 2 URL') + ->placeholder('Enter the URL for the second button (e.g., https://example.com)'), + ]; } @@ -140,6 +158,10 @@ public function getFormData(): array 'appearance_color' => $this->getSetting('appearance_color'), 'secondary_color' => $this->getSetting('secondary_color'), 'text_color' => $this->getSetting('text_color'), + 'button_first' => $this->getSetting('button_first'), + 'button_second' => $this->getSetting('button_second'), + 'button_first_text' => $this->getSetting('button_first_text'), // Add this line + 'button_second_text' => $this->getSetting('button_second_text'), // Add this line ]; } }