fix error

This commit is contained in:
Muzakki Parsaoran Siregar 2025-09-18 15:47:30 +07:00
parent 5fe5273865
commit 685beea7de

View File

@ -282,12 +282,16 @@
</div>
@endif
<!-- Modal Edit Template -->
<!-- Modal Edit Template - Fixed Version -->
@foreach ($templates as $template)
<div id="modalEdit{{ $template->id }}" class="fixed inset-0 hidden items-center justify-center z-50">
<div class="absolute inset-0 bg-black opacity-50 closeEditOverlay" data-id="{{ $template->id }}"></div>
<div class="bg-white rounded-lg shadow-lg w-full max-w-md z-50 flex flex-col max-h-[90vh]">
<!-- PINDAHKAN FORM KE LUAR AGAR MENCAKUP SEMUA ELEMEN -->
<form id="editForm{{ $template->id }}" action="{{ route('templates.update', $template->id) }}" method="POST" enctype="multipart/form-data" class="h-full flex flex-col">
@csrf @method('PUT')
<!-- Header -->
<div class="p-4 border-b sticky top-0 bg-white z-10">
<h5 class="text-lg font-medium">Edit Template</h5>
@ -295,9 +299,6 @@
<!-- Scrollable content -->
<div class="p-4 space-y-4 overflow-y-auto flex-1">
<form action="{{ route('templates.update', $template->id) }}" method="POST"
enctype="multipart/form-data" class="h-full flex flex-col">
@csrf @method('PUT')
<div class="flex-1 space-y-4">
<div>
<label class="block text-sm font-medium">Nama Template</label>
@ -386,15 +387,16 @@
<input type="file" name="foto" class="w-full p-2 border rounded" accept="image/*">
</div>
</div>
</form>
</div>
<!-- Footer -->
<!-- Footer - SEKARANG DI DALAM FORM -->
<div class="p-4 border-t flex justify-end space-x-2 sticky bottom-0 bg-white z-10">
<button type="button" class="bg-gray-300 text-black px-3 py-1 rounded closeEditBtn"
data-id="{{ $template->id }}">Batal</button>
<button class="bg-blue-600 text-white px-3 py-1 rounded">Simpan Perubahan</button>
<!-- TAMBAHKAN type="submit" -->
<button type="submit" class="bg-blue-600 text-white px-3 py-1 rounded">Simpan Perubahan</button>
</div>
</form>
</div>
</div>
@endforeach