Skip to content

Commit

Permalink
fix(application): inconsistent UX for accepting invites
Browse files Browse the repository at this point in the history
  • Loading branch information
Fenrikur committed Mar 4, 2024
1 parent 97f5325 commit 8eac85a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
24 changes: 14 additions & 10 deletions resources/views/dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
@if (!$application?->isActive() ?? false)
<p class="lead mb-4">
@if ($registration)
You are <strong>registered</strong> for this year's Eurofurence with <em>badge number {{$registration['id']}}</em> and your registration status is <em>{{$registration['status']}}</em>.
You are <strong>registered</strong> for this year's Eurofurence with <em>badge number
{{ $registration['id'] }}</em> and your registration status is
<em>{{ $registration['status'] }}</em>.
@else
You currently do not seem to be registered for this year's Eurofurence.
@endif
Expand Down Expand Up @@ -130,7 +132,8 @@
if you wish to be an assistant at the Dealers' Den!
@else
Please make sure to <em>register for this year's Eurofurence before
{{ Carbon\Carbon::parse(config('con.reg_end_date'))->format('d.m.Y H:i') }}</em>, if you
{{ Carbon\Carbon::parse(config('con.reg_end_date'))->format('d.m.Y H:i') }}</em>, if
you
wish for your application to be taken into consideration for the Dealers' Den!
@endif
@else
Expand All @@ -146,7 +149,7 @@

<div class="row">
@if (isset($application) && $application->isActive())
<div class="col-md-6">
<div class="col-md-6 mx-auto">
<div class="card mb-2">
<div class="card-body text-center">
<h5 class="card-title display-6">Manage your Registration</h5>
Expand Down Expand Up @@ -189,15 +192,16 @@ class="btn btn-sm btn-outline-primary">Assistants & Shares</a>
</div>
</div>
@endif
<div class="col-md-6 mx-auto">
@if (Carbon\Carbon::parse(config('con.reg_end_date'))->isFuture() ||
Carbon\Carbon::parse(config('con.assistant_end_date'))->isFuture())
@if (Carbon\Carbon::parse(config('con.reg_end_date'))->isFuture() ||
Carbon\Carbon::parse(config('con.assistant_end_date'))->isFuture())
<div class="col-md-6 mx-auto">
<div class="card mb-2">
<form action="{{ route('invitation.join') }}" method="post">
<div class="card-body text-center">
<h5 class="card-title display-6">Join an existing Dealership</h5>
<p class="card-text lead">You have been invited by an existing dealership to share their space
or assist them at the Dealers’ Den?<br>
<p class="card-text lead">You have been invited by an existing dealership to
@if(Carbon\Carbon::parse(config('con.reg_end_date'))->isFuture())share their space or @endif
assist them at the Dealers’ Den?<br>
Then enter the invite code they provided you with below!
</p>
<div class="input-group input-group-lg has-validation">
Expand All @@ -213,8 +217,8 @@ class="form-control @error('code') is-invalid @enderror" placeholder="Invite Cod
@csrf
</form>
</div>
@endif
</div>
</div>
@endif
</div>

</div>
Expand Down
10 changes: 5 additions & 5 deletions resources/views/forms/application.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<input type="hidden" name="code" value="{{ $code }}">
<input type="hidden" name="applicationType" value="{{ $applicationType->value }}">
@if (
!is_null($application->type) &&
$application->type === \App\Enums\ApplicationType::Dealer &&
($application?->isActive() ?? false) &&
$application?->type === \App\Enums\ApplicationType::Dealer &&
($applicationType === \App\Enums\ApplicationType::Assistant ||
($applicationType === $application->type) === \App\Enums\ApplicationType::Share))
$applicationType === \App\Enums\ApplicationType::Share))
<div class="row">
<div class="col-md-12 text-center">
<div class="alert alert-warning">
Expand All @@ -34,7 +34,7 @@
<div class="row mb-3">
<label for="email" class="col-sm-2 col-form-label fw-bold">Role</label>
<div class="col-sm-10 col-form-label">
@if (!is_null($application->type) && $application->type !== $applicationType)
@if (($application?->isActive() ?? false) && !is_null($application->type) && $application->type !== $applicationType)
Updates
<span
class="badge bg-primary">{{ \Illuminate\Support\Str::ucfirst($application->type->value) }}</span>
Expand Down Expand Up @@ -185,7 +185,7 @@ class="form-control @error('merchandise') is-invalid @enderror" aria-required="t
<div class="col-sm-10 offset-sm-2">
<div class="form-check">
<input class="form-check-input" name="additionalSpaceRequest" role="switch"
@checked(old('_token') ? old('additionalSpaceRequest') : !empty($application?->additional_space_request)) type="checkbox" id="additionalSpaceRequest">
@checked(old('_token') ? old('additionalSpaceRequest') : !empty($application?->additional_space_request)) @disabled(Carbon\Carbon::parse(config('con.reg_end_date'))->isPast()) type="checkbox" id="additionalSpaceRequest">
<label class="form-check-label" for="additionalSpaceRequest">
<b>Additional space request</b>
</label>
Expand Down

0 comments on commit 8eac85a

Please sign in to comment.