auditionadmin-7 Confirmation on delete with trash icon

This commit is contained in:
Matt Young 2024-07-14 17:46:36 -05:00
parent 4a7f8c13d1
commit 833e04b557
2 changed files with 26 additions and 11 deletions

View File

@ -1,4 +1,15 @@
<x-layout.app>
@if($school->students()->count() === 0)
<x-slot:title_bar_right>
<x-delete-resource-modal
title="Delete School"
action="{{route('admin.schools.destroy',$school)}}"
>
Confirm you would like to delete the school {{ $school->name }}.
This action cannot be undone.
</x-delete-resource-modal>
</x-slot:title_bar_right>
@endif
<x-slot:page_title>School: {{ $school->name }}</x-slot:page_title>
<div class="grid md:grid-cols-4 gap-3">
<div x-data="{ showModal: false }">

View File

@ -4,25 +4,29 @@
Edit User
<x-slot:right_side>
@if($user->id != Auth::user()->id)
<form method="POST" action="{{ route('admin.users.destroy',['user' => $user->id]) }}">
@csrf
@method('DELETE')
<x-form.red-trash-button type="submit" />
</form>
<x-delete-resource-modal
action="{{ route('admin.users.destroy',['user' => $user->id]) }}"
title="Delete user {{$user->full_name()}}">
Confirm you would like to delete the user {{ $user->full_name() }} having
email {{ $user->email }}.
This action cannot be undone.
</x-delete-resource-modal>
@endif
</x-slot:right_side>
</x-card.heading>
<x-form.form method="PATCH" action="{{ route('admin.users.update', $user) }}">
<x-form.body-grid>
<x-form.field name="first_name" label_text="First Name" colspan="3" value="{{ $user->first_name }}" />
<x-form.field name="last_name" label_text="Last Name" colspan="3" value="{{ $user->last_name }}" />
<x-form.field name="email" label_text="Email Address" colspan="3" value="{{ $user->email }}" />
<x-form.field name="cell_phone" label_text="Cell Phone" colspan="3" value="{{ $user->cell_phone }}" />
<x-form.field name="judging_preference" label_text="Judging Preference" colspan="6" value="{{ $user->judging_preference }}" />
<x-form.field name="first_name" label_text="First Name" colspan="3" value="{{ $user->first_name }}"/>
<x-form.field name="last_name" label_text="Last Name" colspan="3" value="{{ $user->last_name }}"/>
<x-form.field name="email" label_text="Email Address" colspan="3" value="{{ $user->email }}"/>
<x-form.field name="cell_phone" label_text="Cell Phone" colspan="3" value="{{ $user->cell_phone }}"/>
<x-form.field name="judging_preference" label_text="Judging Preference" colspan="6"
value="{{ $user->judging_preference }}"/>
<x-form.select name="school_id" colspan="6">
<x-slot:label>School</x-slot:label>
@foreach ($schools as $school)
<option value="{{ $school->id }}" @if ($user->school_id == $school->id) selected @endif>{{ $school->name }}</option>
<option value="{{ $school->id }}"
@if ($user->school_id == $school->id) selected @endif>{{ $school->name }}</option>
@endforeach
</x-form.select>