Redirect to status page if application has been submitted
This commit is contained in:
parent
b18c5c42bf
commit
b412ad3fca
@ -21,8 +21,6 @@ class ApplicationForm extends Component
|
|||||||
|
|
||||||
public $message = '';
|
public $message = '';
|
||||||
|
|
||||||
public $applicationUuid;
|
|
||||||
|
|
||||||
public $captcha;
|
public $captcha;
|
||||||
|
|
||||||
public $captchaInput;
|
public $captchaInput;
|
||||||
@ -71,9 +69,9 @@ class ApplicationForm extends Component
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->applicationUuid = (string) $application->uuid;
|
|
||||||
|
|
||||||
$this->reset(['photos', 'message', 'captchaInput']);
|
$this->reset(['photos', 'message', 'captchaInput']);
|
||||||
|
|
||||||
|
return redirect("/application-status/{$application->uuid}")->with('status', 'created');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
|
@ -1,49 +1,37 @@
|
|||||||
<div class="max-w-2xl w-full md:w-xl mx-auto mt-10 flex flex-col gap-6">
|
<div class="max-w-2xl w-full md:w-xl mx-auto mt-10 flex flex-col gap-6">
|
||||||
@if ($applicationUuid)
|
<form wire:submit.prevent="submit" enctype="multipart/form-data">
|
||||||
<flux:callout variant="success" icon="check-circle">
|
<div class="flex flex-col gap-4 mb-6">
|
||||||
<flux:callout.heading>Your application has been submitted.</flux:callout.heading>
|
<flux:callout variant="secondary" icon="information-circle" heading="Here you can submit your application."
|
||||||
<flux:callout.text>
|
text="To apply, simply fill out the form below and upload at least one loli photo.
|
||||||
You can check its status here: <flux:callout.link
|
|
||||||
href="{{ route('application', ['uuid' => $applicationUuid]) }}">View Application Status
|
|
||||||
</flux:callout.link>
|
|
||||||
<br>Please save or bookmark that link, as the approval process can take 24-48 hours.
|
|
||||||
</flux:callout.text>
|
|
||||||
</flux:callout>
|
|
||||||
@else
|
|
||||||
<form wire:submit.prevent="submit" enctype="multipart/form-data">
|
|
||||||
<div class="flex flex-col gap-4 mb-6">
|
|
||||||
<flux:callout variant="secondary" icon="information-circle" heading="Here you can submit your application."
|
|
||||||
text="To apply, simply fill out the form below and upload at least one loli photo.
|
|
||||||
After submitting, you'll receive a unique link — make sure to save it! You can use that
|
After submitting, you'll receive a unique link — make sure to save it! You can use that
|
||||||
link to check the status of your application, and if everything is approved, you'll also
|
link to check the status of your application, and if everything is approved, you'll also
|
||||||
receive your registration token there." />
|
receive your registration token there." />
|
||||||
|
|
||||||
<flux:textarea wire:model="message" label="Why do you want to join? (max. 500 characters)"
|
<flux:textarea wire:model="message" label="Why do you want to join? (max. 500 characters)"
|
||||||
placeholder="Cunny 😭" />
|
placeholder="Cunny 😭" />
|
||||||
|
|
||||||
<flux:input type="file" wire:model="photos" label="Loli Photos (max. 6 files, max. 8MB per file)"
|
<flux:input type="file" wire:model="photos" label="Loli Photos (max. 6 files, max. 8MB per file)"
|
||||||
multiple />
|
multiple />
|
||||||
|
|
||||||
@if ($photos)
|
|
||||||
<div class="mt-4">
|
|
||||||
<flux:heading>Photo Preview</flux:heading>
|
|
||||||
<div class="flex gap-4 mt-2">
|
|
||||||
@foreach ($photos as $photo)
|
|
||||||
<img src="{{ $photo->temporaryUrl() }}" class="w-24 h-24 object-cover rounded">
|
|
||||||
@endforeach
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
|
@if ($photos)
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<div class="flex">
|
<flux:heading>Photo Preview</flux:heading>
|
||||||
<flux:input label="Captcha" wire:model.defer="captchaInput" />
|
<div class="flex gap-4 mt-2">
|
||||||
<img src="{{ $captcha }}" alt="captcha" wire:click="refreshCaptcha"
|
@foreach ($photos as $photo)
|
||||||
class="cursor-pointer ml-3 mt-7 h-10 rounded-lg">
|
<img src="{{ $photo->temporaryUrl() }}" class="w-24 h-24 object-cover rounded">
|
||||||
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<div class="mt-4">
|
||||||
|
<div class="flex">
|
||||||
|
<flux:input label="Captcha" wire:model.defer="captchaInput" />
|
||||||
|
<img src="{{ $captcha }}" alt="captcha" wire:click="refreshCaptcha"
|
||||||
|
class="cursor-pointer ml-3 mt-7 h-10 rounded-lg">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<flux:button class="w-full" variant="primary" wire:click="submit">Submit Application</flux:button>
|
</div>
|
||||||
</form>
|
<flux:button class="w-full" variant="primary" wire:click="submit">Submit Application</flux:button>
|
||||||
@endif
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<div wire:poll.10s="loadApplication" class="max-w-2xl w-full md:w-xl mx-auto mt-10 flex flex-col gap-6">
|
<div wire:poll.10s="loadApplication" class="max-w-2xl w-full md:w-xl mx-auto mt-10 flex flex-col gap-6">
|
||||||
|
|
||||||
|
@if (session('status'))
|
||||||
|
<flux:callout variant="success" icon="check-circle">
|
||||||
|
<flux:callout.heading>Your application has been submitted.</flux:callout.heading>
|
||||||
|
<flux:callout.text>
|
||||||
|
Please bookmark this page, as the approval process can take up to 24 hours.
|
||||||
|
</flux:callout.text>
|
||||||
|
</flux:callout>
|
||||||
|
@endif
|
||||||
|
|
||||||
@if ($application->status === 0)
|
@if ($application->status === 0)
|
||||||
<flux:callout variant="warning" icon="exclamation-circle">
|
<flux:callout variant="warning" icon="exclamation-circle">
|
||||||
<flux:callout.heading>Application pending</flux:callout.heading>
|
<flux:callout.heading>Application pending</flux:callout.heading>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user