meobda-website/resources/views/admin/audition_etude/grid.blade.php

106 lines
6.5 KiB
PHP

<x-layout.admin x-data="{ ensemble: 'e', instrument: 'i', set: 's', ensemble_id: '', instrument_id: '' }">
<button command="show-modal" commandfor="etude-uploader"
class="rounded-md bg-gray-950/5 px-2.5 py-1.5 text-sm font-semibold text-gray-900 hover:bg-gray-950/10 dark:bg-white/10 dark:text-white dark:inset-ring dark:inset-ring-white/5 dark:hover:bg-white/20">
Open dialog
</button>
<el-dialog>
<dialog id="etude-uploader" aria-labelledby="Upload Etude"
class="fixed inset-0 size-auto max-h-none max-w-none overflow-y-auto bg-transparent backdrop:bg-transparent">
<el-dialog-backdrop
class="fixed inset-0 bg-gray-500/75 transition-opacity data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in dark:bg-gray-900/50"></el-dialog-backdrop>
<div tabindex="0"
class="flex min-h-full items-end justify-center p-2 text-center focus:outline-none sm:items-center sm:p-0">
<el-dialog-panel
class="relative transform overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left shadow-xl transition-all data-closed:translate-y-4 data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in sm:my-8 sm:w-full sm:max-w-sm sm:p-6 data-closed:sm:translate-y-0 data-closed:sm:scale-95 dark:bg-gray-800 dark:outline dark:-outline-offset-1 dark:outline-white/10">
<x-form method="POST" action="#">
<input type="hidden" name="ensemble_id" x-model="ensemble_id"/>
<input type="hidden" name="instrument_id" x-model="instrument_id"/>
<input type="hidden" name="set" x-model="set"/>
<div>
<div class="mt-1 text-center sm:mt-3">
<h3 id="dialog-title" class="text-base font-semibold text-gray-900 dark:text-white">
Update Etude</h3>
<div class="mt-2 text-sm text-gray-500 dark:text-gray-400">
<span x-text="ensemble"></span>
<span x-text="instrument"></span>
<span x-text="`Set ${set}`"></span>
</div>
</div>
</div>
<div class="mt-3">
<x-form.input name="file_upload" type="file" label="Etude PDF"/>
</div>
<div class="mt-5 sm:mt-6">
<button type="button" command="close" commandfor="dialog"
class="inline-flex w-full justify-center rounded-md bg-brand-600 px-3 py-2 text-sm font-semibold text-white shadow-xs hover:bg-brand-500 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand-600 dark:bg-brand-500 dark:shadow-none dark:hover:bg-brand-400 dark:focus-visible:outline-brand-500">
Save Etude
</button>
</div>
</x-form>
</el-dialog-panel>
</div>
</dialog>
</el-dialog>
@foreach($ensembles as $ensemble)
<x-card class="mb-5">
<x-slot:header class="bg-brand-600!">{{ $ensemble->name }}</x-slot:header>
<x-slot:body class="bg-white border border-brand-600">
<x-table>
<x-slot:header>
<x-table.th></x-table.th>
@for($n=1; $n<= $ensemble->set_count; $n++)
<x-table.th>Set {{$n}}</x-table.th>
@endfor
</x-slot:header>
<tbody>
@foreach($instruments as $instrument)
<tr class="outline-1 outline-black/5 dark:outline-white/1">
<x-table.td>{{ $instrument->instrument }}</x-table.td>
@for($n=1; $n<= $ensemble->set_count; $n++)
@if($ensemble->getEtude($instrument, $n))
<x-table.td>
<x-form.button
command="show-modal"
commandfor="etude-uploader"
@click="
ensemble = '{{ $ensemble->name }}';
ensemble_id = '{{ $ensemble->id }}';
instrument = '{{ $instrument->instrument }}';
instrument_id = '{{ $instrument->id }}';
set = {{ $n }}"
>
{{ $ensemble->abbreviation }} - {{ $instrument->instrument }} - Set {{ $n }}
<br/>
</x-form.button>
</x-table.td>
@else
<x-table.td>
<x-form.button
command="show-modal"
commandfor="etude-uploader"
class="bg-red-600 hover:bg-red-500"
@click="
ensemble = '{{ $ensemble->name }}';
ensemble_id = '{{ $ensemble->id }}';
instrument = '{{ $instrument->instrument }}';
instrument_id = '{{ $instrument->id }}';
set = {{ $n }}"
>
No Etude
</x-form.button>
</x-table.td>
@endif
@endfor
</tr>
@endforeach
</tbody>
</x-table>
</x-slot:body>
</x-card>
@endforeach
</x-layout.admin>