Skip to content

Commit

Permalink
Added custom button text and URL fields for the banner section that c…
Browse files Browse the repository at this point in the history
…an be changed on the plugin settings page
  • Loading branch information
Taquthh committed Nov 23, 2024
1 parent 66d4f71 commit 971c82f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,30 +53,30 @@ class="text-color animate-slideUp delay-100 text-3xl md:text-4xl lg:text-5xl xl:

<div class="animate-slideUp delay-400 flex flex-col sm:flex-row space-y-4 sm:space-y-0 sm:space-x-4 mt-8">
@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

<a href="<?php echo $submissionRoute; ?>"
<a href="{{ $button1 }}"
class="banner-submission group relative inline-flex items-center justify-center px-8 py-3 overflow-hidden font-medium text-white bg-gradient-to-r from-purple-600 to-blue-500 rounded-lg shadow-md transition-all duration-300 ease-out hover:scale-105 hover:shadow-lg">
<span class="flex items-center">
Submission
{{ $button1Text }}
<svg class="w-5 h-5 ml-2 transform group-hover:translate-x-1 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
</svg>
</span>
</a>

<a href="<?php echo $registerRoute; ?>"
<a href="{{ $button2 }}"
class="banner-register group relative inline-flex items-center justify-center px-8 py-3 overflow-hidden font-medium bg-white text-purple-600 rounded-lg shadow-md transition-all duration-300 ease-out hover:scale-105 hover:bg-purple-50">
<span class="flex items-center">
Register
{{ $button2Text }}
<svg class="w-5 h-5 ml-2 transform group-hover:translate-x-1 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
</svg>
</span>
</a>
</div>
</div>
</div>
</div>
</div>
Expand Down
22 changes: 22 additions & 0 deletions src/TempestTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)'),

];
}

Expand Down Expand Up @@ -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
];
}
}

0 comments on commit 971c82f

Please sign in to comment.