Allow deletion of entries on deadline day
This commit is contained in:
Matt Young 2024-09-14 10:04:58 -05:00
parent 401197b683
commit 38033a9ac8
1 changed files with 20 additions and 11 deletions

View File

@ -1,4 +1,4 @@
@php use Illuminate\Support\Facades\Auth; @endphp @php use Carbon\Carbon;use Illuminate\Support\Facades\Auth; @endphp
@push('scripts') @push('scripts')
{{-- Code from https://codepen.io/ryangjchandler/pen/WNQQKeR--}} {{-- Code from https://codepen.io/ryangjchandler/pen/WNQQKeR--}}
<script src="{{ asset('js/sort_table_by_column.js') }}"></script> <script src="{{ asset('js/sort_table_by_column.js') }}"></script>
@ -33,19 +33,18 @@
<div class="col-span-6 align-top"> <div class="col-span-6 align-top">
<x-form.checkbox name="for_seating" <x-form.checkbox name="for_seating"
label="Enter for {{ auditionSetting('auditionAbbreviation') }}" label="Enter for {{ auditionSetting('auditionAbbreviation') }}"
checked /> checked/>
</div> </div>
<div class="col-span-5 align-top"> <div class="col-span-5 align-top">
<x-form.checkbox name="for_advancement" <x-form.checkbox name="for_advancement"
label="Enter for {{ auditionSetting('advanceTo') }}" label="Enter for {{ auditionSetting('advanceTo') }}"
checked /> checked/>
</div> </div>
@else @else
<input type="hidden" name="for_seating" value="on"> <input type="hidden" name="for_seating" value="on">
@endif @endif
<x-form.button class="mt-6">Save</x-form.button> <x-form.button class="mt-6">Save</x-form.button>
</x-form.body-grid> </x-form.body-grid>
</x-form.form> </x-form.form>
@ -81,23 +80,27 @@
@if(auditionSetting('advanceTo')) @if(auditionSetting('advanceTo'))
<x-table.td> <x-table.td>
@if($entry->for_seating) @if($entry->for_seating)
<div aria-label="{{ $entry->student->full_name() }} on {{ $entry->audition->name }} is entered for seating. Entry ID {{ $entry->id }}"> <div
aria-label="{{ $entry->student->full_name() }} on {{ $entry->audition->name }} is entered for seating. Entry ID {{ $entry->id }}">
<x-icons.checkmark color="green"/> <x-icons.checkmark color="green"/>
</div> </div>
@else @else
<div aria-label="{{ $entry->student->full_name() }} on {{ $entry->audition->name }} is not entered for seating. Entry ID {{ $entry->id }}"> <div
aria-label="{{ $entry->student->full_name() }} on {{ $entry->audition->name }} is not entered for seating. Entry ID {{ $entry->id }}">
<x-icons.circle-slash-no color="red"/> <x-icons.circle-slash-no color="red"/>
</div> </div>
@endif @endif
</x-table.td> </x-table.td>
<x-table.td> <x-table.td>
@if($entry->for_advancement) @if($entry->for_advancement)
<div aria-label="{{ $entry->student->full_name() }} on {{ $entry->audition->name }} is entered for advancement. Entry ID {{ $entry->id }}"> <div
aria-label="{{ $entry->student->full_name() }} on {{ $entry->audition->name }} is entered for advancement. Entry ID {{ $entry->id }}">
<x-icons.checkmark color="green"/> <x-icons.checkmark color="green"/>
</div> </div>
@else @else
<div aria-label="{{ $entry->student->full_name() }} on {{ $entry->audition->name }} is not entered for advancement. Entry ID {{ $entry->id }}"> <div
aria-label="{{ $entry->student->full_name() }} on {{ $entry->audition->name }} is not entered for advancement. Entry ID {{ $entry->id }}">
<x-icons.circle-slash-no color="red"/> <x-icons.circle-slash-no color="red"/>
</div> </div>
@ -106,13 +109,19 @@
@endif @endif
<x-table.td for_button> <x-table.td for_button>
@if( $entry->audition->entry_deadline >= now()) @php
<form method="POST" action="{{ route('entries.destroy',$entry) }}" class="inline"> $currentDate = Carbon::now('America/Chicago');
$currentDate = $currentDate->format('Y-m-d');
@endphp
@if( $entry->audition->entry_deadline >= $currentDate)
<form method="POST" action="{{ route('entries.destroy',$entry) }}"
class="inline">
@csrf @csrf
@method('DELETE') @method('DELETE')
<x-table.button <x-table.button
onclick="return confirm('Please confirm you would like to delete the {{ $entry->audition->name }} entry for {{ $entry->student->full_name() }}');" onclick="return confirm('Please confirm you would like to delete the {{ $entry->audition->name }} entry for {{ $entry->student->full_name() }}');"
>Delete</x-table.button> >Delete
</x-table.button>
</form> </form>
@endif @endif
</x-table.td> </x-table.td>