Merge branch 'main' of https://git.abbauf.com/Magang-2025/Undangan
This commit is contained in:
commit
55ae830e1d
@ -18,7 +18,7 @@
|
|||||||
<table class="w-full table-fixed border border-gray-300 text-left">
|
<table class="w-full table-fixed border border-gray-300 text-left">
|
||||||
<thead class="bg-gray-100">
|
<thead class="bg-gray-100">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="w-[10%] p-2 border border-gray-300 text-center">Nomor</th>
|
<th class="w-[7%] p-2 border border-gray-300 text-center">Nomor</th>
|
||||||
<th class="w-[70%] p-2 border border-gray-300 text-center">Fitur</th>
|
<th class="w-[70%] p-2 border border-gray-300 text-center">Fitur</th>
|
||||||
<th class="w-[20%] p-2 border border-gray-300 text-center">Aksi</th>
|
<th class="w-[20%] p-2 border border-gray-300 text-center">Aksi</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -26,10 +26,10 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
@forelse ($fitur as $key => $item)
|
@forelse ($fitur as $key => $item)
|
||||||
<tr class="hover:bg-gray-50">
|
<tr class="hover:bg-gray-50">
|
||||||
<td class="p-2 border border-gray-300">{{ $key + 1 }}</td>
|
<td class="py-5 px-2 border border-gray-300 text-center">{{ $key + 1 }}</td>
|
||||||
<td class="p-2 border border-gray-300 truncate whitespace-nowrap">{{ $item->deskripsi }}
|
<td class="py-5 px-2 border border-gray-300 truncate whitespace-nowrap">{{ $item->deskripsi }}
|
||||||
</td>
|
</td>
|
||||||
<td class="p-2 border border-gray-300 text-center">
|
<td class="py-5 px-2 border border-gray-300 text-center">
|
||||||
<div class="flex justify-center space-x-2">
|
<div class="flex justify-center space-x-2">
|
||||||
<button class="text-blue-600 flex items-center pr-4 openEditModalBtn"
|
<button class="text-blue-600 flex items-center pr-4 openEditModalBtn"
|
||||||
data-id="{{ $item->id }}">
|
data-id="{{ $item->id }}">
|
||||||
|
@ -26,7 +26,9 @@
|
|||||||
<div id="toast-success" class="mb-4 p-3 rounded bg-green-100 text-green-800 border border-green-300 shadow">
|
<div id="toast-success" class="mb-4 p-3 rounded bg-green-100 text-green-800 border border-green-300 shadow">
|
||||||
{{ session('success') }}
|
{{ session('success') }}
|
||||||
</div>
|
</div>
|
||||||
<script>setTimeout(() => document.getElementById('toast-success')?.remove(), 3000);</script>
|
<script>
|
||||||
|
setTimeout(() => document.getElementById('toast-success')?.remove(), 3000);
|
||||||
|
</script>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if ($errors->any())
|
@if ($errors->any())
|
||||||
@ -37,7 +39,9 @@
|
|||||||
@endforeach
|
@endforeach
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<script>setTimeout(() => document.getElementById('toast-error')?.remove(), 5000);</script>
|
<script>
|
||||||
|
setTimeout(() => document.getElementById('toast-error')?.remove(), 5000);
|
||||||
|
</script>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<!-- Tabel Template -->
|
<!-- Tabel Template -->
|
||||||
@ -61,14 +65,16 @@
|
|||||||
<td class="p-2 border border-gray-300 text-center">{{ $key + 1 }}</td>
|
<td class="p-2 border border-gray-300 text-center">{{ $key + 1 }}</td>
|
||||||
<td class="p-2 border border-gray-300 truncate">{{ $template->nama_template }}</td>
|
<td class="p-2 border border-gray-300 truncate">{{ $template->nama_template }}</td>
|
||||||
<td class="p-2 border border-gray-300 truncate">{{ $template->kategori->nama ?? '-' }}</td>
|
<td class="p-2 border border-gray-300 truncate">{{ $template->kategori->nama ?? '-' }}</td>
|
||||||
<td class="p-2 border border-gray-300 truncate">{{ $template->fitur->deskripsi ?? '-' }}</td>
|
<td class="p-2 border border-gray-300 truncate">{{ $template->fitur->deskripsi ?? '-' }}
|
||||||
|
</td>
|
||||||
<td class="p-2 border border-gray-300 text-center">
|
<td class="p-2 border border-gray-300 text-center">
|
||||||
<div class="w-12 h-12 overflow-hidden rounded bg-gray-100 flex items-center justify-center mx-auto">
|
<div
|
||||||
|
class="w-12 h-12 overflow-hidden rounded bg-gray-100 flex items-center justify-center mx-auto">
|
||||||
<img src="{{ $template->foto ? asset('storage/' . $template->foto) : asset('default-image.png') }}"
|
<img src="{{ $template->foto ? asset('storage/' . $template->foto) : asset('default-image.png') }}"
|
||||||
alt="foto" class="max-w-full max-h-full object-contain">
|
alt="foto" class="max-w-full max-h-full object-contain">
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="p-2 border border-gray-300 text-right font-semibold">
|
<td class="p-2 border border-gray-300 text-left font-semibold">
|
||||||
Rp {{ number_format($template->harga, 0, ',', '.') }}
|
Rp {{ number_format($template->harga, 0, ',', '.') }}
|
||||||
</td>
|
</td>
|
||||||
<td class="p-2 border border-gray-300 text-center">
|
<td class="p-2 border border-gray-300 text-center">
|
||||||
@ -90,7 +96,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
@empty
|
@empty
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="7" class="p-2 text-center text-gray-500 border border-gray-300">Belum ada template</td>
|
<td colspan="7" class="p-2 text-center text-gray-500 border border-gray-300">Belum ada
|
||||||
|
template</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforelse
|
@endforelse
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -125,13 +132,17 @@
|
|||||||
<label class="block text-sm font-medium">Fitur</label>
|
<label class="block text-sm font-medium">Fitur</label>
|
||||||
<select name="fitur_id" class="w-full p-2 border rounded" required>
|
<select name="fitur_id" class="w-full p-2 border rounded" required>
|
||||||
@foreach ($fiturs as $fitur)
|
@foreach ($fiturs as $fitur)
|
||||||
<option value="{{ $fitur->id }}">{{ $fitur->deskripsi }}</option>
|
<option value="{{ $fitur->id }}">
|
||||||
|
{{ \Illuminate\Support\Str::limit($fitur->deskripsi, 50) }}
|
||||||
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-sm font-medium">Harga</label>
|
<label class="block text-sm font-medium">Harga</label>
|
||||||
<input type="number" name="harga" class="w-full p-2 border rounded" required min="0" step="1000">
|
<input type="number" name="harga" class="w-full p-2 border rounded" required
|
||||||
|
min="0" step="1000">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-sm font-medium">Foto (opsional)</label>
|
<label class="block text-sm font-medium">Foto (opsional)</label>
|
||||||
@ -140,7 +151,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-4 border-t flex justify-end space-x-2">
|
<div class="p-4 border-t flex justify-end space-x-2">
|
||||||
<button type="button" id="closeTambahBtn" class="bg-gray-300 text-black px-3 py-1 rounded">Batal</button>
|
<button type="button" id="closeTambahBtn"
|
||||||
|
class="bg-gray-300 text-black px-3 py-1 rounded">Batal</button>
|
||||||
<button class="bg-blue-600 text-white px-3 py-1 rounded">Simpan</button>
|
<button class="bg-blue-600 text-white px-3 py-1 rounded">Simpan</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -153,7 +165,8 @@
|
|||||||
<div id="modalEdit{{ $template->id }}" class="fixed inset-0 hidden items-center justify-center z-50">
|
<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="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 overflow-hidden">
|
<div class="bg-white rounded-lg shadow-lg w-full max-w-md z-50 overflow-hidden">
|
||||||
<form action="{{ route('templates.update', $template->id) }}" method="POST" enctype="multipart/form-data">
|
<form action="{{ route('templates.update', $template->id) }}" method="POST"
|
||||||
|
enctype="multipart/form-data">
|
||||||
@csrf @method('PUT')
|
@csrf @method('PUT')
|
||||||
<div class="p-4 border-b">
|
<div class="p-4 border-b">
|
||||||
<h5 class="text-lg font-medium">Edit Template</h5>
|
<h5 class="text-lg font-medium">Edit Template</h5>
|
||||||
@ -168,7 +181,8 @@
|
|||||||
<label class="block text-sm font-medium">Kategori</label>
|
<label class="block text-sm font-medium">Kategori</label>
|
||||||
<select name="kategori_id" class="w-full p-2 border rounded" required>
|
<select name="kategori_id" class="w-full p-2 border rounded" required>
|
||||||
@foreach ($kategoris as $kategori)
|
@foreach ($kategoris as $kategori)
|
||||||
<option value="{{ $kategori->id }}" @selected($kategori->id == $template->kategori_id)>{{ $kategori->nama }}</option>
|
<option value="{{ $kategori->id }}" @selected($kategori->id == $template->kategori_id)>
|
||||||
|
{{ $kategori->nama }}</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -176,7 +190,8 @@
|
|||||||
<label class="block text-sm font-medium">Fitur</label>
|
<label class="block text-sm font-medium">Fitur</label>
|
||||||
<select name="fitur_id" class="w-full p-2 border rounded" required>
|
<select name="fitur_id" class="w-full p-2 border rounded" required>
|
||||||
@foreach ($fiturs as $fitur)
|
@foreach ($fiturs as $fitur)
|
||||||
<option value="{{ $fitur->id }}" @selected($fitur->id == $template->fitur_id)>{{ $fitur->deskripsi }}</option>
|
<option value="{{ $fitur->id }}" @selected($fitur->id == $template->fitur_id)>
|
||||||
|
{{ $fitur->deskripsi }}</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -190,7 +205,8 @@
|
|||||||
@if ($template->foto)
|
@if ($template->foto)
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<small class="text-gray-500">Foto saat ini:</small>
|
<small class="text-gray-500">Foto saat ini:</small>
|
||||||
<div class="w-20 h-20 mt-1 overflow-hidden rounded bg-gray-100 flex items-center justify-center border">
|
<div
|
||||||
|
class="w-20 h-20 mt-1 overflow-hidden rounded bg-gray-100 flex items-center justify-center border">
|
||||||
<img src="{{ asset('storage/' . $template->foto) }}" alt="foto"
|
<img src="{{ asset('storage/' . $template->foto) }}" alt="foto"
|
||||||
class="max-w-full max-h-full object-contain">
|
class="max-w-full max-h-full object-contain">
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user