This commit is contained in:
Muzakki Parsaoran Siregar 2025-09-18 16:07:27 +07:00
parent 685beea7de
commit 3dbd356d2f
2 changed files with 131 additions and 106 deletions

View File

@ -41,16 +41,16 @@
<table class="w-full table-fixed border border-gray-300 text-left">
<thead class="bg-gray-100">
<tr>
<th class="w-[10%] p-2 border border-gray-300 text-center">ID</th>
<th class="w-[10%] p-2 border border-gray-300 text-center">No</th>
<th class="w-[60%] p-2 border border-gray-300 text-center">Deskripsi</th>
<th class="w-[30%] p-2 border border-gray-300 text-center">Aksi</th>
</tr>
</thead>
<tbody>
@forelse ($kategoriFitur as $item)
@forelse ($kategoriFitur as $index => $item)
<tr class="hover:bg-gray-50">
<td class="py-4 px-2 border border-gray-300 text-center">
{{ $item->id }}
{{ ($kategoriFitur->currentPage() - 1) * $kategoriFitur->perPage() + $loop->iteration }}
</td>
<td class="py-4 px-2 border border-gray-300">
{{ $item->deskripsi }}

View File

@ -283,13 +283,14 @@
@endif
<!-- Modal Edit Template - Fixed Version -->
@foreach ($templates as $template)
@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">
<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 -->
@ -399,7 +400,31 @@
</form>
</div>
</div>
@endforeach
@endforeach
<!-- Modal Konfirmasi Hapus Template -->
<div id="modalDeleteTemplate" class="fixed inset-0 hidden items-center justify-center z-50">
<div class="absolute inset-0 bg-black opacity-50" id="modalDeleteTemplateOverlay"></div>
<div class="bg-white rounded-lg shadow-lg w-full max-w-md z-50 overflow-hidden">
<form id="deleteTemplateForm" method="POST">
@csrf
@method('DELETE')
<div class="p-4 border-b">
<h5 class="text-lg font-medium">Hapus Template</h5>
</div>
<div class="p-4">
Apakah Anda yakin ingin menghapus template <strong id="deleteTemplateName"></strong>?
</div>
<div class="p-4 border-t flex justify-end space-x-2">
<button type="button" id="closeDeleteTemplateModal"
class="bg-gray-300 text-black px-3 py-1 rounded">Batal</button>
<button type="submit" class="bg-red-600 text-white px-3 py-1 rounded">
Ya, Hapus
</button>
</div>
</form>
</div>
</div>
<script>