auditionadmin/resources/views/nomination_ensembles/scobda/entries/index.blade.php

77 lines
4.0 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</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>
<x-table.td>
<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>
</x-table.td>
</tr>
@endforeach
{{-- LINE TO ADD A NOMINATION--}}
@if($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>