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

57 lines
3.0 KiB
PHP

<x-layout.app>
<x-slot:page_title>Auditions</x-slot:page_title>
<x-card.card class="max-w-lg mx-auto">
<x-card.heading>
Edit Audition
{{-- TODO implement a way to update multiple auditions as once --}}
</x-card.heading>
<x-form.form method="PATCH" action="/admin/auditions/{{ $audition->id }}">
<x-form.body-grid columns="12" class="pb-1 pt-3">
<x-form.field name="name" label_text="Audition Name" colspan="12" value="{{ $audition->name }}" />
<x-form.select name="event_id" colspan="12">
<x-slot:label>Event</x-slot:label>
@foreach($events as $event)
<option value="{{ $event->id }}" {{ ($event->id == $audition->event_id) ? "selected":'' }}>{{ $event->name }}</option>
@endforeach
</x-form.select>
<x-form.field name="entry_deadline" label_text="Entry Deadline" type="date" colspan="6" value="{{ $audition->entry_deadline }}"/>
<x-form.field name="entry_fee" label_text="Entry Fee" type="number" colspan="6" value="{{ $audition->entry_fee / 100 }}" />
<x-form.field name="minimum_grade" label_text="Minimum Grade" type="number" colspan="6" value="{{ $audition->minimum_grade }}" />
<x-form.field name="maximum_grade" label_text="Maximum Grade" type="number" colspan="6" value="{{ $audition->maximum_grade }}" />
@if(auditionSetting('advanceTo'))
<div class="col-span-6 align-top">
<x-form.checkbox name="for_seating"
label="For Seats"
description="Students will be seated in this audition"
:checked="$audition->for_seating"
/>
</div>
<div class="col-span-6 align-top">
<x-form.checkbox name="for_advancement"
label="For {{ auditionSetting('advanceTo') }}"
description="Students compete for advancement"
:checked="$audition->for_advancement"/>
</div>
@else
<input type="hidden" name="for_seating" value="on">
@endif
</x-form.body-grid>
<x-form.footer submit-button-text="Update Audition" class="pb-4 !justify-between">
<div>
@if($audition->entries->count() == 0)
<x-form.red-trash-button size="20"></x-form.red-trash-button>
@endif
</div>
<div>
<x-form.button>Edit Audition</x-form.button>
</div>
</x-form.footer>
</x-form.form>
<x-form.delete-form action="/admin/auditions/{{ $audition->id }}"></x-form.delete-form>
</x-card.card>
</x-layout.app>