Compare commits

..

No commits in common. "b412ad3fca9c678b05f43bbba26fbb78ee68a85e" and "b330c431ab7ea60cb3c2b6ddb506e269bc2055ec" have entirely different histories.

4 changed files with 92 additions and 90 deletions

View File

@ -21,6 +21,8 @@ class ApplicationForm extends Component
public $message = '';
public $applicationUuid;
public $captcha;
public $captchaInput;
@ -69,9 +71,9 @@ class ApplicationForm extends Component
]);
}
$this->reset(['photos', 'message', 'captchaInput']);
$this->applicationUuid = (string) $application->uuid;
return redirect("/application-status/{$application->uuid}")->with('status', 'created');
$this->reset(['photos', 'message', 'captchaInput']);
}
public function render()

View File

@ -1,37 +1,49 @@
<div class="max-w-2xl w-full md:w-xl mx-auto mt-10 flex flex-col gap-6">
<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.
@if ($applicationUuid)
<flux:callout variant="success" icon="check-circle">
<flux:callout.heading>Your application has been submitted.</flux:callout.heading>
<flux:callout.text>
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
link to check the status of your application, and if everything is approved, you'll also
receive your registration token there." />
<flux:textarea wire:model="message" label="Why do you want to join? (max. 500 characters)"
placeholder="Cunny 😭" />
<flux:textarea wire:model="message" label="Why do you want to join? (max. 500 characters)"
placeholder="Cunny 😭" />
<flux:input type="file" wire:model="photos" label="Loli Photos (max. 6 files, max. 8MB per file)"
multiple />
<flux:input type="file" wire:model="photos" label="Loli Photos (max. 6 files, max. 8MB per file)"
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">
<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 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>
@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>
</form>
<flux:button class="w-full" variant="primary" wire:click="submit">Submit Application</flux:button>
</form>
@endif
</div>

View File

@ -1,5 +1,5 @@
<div wire:poll.10s="refresh">
<div class="max-w-5xl mx-auto p-6 ">
<div class="max-w-5xl mx-auto p-6">
<h1 class="text-2xl font-bold mb-4">Application Management</h1>
<div class="mb-4">
@ -16,61 +16,58 @@
</flux:callout>
@endif
<div class="bg-white dark:bg-zinc-900 shadow-md rounded-lg overflow-hidden">
<table class="min-w-full text-sm text-left text-zinc-700 dark:text-zinc-300">
<thead class="bg-zinc-100 dark:bg-zinc-950 text-xs uppercase text-zinc-500 dark:text-zinc-400">
<table class="w-full border-collapse border border-gray-300 dark:border-neutral-950 rounded-lg">
<thead class="bg-gray-100 dark:bg-neutral-900">
<tr>
<th class="px-4 py-2 text-left">UUID</th>
<th class="px-4 py-2">Status</th>
<th class="px-4 py-2">Uploads</th>
<th class="px-4 py-2">Submitted</th>
<th class="px-4 py-2">Actions</th>
</tr>
</thead>
<tbody>
@forelse ($applications as $app)
<tr>
<th class="px-4 py-2 text-left hidden md:block">UUID</th>
<th class="px-4 py-2">Status</th>
<th class="px-4 py-2">Uploads</th>
<th class="px-4 py-2">Submitted</th>
<th class="px-4 py-2">Actions</th>
</tr>
</thead>
<tbody>
@forelse ($applications as $app)
<tr class="border-b dark:border-zinc-700 hover:bg-zinc-50 dark:hover:bg-zinc-950">
<td class="px-4 py-4 font-mono text-sm hidden md:block align-middle">{{ $app->uuid }}
</td>
<td class="px-4 py-2">
@if ($app->status === 0)
<span class="text-yellow-600 font-semibold">Pending</span>
@elseif ($app->status === 1)
<span class="text-green-600 font-semibold">Approved</span>
@elseif ($app->status === 2)
<span class="text-red-600 font-semibold">Denied</span>
@endif
</td>
<td class="px-4 py-2 text-center">{{ $app->uploads->count() }}</td>
<td class="px-4 py-2 text-sm">{{ $app->created_at->diffForHumans() }}</td>
<td class="px-4 py-2">
<div class="flex flex-col xl:flex-row">
<flux:button size="sm" variant="primary"
href="{{ route('application', ['uuid' => $app->uuid]) }}">
View
</flux:button>
<td class="px-4 py-2 font-mono text-sm">{{ $app->uuid }}</td>
<td class="px-4 py-2">
@if ($app->status === 0)
<span class="text-yellow-600 font-semibold">Pending</span>
@elseif ($app->status === 1)
<span class="text-green-600 font-semibold">Approved</span>
@elseif ($app->status === 2)
<span class="text-red-600 font-semibold">Denied</span>
@endif
</td>
<td class="px-4 py-2 text-center">{{ $app->uploads->count() }}</td>
<td class="px-4 py-2 text-sm">{{ $app->created_at->diffForHumans() }}</td>
<td class="px-4 py-2">
<flux:button size="sm" variant="primary"
href="{{ route('application', ['uuid' => $app->uuid]) }}">
View
</flux:button>
@if ($app->status === 0)
<flux:button class="cursor-pointer" size="sm"
wire:click="approveApplication('{{ (string) $app->uuid }}')">
Approve
</flux:button>
<flux:button class="cursor-pointer" size="sm" variant="danger"
wire:click="rejectApplication('{{ (string) $app->uuid }}')">
Reject
</flux:button>
@endif
</td>
</tr>
@empty
<tr>
<td colspan="5" class="text-center py-4 text-gray-500">No applications found.</td>
</tr>
@endforelse
</tbody>
</table>
@if ($app->status === 0)
<flux:button class="cursor-pointer" size="sm"
wire:click="approveApplication('{{ (string) $app->uuid }}')">
Approve
</flux:button>
<flux:button class="cursor-pointer" size="sm" variant="danger"
wire:click="rejectApplication('{{ (string) $app->uuid }}')">
Reject
</flux:button>
@endif
</div>
</td>
</tr>
@empty
<tr>
<td colspan="5" class="text-center py-4 text-gray-500">No applications found.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
<div class="mt-4">
{{ $applications->links() }}
</div>

View File

@ -1,14 +1,5 @@
<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)
<flux:callout variant="warning" icon="exclamation-circle">
<flux:callout.heading>Application pending</flux:callout.heading>