Update edit.blade.php

This commit is contained in:
Matt Young 2024-07-14 17:48:07 -05:00
parent 833e04b557
commit 0597831dc1
1 changed files with 19 additions and 14 deletions

View File

@ -3,12 +3,15 @@
<x-card.card class="mx-auto max-w-2xl"> <x-card.card class="mx-auto max-w-2xl">
<x-card.heading> <x-card.heading>
Edit Entry #{{ $entry->id }} Edit Entry #{{ $entry->id }}
@if($entry->scoreSheets()->count() === 0)
<x-slot:right_side> <x-slot:right_side>
<x-delete-resource-modal action="{{route('admin.entries.destroy',$entry->id)}}" title="Delete entry #{{ $entry->id }}"> <x-delete-resource-modal action="{{route('admin.entries.destroy',$entry->id)}}"
Confirm you would like to delete entry #{{$entry->id}} by {{$entry->student->full_name()}} on {{$entry->audition->name}}. title="Delete entry #{{ $entry->id }}">
</x-delete-resource-modal> Confirm you would like to delete entry #{{$entry->id}} by {{$entry->student->full_name()}}
</x-slot:right_side> on {{$entry->audition->name}}.
</x-delete-resource-modal>
</x-slot:right_side>
@endif
</x-card.heading> </x-card.heading>
<x-form.form id='entryEditForm' method="PATCH" action="/admin/entries/{{ $entry->id }}"> <x-form.form id='entryEditForm' method="PATCH" action="/admin/entries/{{ $entry->id }}">
@ -18,12 +21,13 @@
<x-slot:label>Student</x-slot:label> <x-slot:label>Student</x-slot:label>
@php($student = $students->find($entry->student_id)) @php($student = $students->find($entry->student_id))
<option value="{{ $student->id }}" {{ ($student->id == $entry->student_id ? 'selected':'') }}> <option value="{{ $student->id }}" {{ ($student->id == $entry->student_id ? 'selected':'') }}>
{{ $student->full_name(true) }} - {{ $student->school->name }} (Grade {{ $student->grade }}) {{ $student->full_name(true) }} - {{ $student->school->name }} (Grade {{ $student->grade }})
</option> </option>
</x-form.select> </x-form.select>
@else @else
<p class="col-span-3 mt-4 ">{{ $entry->student->full_name() }} - {{ $entry->student->school->name }}</p> <p class="col-span-3 mt-4 ">{{ $entry->student->full_name() }}
- {{ $entry->student->school->name }}</p>
@endif @endif
@if(! Seat::where('entry_id', $entry->id)->exists()) @if(! Seat::where('entry_id', $entry->id)->exists())
@ -35,7 +39,7 @@
{{ $audition->name }} {{ $audition->name }}
</option> </option>
@endforeach @endforeach
</x-form.select> </x-form.select>
@else @else
<p class="col-span-3 mt-4 ">{{ $entry->audition->name }}</p> <p class="col-span-3 mt-4 ">{{ $entry->audition->name }}</p>
@endif @endif
@ -44,12 +48,12 @@
<div class="col-span-6 align-top"> <div class="col-span-6 align-top">
<x-form.checkbox name="for_seating" <x-form.checkbox name="for_seating"
label="Enter for {{ auditionSetting('auditionAbbreviation') }}" label="Enter for {{ auditionSetting('auditionAbbreviation') }}"
:checked="$entry->for_seating" /> :checked="$entry->for_seating"/>
</div> </div>
<div class="col-span-6 align-top"> <div class="col-span-6 align-top">
<x-form.checkbox name="for_advancement" <x-form.checkbox name="for_advancement"
label="Enter for {{ auditionSetting('advanceTo') }}" label="Enter for {{ auditionSetting('advanceTo') }}"
:checked="$entry->for_advancement" /> :checked="$entry->for_advancement"/>
</div> </div>
@else @else
<input type="hidden" name="for_seating" value="on"> <input type="hidden" name="for_seating" value="on">
@ -80,7 +84,8 @@
<form method="POST" action="{{ route('scores.destroy',['score'=>$score->id]) }}"> <form method="POST" action="{{ route('scores.destroy',['score'=>$score->id]) }}">
@csrf @csrf
@method('DELETE') @method('DELETE')
<button type="submit" class="text-red-500 font-semibold pt-5">Invalid Score - Delete</button> <button type="submit" class="text-red-500 font-semibold pt-5">Invalid Score - Delete
</button>
@endif @endif
</div> </div>
@endforeach @endforeach