Skip to content

Commit

Permalink
add end date for inviting assistants (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fenrikur authored Aug 26, 2023
1 parent 96475d1 commit 17a59ce
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
5 changes: 5 additions & 0 deletions app/Http/Controllers/Applications/InvitationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public function store(Request $request)
"code" => "The registration period for new dealers has ended, please check back next year.",
]);
}
if ($applicationType === ApplicationType::Assistant && !Carbon::parse(config('ef.assistant_end_date'))->isFuture()) {
throw ValidationException::withMessages([
"code" => "The registration period for new assistants has ended.",
]);
}

$applications = Application::where('type', ApplicationType::Dealer)
->where(function ($q) use ($request) {
Expand Down
1 change: 1 addition & 0 deletions config/ef.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

return [
'reg_end_date' => Carbon::create(2023, 4, 30, 23, 59, 0, 'Europe/Berlin'),
'assistant_end_date' => Carbon::create(2023, 8, 20, 23, 59, 0, 'Europe/Berlin'),
'dealers_tos_url' => 'https://www.eurofurence.org/EF27/dealersden/',
'idp_url' => 'https://identity.eurofurence.org',
'dealers_email' => 'dealers@eurofurence.org',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/application/invitees.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class="form-text">Ask your share to go to dealers.eurofurence.org and click on J
<div class="card-title h5 mb-0"><span class="badge bg-secondary">{{ $assistants_active_count }}/{{ $assistants_count }}</span> Invite assistants to your space</div>
</div>
<ul class="list-group list-group-flush">
@if($assistants_active_count < $assistants_count)
@if($assistants_active_count < $assistants_count && Carbon\Carbon::parse(config('ef.assistant_end_date'))->isFuture())
<li class="list-group-item">
<form method="POST" action="{{ route('applications.invitees.regenerate-keys') }}">
@csrf
Expand Down
16 changes: 9 additions & 7 deletions resources/views/dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,16 @@ class="btn btn-sm btn-outline-primary">Assistants & Shares</a>
</div>
</div>
@endif
<div class="card mb-2">
<div class="card-body text-center">
<h5 class="card-title display-6">Become a Dealer Assistant</h5>
<p class="card-text lead">You have been invited to support an existing Dealership as a Dealer Assistant.
</p>
<a href="{{ route('join') }}" class="btn btn-lg btn-outline-primary">I have an invitation code</a>
@if (Carbon\Carbon::parse(config('ef.assistant_end_date'))->isFuture())
<div class="card mb-2">
<div class="card-body text-center">
<h5 class="card-title display-6">Become a Dealer Assistant</h5>
<p class="card-text lead">You have been invited to support an existing Dealership as a Dealer Assistant.
</p>
<a href="{{ route('join') }}" class="btn btn-lg btn-outline-primary">I have an invitation code</a>
</div>
</div>
</div>
@endif
</div>
</div>

Expand Down

0 comments on commit 17a59ce

Please sign in to comment.