Skip to content

Commit

Permalink
feat(dashboard): improve UI for assistants and shares (#85) (#99)
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
SharkyTheWhite and Fenrikur authored Feb 12, 2025
1 parent 2c66a7e commit a9993fe
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 87 deletions.
16 changes: 16 additions & 0 deletions resources/css/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,19 @@ label.required:after, legend.required:after, span.required:after {
content: "*";
color: red;
}

/* DD Specific */
.dd-table-button {
width: 5ex;
height: 5ex;
font-weight: bold;
margin: 0.25ex;
}

.dd-table-button.border-danger {
border-width: 3px;
}

.cursor-default {
cursor: default;
}
3 changes: 3 additions & 0 deletions resources/views/application/delete.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
If a table has already been assigned to you, you will lose it.<br>
<b>Please only continue if you are sure that you want to cancel your application.</b>
</p>
<p class="text-muted">
Should you change your mind afterwards, you can resubmit your application or join another dealership until the end of the application phase.
</p>
<div class="d-grid gap-2 d-sm-flex justify-content-sm-center">
<a href="{{ route('dashboard') }}"
class="btn btn-outline-secondary btn-lg px-4">Keep my Application</a>
Expand Down
47 changes: 1 addition & 46 deletions resources/views/application/invitees.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@
Shares and Assistants
@endsection
@section('content')
<style>
.dd-table-button {
width: 5ex;
height: 5ex;
font-weight: bold;
}
.dd-table-button.border-danger {
border-width: 3px
}
</style>
<div class="">
<div class="col-md-6 mx-auto">
<h1 class="text-center">Manage Shares and Assistants</h1>
Expand All @@ -35,42 +24,8 @@
@endif
<div class="col-md-6 mx-auto">
<h3 class="text-center">Seats in your Dealership</h3>
<div class="mx-auto text-center mb-1">
@for ($i = 0; $i < $seats['dealers']; $i++)
<button
class="btn btn-sm btn-primary dd-table-button @if ($i >= $seats['table']) border-danger text-danger @endif"
type="button" title="Dealer">D</button>
@endfor
@for ($i = 0; $i < $seats['free']; $i++)
<button class="btn btn-sm btn-secondary dd-table-button" type="button" title="Free">F</button>
@endfor
@if (!is_null($seats['additional']))
<button class="btn btn-sm btn-dark dd-table-button" type="button"
title="Free ({{ ucfirst($seats['additional']) }})">F{{ ucfirst(substr($seats['additional'], 0, 1)) }}</button>
@endif
@for ($i = 0; $i < $seats['assistants']; $i++)
<button
class="btn btn-sm bg-info dd-table-button @if ($i >= max($seats['table'] - $seats['dealers'], 1)) border-danger text-danger @endif"
type="button" title="Assistant">A</button>
@endfor
</div>
<div class="mx-auto text-center mb-4">
Legend:
<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>
<x-dashboard.dealership-seats-overview :seats="$seats" />
</div>
@if ($seats['free'] < 0)
<div class="alert alert-danger text-center fw-bold">
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 class="row">
<div class="col-md-6">

Expand Down
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>
92 changes: 64 additions & 28 deletions resources/views/dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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>
Expand All @@ -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
Expand All @@ -248,6 +286,4 @@ class="form-control @error('code') is-invalid @enderror" placeholder="Invite Cod
</div>
@endif
</div>

</div>
@endsection
19 changes: 6 additions & 13 deletions resources/views/forms/profile.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
the registration period has ended.</p>
</div>
@if ($applicationType === \App\Enums\ApplicationType::Share)
<input class="form-check-input" name="profile_hidden" role="switch" @checked(old('_token') ? old('profile_hidden') : $profile?->is_hidden === true) type="checkbox" id="dd-profile-hidden">
<input class="form-check-input" name="profile_hidden" role="switch" @checked(old('_token') ? old('profile_hidden') : $profile?->is_hidden === true)
type="checkbox" id="dd-profile-hidden">
<label class="form-check-label" for="dd-profile-hidden">
<strong>Hide Profile</strong> – I wish to share the dealership's profile instead of providing my own.
</label>
Expand Down Expand Up @@ -292,9 +293,7 @@ class="form-control @error('profile_website') is-invalid @enderror" id="profile_
X)</label>
<div class="col-sm-10">
<div class="input-group">
<div class="input-group-prepend">
<span clasS="input-group-text">@</span>
</div>
<span class="input-group-text">@</span>
<input type="text" name="twitter" placeholder="YourTwitterHandle"
class="form-control @error('twitter') is-invalid @enderror" id="twitter"
value="{{ old('_token') ? old('twitter') : $profile?->twitter }}">
Expand All @@ -313,9 +312,7 @@ class="form-control @error('twitter') is-invalid @enderror" id="twitter"
<label for="mastodon" class="col-sm-2 col-form-label fw-bold">Mas&shy;to&shy;don</label>
<div class="col-sm-10">
<div class="input-group">
<div class="input-group-prepend">
<span clasS="input-group-text">@</span>
</div>
<span class="input-group-text">@</span>
<input type="text" name="mastodon" placeholder="YourMastodonHandle"
class="form-control @error('mastodon') is-invalid @enderror" id="mastodon"
value="{{ old('_token') ? old('mastodon') : $profile?->mastodon }}">
Expand All @@ -332,9 +329,7 @@ class="form-control @error('mastodon') is-invalid @enderror" id="mastodon"
<label for="bluesky" class="col-sm-2 col-form-label fw-bold">Blue&shy;sky</label>
<div class="col-sm-10">
<div class="input-group">
<div class="input-group-prepend">
<span clasS="input-group-text">@</span>
</div>
<span class="input-group-text">@</span>
<input type="text" name="bluesky" placeholder="YourBlueskyHandle"
class="form-control @error('bluesky') is-invalid @enderror" id="bluesky"
value="{{ old('_token') ? old('bluesky') : $profile?->bluesky }}">
Expand All @@ -351,9 +346,7 @@ class="form-control @error('bluesky') is-invalid @enderror" id="bluesky"
<label for="telegram" class="col-sm-2 col-form-label fw-bold">Tele&shy;gram</label>
<div class="col-sm-10">
<div class="input-group">
<div class="input-group-prepend">
<span clasS="input-group-text">@</span>
</div>
<span class="input-group-text">@</span>
<input type="text" name="telegram" placeholder="YourTelegramHandle"
class="form-control @error('telegram') is-invalid @enderror" id="telegram"
value="{{ old('_token') ? old('telegram') : $profile?->telegram }}">
Expand Down

0 comments on commit a9993fe

Please sign in to comment.