auditionadmin/resources/views/admin/entries/edit.blade.php

62 lines
2.7 KiB
PHP

<x-layout.app>
<x-card.card class="mx-auto max-w-2xl">
<x-card.heading>Edit Entry #{{ $entry->id }}</x-card.heading>
<x-form.form method="PATCH" action="/admin/entries/{{ $entry->id }}">
<x-form.body-grid columns="3">
<x-form.select name="student_id" colspan="2">
<x-slot:label>Student</x-slot:label>
@foreach ($students as $student)
<option value="{{ $student->id }}" {{ ($student->id == $entry->student_id ? 'selected':'') }}>
{{ $student->full_name(true) }} - {{ $student->school->name }} (Grade {{ $student->grade }})
</option>
@endforeach
</x-form.select><x-form.select name="audition_id" colspan="1">
<x-slot:label>Audition</x-slot:label>
@foreach ($auditions as $audition)
<option value="{{ $audition->id }}" {{ ($audition->id == $entry->audition_id ? 'selected':'') }}>
{{ $audition->name }}
</option>
@endforeach
</x-form.select>
</x-form.body-grid>
<x-form.footer class="!py-5">
<x-form.button>Edit Entry</x-form.button>
</x-form.footer>
</x-form.form>
</x-card.card>
<x-card.card class="mx-auto max-w-2xl mt-6">
<x-card.heading>Scores</x-card.heading>
<x-card.list.body>
@foreach($scores as $score)
@php($score->isValid())
<x-card.list.row right_link_button_type="button" >
<div>{{ $score->judge->full_name() }}</div>
@foreach($score->subscores as $subscore)
{{-- TODO make this look better--}}
<div>
<p>{{$subscore['subscore_name']}}</p>
<p>{{$subscore['score'] }}</p>
</div>
@endforeach
@if(! $score->isValid())
<form method="POST" action="/admin/scores/{{ $score->id }}">
@csrf
@method('DELETE')
<x-slot:right_link_button class="bg-red-500 text-white">INVALID SCORE - DELETE</x-slot:right_link_button>
@endif
</x-card.list.row>
{{-- // TODO make the invalid prettier--}}
@endforeach
</x-card.list.body>
</x-card.card>
</x-layout.app>
{{--TODO apply javascript to only show appropriate auditions for the students grade--}}