-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat(dashboard): improve UI for assistants and shares (#85) * fix(style): bootstrap 4.x to 5.x migrations --------- Co-authored-by: Fenrikur <[email protected]>
- Loading branch information
1 parent
2c66a7e
commit a9993fe
Showing
6 changed files
with
129 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
resources/views/components/dashboard/dealership-seats-overview.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
@props(['seats']) | ||
|
||
<div class="border rounded mx-auto border-dark-subtle bg-light p-3 mb-3"> | ||
<div class="mx-auto text-center mb-1"> | ||
@for ($i = 0; $i < $seats['dealers']; $i++) | ||
<span | ||
class="btn btn-primary dd-table-button cursor-default @if ($i >= $seats['table']) border-danger text-danger @endif" | ||
title="Dealer">D</span> | ||
@endfor | ||
@for ($i = 0; $i < $seats['free']; $i++) | ||
<span class="btn btn-secondary dd-table-button cursor-default" title="Free">F</span> | ||
@endfor | ||
@if (!is_null($seats['additional'])) | ||
<span class="btn btn-dark dd-table-button cursor-default" | ||
title="Free ({{ ucfirst($seats['additional']) }})">F{{ ucfirst(substr($seats['additional'], 0, 1)) }}</span> | ||
@endif | ||
@for ($i = 0; $i < $seats['assistants']; $i++) | ||
<span | ||
class="btn btn-info dd-table-button cursor-default @if ($i >= max($seats['table'] - $seats['dealers'], 1)) border-danger text-danger @endif" | ||
title="Assistant">A</span> | ||
@endfor | ||
</div> | ||
<div class="mx-auto text-center mt-3"> | ||
<i>Legend:</i> | ||
<span class="badge text-bg-primary">Dealer</span> | ||
<span class="badge text-bg-secondary">Free</span> | ||
@if (!is_null($seats['additional'])) | ||
<span class="badge text-bg-dark">Free ({{ ucfirst($seats['additional']) }})</span> | ||
@endif | ||
<span class="badge text-bg-info">Assistant</span> | ||
</div> | ||
@if ($seats['free'] < 0) | ||
<div class="alert alert-danger text-center fw-bold mt-3 mb-0"> | ||
You have too many people in your dealership for the number of | ||
seats available for your table size.<br /> | ||
Please remove excess shares or assistants. | ||
</div> | ||
@endif | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,8 +29,8 @@ | |
</p> | ||
@endif | ||
@else | ||
<p class="lead mb-4">The registration period for dealerships has ended. You can still update your profile data which will be | ||
displayed in the EF app.</p> | ||
<p class="lead mb-4">The registration period for dealerships has ended. You can still update your profile | ||
data which will be displayed in the EF app.</p> | ||
@endif | ||
|
||
@if (Carbon\Carbon::parse(config('convention.assistant_end_date'))->isFuture()) | ||
|
@@ -86,7 +86,11 @@ | |
<p>Your registration as a dealer was accepted! Please review and accept the table you were | ||
offered. | ||
</p> | ||
<p><a href="{{ route('table.confirm') }}" class="btn btn-lg btn-primary">Review Offered Table</a></p> | ||
<p> | ||
<a href="{{ route('table.confirm') }}" class="btn btn-lg btn-primary"> | ||
Review Offered Table | ||
</a> | ||
</p> | ||
@else | ||
<h3>Congratulations!</h3> | ||
<p>The application of the dealership you are part of was accepted! The main account of your | ||
|
@@ -139,9 +143,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('convention.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! | ||
{{ Carbon\Carbon::parse(config('convention.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 | ||
Please contact us at [email protected] if you are not planning on attending Eurofurence | ||
|
@@ -156,10 +159,21 @@ | |
|
||
<div class="row"> | ||
@if (isset($application) && $application->isActive()) | ||
<div class="col-md-6 mx-auto"> | ||
<div class="card mb-2"> | ||
<div class="col-lg-6 mx-auto d-flex"> | ||
<div class="card mb-4"> | ||
<div class="card-body text-center"> | ||
<h5 class="card-title display-6">Manage your Registration</h5> | ||
@if ($application->type) | ||
<p> | ||
as | ||
<span | ||
class="badge bg-primary">{{ \Illuminate\Support\Str::ucfirst($application->type->value) }}</span> | ||
@if ($application->parent) | ||
of <span | ||
class="badge bg-secondary">{{ $application->parent()->first()->getFullName() }}</span> | ||
@endif | ||
</p> | ||
@endif | ||
<p class="card-text lead"> | ||
@switch($application->type) | ||
@case(\App\Enums\ApplicationType::Dealer) | ||
|
@@ -175,24 +189,20 @@ | |
@break | ||
|
||
@case(\App\Enums\ApplicationType::Assistant) | ||
You may cancel your registration as assistant until the assitant registration period is over. | ||
You may cancel your registration as assistant until the assistant registration period is over. | ||
@break | ||
|
||
@default | ||
<span class="badge text-bg-danger mx-2">Please report this as an error.</span> | ||
@endswitch | ||
</p> | ||
<a href="{{ route('applications.edit') }}" class="btn btn-lg btn-primary">Manage your | ||
<a href="{{ route('applications.edit') }}" class="btn btn-lg btn-primary mt-2">Manage your | ||
Registration</a> | ||
<div class="mb-3"></div> | ||
@if ($application->type === \App\Enums\ApplicationType::Dealer) | ||
<a href="{{ route('applications.invitees.view') }}" | ||
class="btn btn-sm btn-outline-primary">Assistants & Shares</a> | ||
@endif | ||
@if ( | ||
$application->status !== \App\Enums\ApplicationStatus::TableAccepted && | ||
$application->status !== \App\Enums\ApplicationStatus::CheckedIn) | ||
<a href="{{ route('applications.delete') }}" class="btn btn-sm btn-outline-danger"> | ||
<a href="{{ route('applications.delete') }}" class="btn btn btn-outline-danger mt-2"> | ||
@if ($application->type === \App\Enums\ApplicationType::Dealer) | ||
Cancel Registration | ||
@else | ||
|
@@ -203,9 +213,26 @@ class="btn btn-sm btn-outline-primary">Assistants & Shares</a> | |
</div> | ||
</div> | ||
</div> | ||
@if ($application->type === \App\Enums\ApplicationType::Dealer) | ||
<div class="col-lg-6 mx-auto d-flex"> | ||
<div class="card mb-4"> | ||
<div class="card-body text-center"> | ||
<h5 class="card-title display-6">Seats in your Dealership</h5> | ||
<p class="card-text lead"> | ||
You may invite other dealers while registration is still open and invite assistants until | ||
assistant registration closes. | ||
</p> | ||
<x-dashboard.dealership-seats-overview :seats="$application->getSeats()" /> | ||
<a href="{{ route('applications.invitees.view') }}" class="btn btn-lg btn-primary"> | ||
Invite or Manage <span class="text-nowrap">Assistants & Shares</span> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
@endif | ||
@elseif (Carbon\Carbon::parse(config('convention.reg_end_date'))->isFuture()) | ||
<div class="col-md-6"> | ||
<div class="card mb-2"> | ||
<div class="col-lg-6 d-flex"> | ||
<div class="card mb-4"> | ||
<div class="card-body text-center"> | ||
<h5 class="card-title display-6">Apply for a Dealership</h5> | ||
<p class="card-text lead">As a Dealers’ Den dealership owner, you are responsible for managing your | ||
|
@@ -219,8 +246,8 @@ class="btn btn-sm btn-outline-primary">Assistants & Shares</a> | |
@endif | ||
@if (Carbon\Carbon::parse(config('convention.reg_end_date'))->isFuture() || | ||
Carbon\Carbon::parse(config('convention.assistant_end_date'))->isFuture()) | ||
<div class="col-md-6 mx-auto"> | ||
<div class="card mb-2"> | ||
<div class="col-lg-6 mx-auto d-flex"> | ||
<div class="card mb-4"> | ||
<form action="{{ route('invitation.join') }}" method="post"> | ||
<div class="card-body text-center"> | ||
<h5 class="card-title display-6">Join an existing Dealership</h5> | ||
|
@@ -233,13 +260,24 @@ class="btn btn-sm btn-outline-primary">Assistants & Shares</a> | |
Then enter the invite code they provided you with below! | ||
</p> | ||
<div class="input-group input-group-lg has-validation"> | ||
<input type="text" name="code" | ||
class="form-control @error('code') is-invalid @enderror" placeholder="Invite Code"> | ||
<button class="btn btn-primary" type="submit">Submit | ||
</button> | ||
@error('code') | ||
<div class="invalid-feedback">{{ $message }}</div> | ||
@enderror | ||
@if (isset($application) && $application->isActive()) | ||
<input type="text" disabled class="form-control" placeholder="Invite Code"> | ||
<button class="btn btn-secondary" disabled type="submit">Submit</button> | ||
<p class="text-danger mt-2"> | ||
You cannot join another dealership while you still have an active, uncanceled | ||
application. | ||
</p> | ||
@else | ||
<input type="text" name="code" | ||
class="form-control @error('code') is-invalid @enderror" placeholder="Invite Code"> | ||
<button class="btn btn-primary" type="submit">Submit | ||
</button> | ||
@error('code') | ||
<div class="invalid-feedback">{{ $message }}</div> | ||
@else | ||
<span></span> | ||
@enderror | ||
@endif | ||
</div> | ||
</div> | ||
@csrf | ||
|
@@ -248,6 +286,4 @@ class="form-control @error('code') is-invalid @enderror" placeholder="Invite Cod | |
</div> | ||
@endif | ||
</div> | ||
|
||
</div> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters