44 lines
1.7 KiB
PHP
44 lines
1.7 KiB
PHP
<x-layout.app>
|
|
<x-slot:page_title>Events</x-slot:page_title>
|
|
<x-card.card class="mx-auto max-w-md">
|
|
<x-card.heading>
|
|
Manage Events
|
|
<x-slot:right_side>
|
|
@include('admin.event.index-help-modal')
|
|
</x-slot:right_side>
|
|
</x-card.heading>
|
|
|
|
<x-table.table>
|
|
<x-table.body>
|
|
@foreach($events as $event)
|
|
<tr>
|
|
<x-table.td>{{ $event->name }}, {{ $event->auditions()->count() }} Auditions</x-table.td>
|
|
<x-table.td class="text-right">
|
|
|
|
@if($event->auditions()->count() == 0)
|
|
<form method="POST" action="{{ route('admin.events.destroy', ['event' => $event->id]) }}">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="text-red-600 text-right">Delete Event</button>
|
|
</form>
|
|
@endif
|
|
</x-table.td>
|
|
</tr>
|
|
@endforeach
|
|
</x-table.body>
|
|
<tfoot>
|
|
<tr>
|
|
<x-form.form method="POST" :action="route('admin.events.store')" class="!px-0 !py-0">
|
|
<x-table.td>
|
|
<x-form.field name="name" label_text="Add New Event" />
|
|
</x-table.td>
|
|
<x-table.td>
|
|
<x-form.button class="mt-6">Create</x-form.button>
|
|
</x-table.td>
|
|
</x-form.form>
|
|
</tr>
|
|
</tfoot>
|
|
</x-table.table>
|
|
</x-card.card>
|
|
</x-layout.app>
|