auditionadmin/resources/views/admin/prelim_definitions/createOrUpdate.blade.php

67 lines
3.3 KiB
PHP

<x-layout.app>
<x-slot:page_title>Manage Prelim Auditions</x-slot:page_title>
<div class="max-w-lg mx-auto">
<x-card.card class="pb-5">
<x-card.heading>
@if($prelim)
Modify Prelim - {{ $prelim->audition->name }}
<x-slot:right_side>
<x-delete-resource-modal title="Delete {{ $prelim->audition->name }} Prelim" action="{{ route('admin.prelim_definitions.destroy', $prelim->id)}}">
Confirm that you'd like to delete prelim auditions for {{ $prelim->audition->name }}.
{{-- TODO: Block deleting a prelim audition if there are prelim scores --}}
</x-delete-resource-modal>
</x-slot:right_side>
@else
Create Prelim Audition
@endif
</x-card.heading>
<x-form.form method="{{ $method }}" action="{{ $action }}"
x-data="{ canSubmit: {{ ! $prelim ? 'false':'true' }} }">
<x-form.select name="audition_id" @change="canSubmit = true">
<x-slot:label>Audition</x-slot:label>
@if($prelim)
<option value="{{ $prelim->audition_id }}">{{ $prelim->audition->name }}</option>
@else
<option value="" :disabled="canSubmit">Choose Audition</option>
@foreach($auditions as $audition)
<option value="{{ $audition->id }}">{{ $audition->name }}</option>
@endforeach
@endif
</x-form.select>
@error('audition_id')
<div class="text-red-500 text-sm">{{ $message }}</div>
@enderror
<x-form.select name="room_id">
<x-slot:label>Room</x-slot:label>
@foreach($rooms as $room)
<option value="{{ $room->id }}" @if($prelim && $prelim->room_id == $room->id) SELECTED @endif>{{ $room->name }} - {{ $room->description }}</option>
@endforeach
</x-form.select>
@error('room_id')
<div class="text-red-500 text-sm">{{ $message }}</div>
@enderror
<x-form.select name="scoring_guide_id">
<x-slot:label>Scoring Guide</x-slot:label>
@foreach($guides as $guide)
<option value="{{ $guide->id }}" @if($prelim && $prelim->scoring_guide_id == $guide->id) SELECTED @endif>{{ $guide->name }}</option>
@endforeach
</x-form.select>
@error('scoring_guide_id')
<div class="text-red-500 text-sm">{{ $message }}</div>
@enderror
<x-form.field name="passing_score" type="number" max="100" min="0" step="0.1" :value=" $prelim ? $prelim->passing_score : 60"
label_text="Passing Score"/>
<x-form.footer submit-button-text="{{ ! $prelim ? 'Create Prelim Audition':'Modify Prelim Audition' }}" x-show="canSubmit" x-cloak></x-form.footer>
</x-form.form>
</x-card.card>
</div>
</x-layout.app>