feat; add apply with discord btns to home page
Signed-off-by: miguel456 <me@nogueira.codes>
This commit is contained in:
@@ -84,6 +84,13 @@ class ApplicationController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function discordApply(Request $request, $vacancySlug) {
|
||||||
|
|
||||||
|
$request->session()->put('discordApplicationRedirectedSlug', $vacancySlug);
|
||||||
|
return redirect(route('discordRedirect'));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function renderApplicationForm($vacancySlug)
|
public function renderApplicationForm($vacancySlug)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
@@ -94,18 +94,33 @@
|
|||||||
|
|
||||||
<div class="card-footer text-center">
|
<div class="card-footer text-center">
|
||||||
@auth
|
@auth
|
||||||
<button {{($isEligibleForApplication) ? '' : 'disabled'}} type="button" class="btn btn-success" onclick="window.location.href='{{route('renderApplicationForm', ['vacancySlug' => $position->vacancySlug])}}'">{{__('Apply')}}</button>
|
|
||||||
|
@if ($position->requiresDiscord)
|
||||||
|
@if(Auth::user()->hasDiscordConnection())
|
||||||
|
<button {{($isEligibleForApplication) ? '' : 'disabled'}} type="button" class="btn btn-success" onclick="window.location.href='{{route('renderApplicationForm', ['vacancySlug' => $position->vacancySlug])}}'">{{__('Apply')}}</button>
|
||||||
|
@else
|
||||||
|
<button {{($isEligibleForApplication) ? '' : 'disabled'}} style="background-color: #5865F2; color: white" type="button" class="btn" onclick="window.location.href='{{route('renderApplicationForm', ['vacancySlug' => $position->vacancySlug])}}'"><i class="fab fa-discord"></i> {{__('Apply with Discord')}}</button>
|
||||||
|
@endif
|
||||||
|
@else
|
||||||
|
<button {{($isEligibleForApplication) ? '' : 'disabled'}} type="button" class="btn btn-success" onclick="window.location.href='{{route('renderApplicationForm', ['vacancySlug' => $position->vacancySlug])}}'">{{__('Apply')}}</button>
|
||||||
|
@endif
|
||||||
|
|
||||||
@if(!$isEligibleForApplication)
|
@if(!$isEligibleForApplication)
|
||||||
<span class="badge-warning badge"><i class="fa fa-info"></i> {{__('Ineligible (:days) day(s) remaining', ['days' => $eligibilityDaysRemaining])}}</span>
|
<span class="badge-warning badge"><i class="fa fa-info"></i> {{__('Ineligible (:days) day(s) remaining', ['days' => $eligibilityDaysRemaining])}}</span>
|
||||||
@endif
|
@endif
|
||||||
@endauth
|
@endauth
|
||||||
|
|
||||||
<button type="button" class="btn btn-info" onclick="$('#{{ $position->vacancySlug }}-details').modal('show')">{{__('Learn more')}}</button>
|
|
||||||
|
|
||||||
@guest
|
@guest
|
||||||
<button type="button" class="btn btn-success" onclick="window.location.href='{{route('renderApplicationForm', ['vacancySlug' => $position->vacancySlug])}}'">{{__('Apply')}}</button>
|
@if ($position->requiresDiscord)
|
||||||
|
<button style="background-color: #5865F2; color: white" type="button" class="btn" onclick="window.location.href='{{route('discord-apply', ['vacancySlug' => $position->vacancySlug])}}'"><i class="fab fa-discord"></i> {{__('Apply with Discord')}}</button>
|
||||||
|
@else
|
||||||
|
<button type="button" class="btn btn-success" onclick="window.location.href='{{route('renderApplicationForm', ['vacancySlug' => $position->vacancySlug])}}'">{{__('Apply')}}</button>
|
||||||
|
@endif
|
||||||
@endguest
|
@endguest
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-info" onclick="$('#{{ $position->vacancySlug }}-details').modal('show')">{{__('Learn more')}}</button>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@@ -98,6 +98,9 @@ Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['lo
|
|||||||
Route::get('/accounts/{accountID}/dg/process-delete/{action}', [UserController::class, 'processDeleteConfirmation'])
|
Route::get('/accounts/{accountID}/dg/process-delete/{action}', [UserController::class, 'processDeleteConfirmation'])
|
||||||
->name('processDeleteConfirmation');
|
->name('processDeleteConfirmation');
|
||||||
|
|
||||||
|
Route::get('/apply/discord/{vacancySlug}', [ApplicationController::class, 'discordApply'])
|
||||||
|
->name('discord-apply');
|
||||||
|
|
||||||
Route::group(['middleware' => ['auth', 'forcelogout', 'passwordexpiration', '2fa', 'verified']], function () {
|
Route::group(['middleware' => ['auth', 'forcelogout', 'passwordexpiration', '2fa', 'verified']], function () {
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user