Progress on seating form
This commit is contained in:
parent
1b94e7f081
commit
08ee83851d
|
|
@ -2,9 +2,11 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
|
||||
|
||||
class Ensemble extends Model
|
||||
{
|
||||
|
|
@ -15,4 +17,17 @@ class Ensemble extends Model
|
|||
{
|
||||
return $this->belongsTo(Event::class);
|
||||
}
|
||||
|
||||
public function auditions(): HasManyThrough
|
||||
{
|
||||
return $this->hasManyThrough(
|
||||
Audition::class,
|
||||
Event::class,
|
||||
'id',
|
||||
'event_id',
|
||||
'event_id',
|
||||
'id'
|
||||
)->orderBy('score_order');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
<x-card.card class="mt-5 max-w-md mx-auto">
|
||||
<x-card.heading>{{ $ensemble->name }}</x-card.heading>
|
||||
|
||||
<form>
|
||||
@foreach($ensemble->auditions as $audition)
|
||||
<x-form.field-horizontal name="x" label="{{ $audition->name }}" />
|
||||
@endforeach
|
||||
|
||||
<div class="mt-4 flex items-center justify-end gap-x-6 mr-6 mb-4">
|
||||
<button type="button" class="text-sm font-semibold leading-6 text-gray-900">Cancel</button>
|
||||
<button type="submit" class="inline-flex justify-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</x-card.card>
|
||||
|
|
@ -15,4 +15,8 @@
|
|||
</x-form.select>
|
||||
</div>
|
||||
</x-card.card>
|
||||
{{-- NEXT STEP - deising a component that will be a form to set audition limits for $ensemble, if it is set.--}}
|
||||
@if($ensemble->exists)
|
||||
@include('admin.ensembles.seatingLimits-limitForm')
|
||||
@endif
|
||||
</x-layout.app>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
@props(['name','label','type' => 'text'])
|
||||
<div class="space-y-12 sm:space-y-16 ml-6 mr-6">
|
||||
<div class="mt-3 space-y-8 border-b border-gray-900/10 pb-12 sm:space-y-0 sm:divide-y sm:divide-gray-900/10 sm:border-t sm:pb-0">
|
||||
<div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:py-6 mb-3">
|
||||
<label for="{{ $name }}" class="block text-sm font-medium leading-6 text-gray-900 sm:pt-1.5">{{ $label }}</label>
|
||||
<div class="mt-2 sm:col-span-2 sm:mt-0">
|
||||
<input type="{{ $type }}"
|
||||
name="{{ $name }}"
|
||||
id="{{ $name }}"
|
||||
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:max-w-xs sm:text-sm sm:leading-6">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Reference in New Issue