100 lines
5.6 KiB
PHP
100 lines
5.6 KiB
PHP
@php($n=1)
|
|
|
|
<x-layout.app>
|
|
<x-slot:page_title>Nomination Entries</x-slot:page_title>
|
|
|
|
<x-layout.page-section-container>
|
|
|
|
@foreach($ensembles as $ensemble)
|
|
<x-layout.page-section>
|
|
<x-slot:section_name>{{ $ensemble->name }}</x-slot:section_name>
|
|
<x-slot:section_description>
|
|
{{ $ensemble->data['max_nominations'] }} nominations accepted<br>
|
|
Entry Deadline {{ \Carbon\Carbon::parse($ensemble->entry_deadline)->format('M j, Y') }}
|
|
</x-slot:section_description>
|
|
<x-table.table>
|
|
<thead>
|
|
<tr>
|
|
<x-table.th>Rank</x-table.th>
|
|
<x-table.th>Student</x-table.th>
|
|
<x-table.th>Instrument</x-table.th>
|
|
</tr>
|
|
</thead>
|
|
<x-table.body>
|
|
{{-- List existing nominations--}}
|
|
@foreach($nominatedStudents[$ensemble->id] as $nomination)
|
|
<tr>
|
|
<x-table.td>{{ $nomination->data['rank'] }}</x-table.td>
|
|
<x-table.td>{{ $nomination->student->full_name() }}</x-table.td>
|
|
<x-table.td>{{ $nomination->data['instrument'] }}</x-table.td>
|
|
@if($currentDate <= $ensemble->entry_deadline)
|
|
<x-table.td class="flex">
|
|
<x-delete-resource-modal
|
|
title="Delete Nomination"
|
|
method="DELETE"
|
|
action="{{ route('nomination.entry.destroy', [$nomination]) }}">
|
|
Confirm you wish to delete the nomination
|
|
of {{ $nomination->student->full_name() }}<br>
|
|
for the {{ $ensemble->name }} ensemble.
|
|
</x-delete-resource-modal>
|
|
<form method="POST" action="{{ route('nomination.entry.move') }}">
|
|
@csrf
|
|
<input type="hidden" name="direction" value="up">
|
|
<input type="hidden" name="nominationId" value="{{ $nomination->id }}">
|
|
<button class="ml-3" type="submit">
|
|
<x-icons.up-arrow/>
|
|
</button>
|
|
</form>
|
|
<form method="POST" action="{{ route('nomination.entry.move') }}">
|
|
@csrf
|
|
<input type="hidden" name="direction" value="down">
|
|
<input type="hidden" name="nominationId" value="{{ $nomination->id }}">
|
|
<button class="ml-3" type="submit">
|
|
<x-icons.down-arrow/>
|
|
</button>
|
|
</form>
|
|
</x-table.td>
|
|
@endif
|
|
</tr>
|
|
@endforeach
|
|
|
|
{{-- LINE TO ADD A NOMINATION--}}
|
|
@if($currentDate <= $ensemble->entry_deadline && $nominationsAvailable[$ensemble->id] && $availableStudents[$ensemble->id]->count() > 0)
|
|
<tr>
|
|
<x-form.form method="POST" action="{{ route('nomination.entry.store') }}">
|
|
<input type="hidden" name="ensemble" value="{{ $ensemble->id }}"/>
|
|
<x-table.th>NEW</x-table.th>
|
|
<x-table.td>
|
|
<x-form.select name="new_student">
|
|
@foreach($availableStudents[$ensemble->id] as $student)
|
|
<option value="{{$student->id}}">{{ $student->full_name() }}
|
|
(Grade {{ $student->grade }})
|
|
</option>
|
|
@endforeach
|
|
</x-form.select>
|
|
</x-table.td>
|
|
|
|
<x-table.td>
|
|
<x-form.select name="new_instrument">
|
|
@foreach($availableInstruments[$ensemble->id] as $instrument)
|
|
<option value="{{$instrument}}">{{$instrument}}</option>
|
|
@endforeach
|
|
</x-form.select>
|
|
</x-table.td>
|
|
|
|
<x-table.td>
|
|
<x-form.button class="bg-green-800">Add</x-form.button>
|
|
</x-table.td>
|
|
</x-form.form>
|
|
</tr>
|
|
@endif
|
|
</x-table.body>
|
|
</x-table.table>
|
|
|
|
</x-layout.page-section>
|
|
@endforeach
|
|
|
|
</x-layout.page-section-container>
|
|
|
|
</x-layout.app>
|