79 lines
4.2 KiB
PHP
79 lines
4.2 KiB
PHP
<x-layout.app>
|
|
<x-slot:page_title>Nominations</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-card.card>
|
|
<x-card.heading>Existing Nominations</x-card.heading>
|
|
<x-table.table>
|
|
<thead>
|
|
<tr>
|
|
<x-table.th>Student</x-table.th>
|
|
<x-table.th>Grade</x-table.th>
|
|
<x-table.th>Instrument</x-table.th>
|
|
</tr>
|
|
</thead>
|
|
<x-table.body>
|
|
@foreach($existingNominations[$ensemble->id] as $nom)
|
|
<tr>
|
|
<x-table.td class="flex">
|
|
{{ $nom->student->full_name() }}
|
|
</x-table.td>
|
|
<x-table.td>{{ $nom->student->grade }}</x-table.td>
|
|
<x-table.td>{{ $nom->data['instrument'] }}</x-table.td>
|
|
@if(!$past_deadline[$ensemble->id])
|
|
<x-table.td>
|
|
<x-delete-resource-modal
|
|
title="Delete Nomination"
|
|
method="DELETE"
|
|
action="{{ route('nomination.entry.destroy', [$nom]) }}">
|
|
Confirm you wish to delete the nomination
|
|
of {{ $nom->student->full_name() }}<br>
|
|
for the {{ $ensemble->name }} ensemble.
|
|
</x-delete-resource-modal>
|
|
</x-table.td>
|
|
@endif
|
|
</tr>
|
|
@endforeach
|
|
</x-table.body>
|
|
</x-table.table>
|
|
</x-card.card>
|
|
|
|
@if($nominationsAvailable[$ensemble->id] && !$past_deadline[$ensemble->id])
|
|
<x-card.card>
|
|
<x-card.heading>New Entry</x-card.heading>
|
|
<x-form.form method="POST" action="{{ route('nomination.entry.store') }}">
|
|
<x-form.body-grid columns="5" class="mb-4 mt-4">
|
|
<input type="hidden" name="ensemble" value="{{ $ensemble->id }}"/>
|
|
<x-form.select name="new_student" colspan="2">
|
|
@foreach($availableStudents[$ensemble->id] as $student)
|
|
<option value="{{$student->id}}">{{ $student->full_name() }}
|
|
(Grade {{ $student->grade }})
|
|
</option>
|
|
@endforeach
|
|
</x-form.select>
|
|
|
|
<x-form.select name="new_instrument" colspan="2">
|
|
@foreach($availableInstruments[$ensemble->id] as $instrument)
|
|
<option value="{{$instrument}}">{{ $instrument }}</option>
|
|
@endforeach
|
|
</x-form.select>
|
|
|
|
<x-form.button>Add Nomination</x-form.button>
|
|
|
|
</x-form.body-grid>
|
|
</x-form.form>
|
|
</x-card.card>
|
|
@endif
|
|
|
|
</x-layout.page-section>
|
|
@endforeach
|
|
</x-layout.page-section-container>
|
|
</x-layout.app>
|