admin-artikel final done

This commit is contained in:
E31232303evimr 2026-03-16 09:33:12 +07:00
parent 54e82c61a7
commit 0501d241b6
3 changed files with 317 additions and 141 deletions

View File

@ -3,133 +3,211 @@
@section('page-title', 'Tambah Artikel Hama & Penyakit') @section('page-title', 'Tambah Artikel Hama & Penyakit')
@section('page-subtitle', 'Tambah informasi hama dan penyakit kopi baru') @section('page-subtitle', 'Tambah informasi hama dan penyakit kopi baru')
@push('styles')
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
@endpush
@section('content') @section('content')
<div class="bg-white rounded-2xl shadow-lg"> <div class="bg-white rounded-2xl shadow-sm border border-gray-100">
{{-- Form Header --}}
<div class="px-8 py-5 border-b border-gray-100 flex items-center gap-3">
<div class="w-10 h-10 rounded-xl bg-red-50 flex items-center justify-center">
<i class="bi bi-plus-circle text-red-500 text-lg"></i>
</div>
<div>
<h3 class="font-bold text-gray-800 text-base leading-tight">Tambah Artikel Baru</h3>
<p class="text-xs text-gray-400 mt-0.5">Isi formulir di bawah untuk menambahkan artikel hama & penyakit kopi</p>
</div>
</div>
<div class="p-8"> <div class="p-8">
<form action="{{ route('admin.artikel-hama-penyakit.store') }}" method="POST" enctype="multipart/form-data"> <form action="{{ route('admin.artikel-hama-penyakit.store') }}" method="POST" enctype="multipart/form-data">
@csrf @csrf
<div class="space-y-6"> <div class="space-y-7">
<!-- Judul & Jenis -->
{{-- Judul & Jenis --}}
<div class="grid grid-cols-1 md:grid-cols-2 gap-6"> <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Judul <span class="text-red-500">*</span></label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
Judul <span class="text-red-500">*</span>
</label>
<input type="text" name="judul" value="{{ old('judul') }}" <input type="text" name="judul" value="{{ old('judul') }}"
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500 focus:border-transparent @error('judul') border-red-500 @enderror" class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-800 placeholder-gray-300 focus:ring-2 focus:ring-red-400 focus:border-transparent transition @error('judul') border-red-400 bg-red-50 @enderror"
placeholder="Masukkan judul artikel..."> placeholder="Masukkan judul artikel...">
@error('judul') <p class="text-red-500 text-xs mt-1">{{ $message }}</p> @enderror @error('judul')
<p class="text-red-500 text-xs mt-1.5 flex items-center gap-1">
<i class="bi bi-exclamation-circle"></i> {{ $message }}
</p>
@enderror
</div> </div>
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Jenis <span class="text-red-500">*</span></label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
<select name="jenis" class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500 focus:border-transparent @error('jenis') border-red-500 @enderror"> Jenis <span class="text-red-500">*</span>
<option value="">-- Pilih Jenis --</option> </label>
<option value="Hama" {{ old('jenis') === 'Hama' ? 'selected' : '' }}>Hama</option> <div class="relative">
<option value="Penyakit" {{ old('jenis') === 'Penyakit' ? 'selected' : '' }}>Penyakit</option> <select name="jenis" class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-800 focus:ring-2 focus:ring-red-400 focus:border-transparent appearance-none transition bg-white @error('jenis') border-red-400 bg-red-50 @enderror">
</select> <option value="">-- Pilih Jenis --</option>
@error('jenis') <p class="text-red-500 text-xs mt-1">{{ $message }}</p> @enderror <option value="Hama" {{ old('jenis') === 'Hama' ? 'selected' : '' }}>Hama</option>
<option value="Penyakit" {{ old('jenis') === 'Penyakit' ? 'selected' : '' }}>Penyakit</option>
</select>
<i class="bi bi-chevron-down absolute right-4 top-1/2 -translate-y-1/2 text-gray-400 text-xs pointer-events-none"></i>
</div>
@error('jenis')
<p class="text-red-500 text-xs mt-1.5 flex items-center gap-1">
<i class="bi bi-exclamation-circle"></i> {{ $message }}
</p>
@enderror
</div> </div>
</div> </div>
<!-- Deskripsi Singkat --> {{-- Deskripsi Singkat --}}
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Deskripsi Singkat</label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">Deskripsi Singkat</label>
<textarea name="deskripsi_singkat" rows="3" <textarea name="deskripsi_singkat" rows="3"
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500 focus:border-transparent" class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-800 placeholder-gray-300 focus:ring-2 focus:ring-red-400 focus:border-transparent transition resize-none"
placeholder="Ringkasan singkat...">{{ old('deskripsi_singkat') }}</textarea> placeholder="Ringkasan singkat artikel...">{{ old('deskripsi_singkat') }}</textarea>
</div> </div>
<!-- Konten --> {{-- Konten --}}
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Konten <span class="text-red-500">*</span></label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
Konten <span class="text-red-500">*</span>
</label>
<textarea name="konten" rows="8" <textarea name="konten" rows="8"
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500 focus:border-transparent @error('konten') border-red-500 @enderror" class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-800 placeholder-gray-300 focus:ring-2 focus:ring-red-400 focus:border-transparent transition resize-y @error('konten') border-red-400 bg-red-50 @enderror"
placeholder="Tulis konten artikel...">{{ old('konten') }}</textarea> placeholder="Tulis konten artikel secara lengkap...">{{ old('konten') }}</textarea>
@error('konten') <p class="text-red-500 text-xs mt-1">{{ $message }}</p> @enderror @error('konten')
<p class="text-red-500 text-xs mt-1.5 flex items-center gap-1">
<i class="bi bi-exclamation-circle"></i> {{ $message }}
</p>
@enderror
</div> </div>
<!-- Info Spesifik Hama Penyakit --> {{-- Informasi Teknis --}}
<div class="border border-gray-200 rounded-xl p-6 bg-gray-50"> <div class="border border-gray-100 rounded-2xl overflow-hidden">
<h4 class="font-bold text-gray-700 mb-4">📋 Informasi Teknis</h4> <div class="px-6 py-4 bg-gray-50 border-b border-gray-100 flex items-center gap-2">
<div class="space-y-4"> <i class="bi bi-clipboard2-pulse text-gray-500 text-base"></i>
<h4 class="font-semibold text-gray-700 text-sm">Informasi Teknis</h4>
</div>
<div class="p-6 space-y-5">
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Gejala Visual</label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
<i class="bi bi-eye text-gray-400 mr-1"></i>Gejala Visual
</label>
<textarea name="gejala_visual" rows="3" <textarea name="gejala_visual" rows="3"
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500 bg-white" class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-800 placeholder-gray-300 focus:ring-2 focus:ring-red-400 focus:border-transparent transition resize-none"
placeholder="Deskripsikan gejala yang terlihat...">{{ old('gejala_visual') }}</textarea> placeholder="Deskripsikan gejala yang terlihat pada tanaman...">{{ old('gejala_visual') }}</textarea>
</div> </div>
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Cara Identifikasi</label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
<i class="bi bi-search text-gray-400 mr-1"></i>Cara Identifikasi
</label>
<textarea name="cara_identifikasi" rows="3" <textarea name="cara_identifikasi" rows="3"
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500 bg-white" class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-800 placeholder-gray-300 focus:ring-2 focus:ring-red-400 focus:border-transparent transition resize-none"
placeholder="Cara mengidentifikasi...">{{ old('cara_identifikasi') }}</textarea> placeholder="Cara mengidentifikasi hama/penyakit ini...">{{ old('cara_identifikasi') }}</textarea>
</div> </div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4"> <div class="grid grid-cols-1 md:grid-cols-2 gap-5">
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Pencegahan</label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
<i class="bi bi-shield-check text-gray-400 mr-1"></i>Pencegahan
</label>
<textarea name="pencegahan" rows="4" <textarea name="pencegahan" rows="4"
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500 bg-white" class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-800 placeholder-gray-300 focus:ring-2 focus:ring-red-400 focus:border-transparent transition resize-none"
placeholder="Langkah pencegahan...">{{ old('pencegahan') }}</textarea> placeholder="Langkah-langkah pencegahan...">{{ old('pencegahan') }}</textarea>
</div> </div>
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Pengendalian</label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
<i class="bi bi-tools text-gray-400 mr-1"></i>Pengendalian
</label>
<textarea name="pengendalian" rows="4" <textarea name="pengendalian" rows="4"
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500 bg-white" class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-800 placeholder-gray-300 focus:ring-2 focus:ring-red-400 focus:border-transparent transition resize-none"
placeholder="Cara pengendalian...">{{ old('pengendalian') }}</textarea> placeholder="Cara pengendalian yang efektif...">{{ old('pengendalian') }}</textarea>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- Gambar & PDF --> {{-- Gambar & PDF --}}
<div class="grid grid-cols-1 md:grid-cols-2 gap-6"> <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Gambar Utama</label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
<i class="bi bi-image text-gray-400 mr-1"></i>Gambar Utama
</label>
<input type="file" name="gambar_utama" accept="image/*" <input type="file" name="gambar_utama" accept="image/*"
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500"> class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-600 file:mr-3 file:py-1 file:px-3 file:rounded-lg file:border-0 file:text-xs file:font-semibold file:bg-red-50 file:text-red-600 hover:file:bg-red-100 transition">
<p class="text-xs text-gray-400 mt-1">Format: JPG, PNG. Maks 2MB</p> <p class="text-xs text-gray-400 mt-1.5 flex items-center gap-1">
<i class="bi bi-info-circle"></i> Format: JPG, PNG. Maks 2MB
</p>
</div> </div>
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">File PDF</label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
<i class="bi bi-file-earmark-pdf text-gray-400 mr-1"></i>File PDF
</label>
<input type="file" name="file_pdf" accept=".pdf" <input type="file" name="file_pdf" accept=".pdf"
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500"> class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-600 file:mr-3 file:py-1 file:px-3 file:rounded-lg file:border-0 file:text-xs file:font-semibold file:bg-red-50 file:text-red-600 hover:file:bg-red-100 transition">
<p class="text-xs text-gray-400 mt-1">Format: PDF. Maks 5MB</p> <p class="text-xs text-gray-400 mt-1.5 flex items-center gap-1">
<i class="bi bi-info-circle"></i> Format: PDF. Maks 5MB
</p>
</div> </div>
</div> </div>
<!-- Tags --> {{-- Tags --}}
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Tags</label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
<div id="tags-container" class="w-full px-4 py-3 border border-gray-300 rounded-xl flex flex-wrap gap-2 min-h-[50px]"></div> <i class="bi bi-tags text-gray-400 mr-1"></i>Tags
</label>
<div id="tags-container"
class="w-full px-4 py-3 border border-gray-200 rounded-xl flex flex-wrap gap-2 min-h-[50px] bg-gray-50/50 cursor-text"
onclick="document.getElementById('tags-input').focus()">
</div>
<input type="text" id="tags-input" <input type="text" id="tags-input"
class="w-full mt-2 px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500" class="w-full mt-2 px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-800 placeholder-gray-300 focus:ring-2 focus:ring-red-400 focus:border-transparent transition"
placeholder="Ketik tag lalu tekan Enter..."> placeholder="Ketik tag lalu tekan Enter atau koma...">
<p class="text-xs text-gray-400 mt-1">Tekan Enter atau koma untuk menambah tag</p> <p class="text-xs text-gray-400 mt-1.5 flex items-center gap-1">
<i class="bi bi-keyboard"></i> Tekan Enter atau koma untuk menambah tag
</p>
<input type="hidden" name="tags" id="tags-hidden" value="[]"> <input type="hidden" name="tags" id="tags-hidden" value="[]">
</div> </div>
<!-- Galeri Gambar --> {{-- Galeri Gambar --}}
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Galeri Gambar</label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
<i class="bi bi-images text-gray-400 mr-1"></i>Galeri Gambar
</label>
<input type="file" name="galeri_gambar[]" accept="image/*" multiple <input type="file" name="galeri_gambar[]" accept="image/*" multiple
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500"> class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-600 file:mr-3 file:py-1 file:px-3 file:rounded-lg file:border-0 file:text-xs file:font-semibold file:bg-red-50 file:text-red-600 hover:file:bg-red-100 transition">
<p class="text-xs text-gray-400 mt-1">Bisa pilih beberapa foto sekaligus. Format: JPG, PNG. Maks 2MB per foto</p> <p class="text-xs text-gray-400 mt-1.5 flex items-center gap-1">
<i class="bi bi-info-circle"></i> Bisa pilih beberapa foto sekaligus. Format: JPG, PNG. Maks 2MB per foto
</p>
</div> </div>
<!-- Status Publish --> {{-- Status Publish --}}
<div class="flex items-center space-x-3"> <div class="flex items-center gap-3 p-4 rounded-xl border border-gray-100 bg-gray-50/60">
<input type="checkbox" name="is_published" value="1" id="is_published" {{ old('is_published') ? 'checked' : '' }} <label class="relative inline-flex items-center cursor-pointer">
class="w-5 h-5 text-red-600 rounded focus:ring-red-500"> <input type="checkbox" name="is_published" value="1" id="is_published"
<label for="is_published" class="text-sm font-bold text-gray-700">Publikasikan sekarang</label> {{ old('is_published') ? 'checked' : '' }}
class="sr-only peer">
<div class="w-10 h-5 bg-gray-200 rounded-full peer peer-checked:bg-red-500 peer-focus:ring-2 peer-focus:ring-red-300 transition-all after:content-[''] after:absolute after:top-0.5 after:left-0.5 after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:after:translate-x-5"></div>
</label>
<div>
<label for="is_published" class="text-sm font-semibold text-gray-700 cursor-pointer">Publikasikan Sekarang</label>
<p class="text-xs text-gray-400">Artikel akan langsung tampil di halaman publik</p>
</div>
</div> </div>
</div> </div>
<!-- Buttons --> {{-- Action Buttons --}}
<div class="flex justify-end space-x-3 mt-8 pt-6 border-t border-gray-200"> <div class="flex items-center justify-between mt-8 pt-6 border-t border-gray-100">
<a href="{{ route('admin.artikel-hama-penyakit.index') }}" class="px-6 py-3 border border-gray-300 text-gray-700 font-semibold rounded-xl hover:bg-gray-50 transition"> <a href="{{ route('admin.artikel-hama-penyakit.index') }}"
Batal class="inline-flex items-center gap-2 px-5 py-2.5 border border-gray-200 text-gray-600 text-sm font-semibold rounded-xl hover:bg-gray-50 hover:border-gray-300 transition">
<i class="bi bi-arrow-left"></i> Batal
</a> </a>
<button type="submit" class="px-6 py-3 bg-gradient-to-r from-red-500 to-red-600 text-white font-bold rounded-xl hover:from-red-600 hover:to-red-700 transition shadow-lg"> <button type="submit"
Simpan Artikel class="inline-flex items-center gap-2 px-6 py-2.5 bg-gradient-to-r from-red-500 to-red-600 text-white text-sm font-bold rounded-xl hover:from-red-600 hover:to-red-700 transition shadow-md shadow-red-100 active:scale-95">
<i class="bi bi-floppy2-fill"></i> Simpan Artikel
</button> </button>
</div> </div>
</form> </form>
@ -148,9 +226,13 @@ function renderTags() {
tagsContainer.innerHTML = ''; tagsContainer.innerHTML = '';
tags.forEach((tag, index) => { tags.forEach((tag, index) => {
tagsContainer.innerHTML += ` tagsContainer.innerHTML += `
<span class="flex items-center px-3 py-1 bg-red-100 text-red-800 text-xs font-bold rounded-full"> <span class="inline-flex items-center gap-1.5 px-3 py-1 bg-red-50 text-red-700 text-xs font-semibold rounded-lg border border-red-100">
<i class="bi bi-tag-fill text-red-400 text-[10px]"></i>
${tag} ${tag}
<button type="button" onclick="removeTag(${index})" class="ml-2 text-red-600 hover:text-red-900"></button> <button type="button" onclick="removeTag(${index})"
class="ml-0.5 text-red-300 hover:text-red-600 transition leading-none">
<i class="bi bi-x-lg text-[10px]"></i>
</button>
</span>`; </span>`;
}); });
tagsHidden.value = JSON.stringify(tags); tagsHidden.value = JSON.stringify(tags);

View File

@ -3,138 +3,228 @@
@section('page-title', 'Edit Artikel Hama & Penyakit') @section('page-title', 'Edit Artikel Hama & Penyakit')
@section('page-subtitle', 'Edit informasi hama dan penyakit kopi') @section('page-subtitle', 'Edit informasi hama dan penyakit kopi')
@push('styles')
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
@endpush
@section('content') @section('content')
<div class="bg-white rounded-2xl shadow-lg"> <div class="bg-white rounded-2xl shadow-sm border border-gray-100">
{{-- Form Header --}}
<div class="px-8 py-5 border-b border-gray-100 flex items-center gap-3">
<div class="w-10 h-10 rounded-xl bg-red-50 flex items-center justify-center">
<i class="bi bi-pencil-square text-red-500 text-lg"></i>
</div>
<div>
<h3 class="font-bold text-gray-800 text-base leading-tight">Edit Artikel</h3>
<p class="text-xs text-gray-400 mt-0.5">Perbarui informasi hama dan penyakit kopi</p>
</div>
</div>
<div class="p-8"> <div class="p-8">
<form action="{{ route('admin.artikel-hama-penyakit.update', $artikelHamaPenyakit) }}" method="POST" enctype="multipart/form-data"> <form action="{{ route('admin.artikel-hama-penyakit.update', $artikelHamaPenyakit) }}" method="POST" enctype="multipart/form-data">
@csrf @csrf
@method('PUT') @method('PUT')
<div class="space-y-6"> <div class="space-y-7">
<!-- Judul & Jenis -->
{{-- Judul & Jenis --}}
<div class="grid grid-cols-1 md:grid-cols-2 gap-6"> <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Judul <span class="text-red-500">*</span></label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
Judul <span class="text-red-500">*</span>
</label>
<input type="text" name="judul" value="{{ old('judul', $artikelHamaPenyakit->judul) }}" <input type="text" name="judul" value="{{ old('judul', $artikelHamaPenyakit->judul) }}"
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500 focus:border-transparent @error('judul') border-red-500 @enderror"> class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-800 placeholder-gray-300 focus:ring-2 focus:ring-red-400 focus:border-transparent transition @error('judul') border-red-400 bg-red-50 @enderror"
@error('judul') <p class="text-red-500 text-xs mt-1">{{ $message }}</p> @enderror placeholder="Judul artikel...">
@error('judul')
<p class="text-red-500 text-xs mt-1.5 flex items-center gap-1">
<i class="bi bi-exclamation-circle"></i> {{ $message }}
</p>
@enderror
</div> </div>
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Jenis <span class="text-red-500">*</span></label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
<select name="jenis" class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500 focus:border-transparent"> Jenis <span class="text-red-500">*</span>
<option value="Hama" {{ old('jenis', $artikelHamaPenyakit->jenis) === 'Hama' ? 'selected' : '' }}>Hama</option> </label>
<option value="Penyakit" {{ old('jenis', $artikelHamaPenyakit->jenis) === 'Penyakit' ? 'selected' : '' }}>Penyakit</option> <div class="relative">
</select> <select name="jenis" class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-800 focus:ring-2 focus:ring-red-400 focus:border-transparent appearance-none transition bg-white">
<option value="Hama" {{ old('jenis', $artikelHamaPenyakit->jenis) === 'Hama' ? 'selected' : '' }}>Hama</option>
<option value="Penyakit" {{ old('jenis', $artikelHamaPenyakit->jenis) === 'Penyakit' ? 'selected' : '' }}>Penyakit</option>
</select>
<i class="bi bi-chevron-down absolute right-4 top-1/2 -translate-y-1/2 text-gray-400 text-xs pointer-events-none"></i>
</div>
</div> </div>
</div> </div>
<!-- Deskripsi Singkat --> {{-- Deskripsi Singkat --}}
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Deskripsi Singkat</label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">Deskripsi Singkat</label>
<textarea name="deskripsi_singkat" rows="3" <textarea name="deskripsi_singkat" rows="3"
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500 focus:border-transparent">{{ old('deskripsi_singkat', $artikelHamaPenyakit->deskripsi_singkat) }}</textarea> class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-800 placeholder-gray-300 focus:ring-2 focus:ring-red-400 focus:border-transparent transition resize-none"
placeholder="Ringkasan singkat artikel...">{{ old('deskripsi_singkat', $artikelHamaPenyakit->deskripsi_singkat) }}</textarea>
</div> </div>
<!-- Konten --> {{-- Konten --}}
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Konten <span class="text-red-500">*</span></label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
Konten <span class="text-red-500">*</span>
</label>
<textarea name="konten" rows="8" <textarea name="konten" rows="8"
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500 focus:border-transparent @error('konten') border-red-500 @enderror">{{ old('konten', $artikelHamaPenyakit->konten) }}</textarea> class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-800 placeholder-gray-300 focus:ring-2 focus:ring-red-400 focus:border-transparent transition resize-y @error('konten') border-red-400 bg-red-50 @enderror"
@error('konten') <p class="text-red-500 text-xs mt-1">{{ $message }}</p> @enderror placeholder="Tulis konten artikel...">{{ old('konten', $artikelHamaPenyakit->konten) }}</textarea>
@error('konten')
<p class="text-red-500 text-xs mt-1.5 flex items-center gap-1">
<i class="bi bi-exclamation-circle"></i> {{ $message }}
</p>
@enderror
</div> </div>
<!-- Info Teknis --> {{-- Informasi Teknis --}}
<div class="border border-gray-200 rounded-xl p-6 bg-gray-50"> <div class="border border-gray-100 rounded-2xl overflow-hidden">
<h4 class="font-bold text-gray-700 mb-4">📋 Informasi Teknis</h4> <div class="px-6 py-4 bg-gray-50 border-b border-gray-100 flex items-center gap-2">
<div class="space-y-4"> <i class="bi bi-clipboard2-pulse text-gray-500 text-base"></i>
<h4 class="font-semibold text-gray-700 text-sm">Informasi Teknis</h4>
</div>
<div class="p-6 space-y-5">
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Gejala Visual</label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
<i class="bi bi-eye text-gray-400 mr-1"></i>Gejala Visual
</label>
<textarea name="gejala_visual" rows="3" <textarea name="gejala_visual" rows="3"
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500 bg-white">{{ old('gejala_visual', $artikelHamaPenyakit->gejala_visual) }}</textarea> class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-800 placeholder-gray-300 focus:ring-2 focus:ring-red-400 focus:border-transparent transition resize-none"
placeholder="Deskripsikan gejala yang terlihat...">{{ old('gejala_visual', $artikelHamaPenyakit->gejala_visual) }}</textarea>
</div> </div>
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Cara Identifikasi</label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
<i class="bi bi-search text-gray-400 mr-1"></i>Cara Identifikasi
</label>
<textarea name="cara_identifikasi" rows="3" <textarea name="cara_identifikasi" rows="3"
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500 bg-white">{{ old('cara_identifikasi', $artikelHamaPenyakit->cara_identifikasi) }}</textarea> class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-800 placeholder-gray-300 focus:ring-2 focus:ring-red-400 focus:border-transparent transition resize-none"
placeholder="Cara mengidentifikasi...">{{ old('cara_identifikasi', $artikelHamaPenyakit->cara_identifikasi) }}</textarea>
</div> </div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4"> <div class="grid grid-cols-1 md:grid-cols-2 gap-5">
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Pencegahan</label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
<i class="bi bi-shield-check text-gray-400 mr-1"></i>Pencegahan
</label>
<textarea name="pencegahan" rows="4" <textarea name="pencegahan" rows="4"
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500 bg-white">{{ old('pencegahan', $artikelHamaPenyakit->pencegahan) }}</textarea> class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-800 placeholder-gray-300 focus:ring-2 focus:ring-red-400 focus:border-transparent transition resize-none"
placeholder="Langkah pencegahan...">{{ old('pencegahan', $artikelHamaPenyakit->pencegahan) }}</textarea>
</div> </div>
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Pengendalian</label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
<i class="bi bi-tools text-gray-400 mr-1"></i>Pengendalian
</label>
<textarea name="pengendalian" rows="4" <textarea name="pengendalian" rows="4"
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500 bg-white">{{ old('pengendalian', $artikelHamaPenyakit->pengendalian) }}</textarea> class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-800 placeholder-gray-300 focus:ring-2 focus:ring-red-400 focus:border-transparent transition resize-none"
placeholder="Cara pengendalian...">{{ old('pengendalian', $artikelHamaPenyakit->pengendalian) }}</textarea>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- Gambar & PDF --> {{-- Gambar & PDF --}}
<div class="grid grid-cols-1 md:grid-cols-2 gap-6"> <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Gambar Utama</label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
<i class="bi bi-image text-gray-400 mr-1"></i>Gambar Utama
</label>
@if($artikelHamaPenyakit->gambar_utama) @if($artikelHamaPenyakit->gambar_utama)
<img src="{{ Storage::url($artikelHamaPenyakit->gambar_utama) }}" class="w-32 h-24 object-cover rounded-lg mb-2"> <div class="mb-3 relative inline-block">
<img src="{{ Storage::url($artikelHamaPenyakit->gambar_utama) }}"
class="w-32 h-24 object-cover rounded-xl border border-gray-200 shadow-sm">
<span class="absolute -top-1.5 -right-1.5 bg-green-500 text-white text-[10px] font-bold px-1.5 py-0.5 rounded-full">Aktif</span>
</div>
@endif @endif
<input type="file" name="gambar_utama" accept="image/*" <input type="file" name="gambar_utama" accept="image/*"
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500"> class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-600 file:mr-3 file:py-1 file:px-3 file:rounded-lg file:border-0 file:text-xs file:font-semibold file:bg-red-50 file:text-red-600 hover:file:bg-red-100 transition">
<p class="text-xs text-gray-400 mt-1">Kosongkan jika tidak ingin mengubah</p> <p class="text-xs text-gray-400 mt-1.5 flex items-center gap-1">
<i class="bi bi-info-circle"></i> Kosongkan jika tidak ingin mengubah
</p>
</div> </div>
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">File PDF</label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
<i class="bi bi-file-earmark-pdf text-gray-400 mr-1"></i>File PDF
</label>
@if($artikelHamaPenyakit->file_pdf) @if($artikelHamaPenyakit->file_pdf)
<a href="{{ Storage::url($artikelHamaPenyakit->file_pdf) }}" target="_blank" class="text-xs text-blue-500 underline mb-2 block">Lihat PDF saat ini</a> <a href="{{ Storage::url($artikelHamaPenyakit->file_pdf) }}" target="_blank"
class="inline-flex items-center gap-1.5 text-xs text-red-500 font-medium hover:text-red-700 mb-3 border border-red-100 bg-red-50 px-3 py-1.5 rounded-lg transition">
<i class="bi bi-file-earmark-pdf-fill"></i> Lihat PDF saat ini
<i class="bi bi-box-arrow-up-right text-[10px]"></i>
</a>
@endif @endif
<input type="file" name="file_pdf" accept=".pdf" <input type="file" name="file_pdf" accept=".pdf"
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500"> class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-600 file:mr-3 file:py-1 file:px-3 file:rounded-lg file:border-0 file:text-xs file:font-semibold file:bg-red-50 file:text-red-600 hover:file:bg-red-100 transition">
<p class="text-xs text-gray-400 mt-1">Kosongkan jika tidak ingin mengubah</p> <p class="text-xs text-gray-400 mt-1.5 flex items-center gap-1">
<i class="bi bi-info-circle"></i> Kosongkan jika tidak ingin mengubah
</p>
</div> </div>
</div> </div>
<!-- Tags --> {{-- Tags --}}
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Tags</label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
<div id="tags-container" class="w-full px-4 py-3 border border-gray-300 rounded-xl flex flex-wrap gap-2 min-h-[50px]"></div> <i class="bi bi-tags text-gray-400 mr-1"></i>Tags
</label>
<div id="tags-container"
class="w-full px-4 py-3 border border-gray-200 rounded-xl flex flex-wrap gap-2 min-h-[50px] bg-gray-50/50 cursor-text"
onclick="document.getElementById('tags-input').focus()">
</div>
<input type="text" id="tags-input" <input type="text" id="tags-input"
class="w-full mt-2 px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500" class="w-full mt-2 px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-800 placeholder-gray-300 focus:ring-2 focus:ring-red-400 focus:border-transparent transition"
placeholder="Ketik tag lalu tekan Enter..."> placeholder="Ketik tag lalu tekan Enter atau koma...">
<p class="text-xs text-gray-400 mt-1">Tekan Enter atau koma untuk menambah tag</p> <p class="text-xs text-gray-400 mt-1.5 flex items-center gap-1">
<i class="bi bi-keyboard"></i> Tekan Enter atau koma untuk menambah tag
</p>
<input type="hidden" name="tags" id="tags-hidden" value="[]"> <input type="hidden" name="tags" id="tags-hidden" value="[]">
</div> </div>
<!-- Galeri Gambar --> {{-- Galeri Gambar --}}
<div> <div>
<label class="block text-sm font-bold text-gray-700 mb-2">Galeri Gambar</label> <label class="block text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">
<i class="bi bi-images text-gray-400 mr-1"></i>Galeri Gambar
</label>
@if($artikelHamaPenyakit->galeri_gambar) @if($artikelHamaPenyakit->galeri_gambar)
<div class="flex flex-wrap gap-2 mb-3"> <div class="flex flex-wrap gap-2 mb-3">
@foreach($artikelHamaPenyakit->galeri_gambar as $foto) @foreach($artikelHamaPenyakit->galeri_gambar as $foto)
<img src="{{ Storage::url($foto) }}" class="w-24 h-20 object-cover rounded-lg"> <img src="{{ Storage::url($foto) }}"
class="w-24 h-20 object-cover rounded-xl border border-gray-200 shadow-sm">
@endforeach @endforeach
</div> </div>
@endif @endif
<input type="file" name="galeri_gambar[]" accept="image/*" multiple <input type="file" name="galeri_gambar[]" accept="image/*" multiple
class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-red-500"> class="w-full px-4 py-3 border border-gray-200 rounded-xl text-sm text-gray-600 file:mr-3 file:py-1 file:px-3 file:rounded-lg file:border-0 file:text-xs file:font-semibold file:bg-red-50 file:text-red-600 hover:file:bg-red-100 transition">
<p class="text-xs text-gray-400 mt-1">Upload foto baru akan menggantikan galeri yang lama</p> <p class="text-xs text-gray-400 mt-1.5 flex items-center gap-1">
<i class="bi bi-exclamation-triangle"></i> Upload foto baru akan menggantikan galeri yang lama
</p>
</div> </div>
<!-- Status Publish --> {{-- Status Publish --}}
<div class="flex items-center space-x-3"> <div class="flex items-center gap-3 p-4 rounded-xl border border-gray-100 bg-gray-50/60">
<input type="checkbox" name="is_published" value="1" id="is_published" {{ old('is_published', $artikelHamaPenyakit->is_published) ? 'checked' : '' }} <label class="relative inline-flex items-center cursor-pointer">
class="w-5 h-5 text-red-600 rounded focus:ring-red-500"> <input type="checkbox" name="is_published" value="1" id="is_published"
<label for="is_published" class="text-sm font-bold text-gray-700">Publikasikan</label> {{ old('is_published', $artikelHamaPenyakit->is_published) ? 'checked' : '' }}
class="sr-only peer">
<div class="w-10 h-5 bg-gray-200 rounded-full peer peer-checked:bg-red-500 peer-focus:ring-2 peer-focus:ring-red-300 transition-all after:content-[''] after:absolute after:top-0.5 after:left-0.5 after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:after:translate-x-5"></div>
</label>
<div>
<label for="is_published" class="text-sm font-semibold text-gray-700 cursor-pointer">Publikasikan Artikel</label>
<p class="text-xs text-gray-400">Artikel akan langsung tampil di halaman publik</p>
</div>
</div> </div>
</div> </div>
<!-- Buttons --> {{-- Action Buttons --}}
<div class="flex justify-end space-x-3 mt-8 pt-6 border-t border-gray-200"> <div class="flex items-center justify-between mt-8 pt-6 border-t border-gray-100">
<a href="{{ route('admin.artikel-hama-penyakit.index') }}" class="px-6 py-3 border border-gray-300 text-gray-700 font-semibold rounded-xl hover:bg-gray-50 transition"> <a href="{{ route('admin.artikel-hama-penyakit.index') }}"
Batal class="inline-flex items-center gap-2 px-5 py-2.5 border border-gray-200 text-gray-600 text-sm font-semibold rounded-xl hover:bg-gray-50 hover:border-gray-300 transition">
<i class="bi bi-arrow-left"></i> Batal
</a> </a>
<button type="submit" class="px-6 py-3 bg-gradient-to-r from-red-500 to-red-600 text-white font-bold rounded-xl hover:from-red-600 hover:to-red-700 transition shadow-lg"> <button type="submit"
Update Artikel class="inline-flex items-center gap-2 px-6 py-2.5 bg-gradient-to-r from-red-500 to-red-600 text-white text-sm font-bold rounded-xl hover:from-red-600 hover:to-red-700 transition shadow-md shadow-red-100 active:scale-95">
<i class="bi bi-check2-circle"></i> Update Artikel
</button> </button>
</div> </div>
</form> </form>
@ -155,9 +245,13 @@ function renderTags() {
tagsContainer.innerHTML = ''; tagsContainer.innerHTML = '';
tags.forEach((tag, index) => { tags.forEach((tag, index) => {
tagsContainer.innerHTML += ` tagsContainer.innerHTML += `
<span class="flex items-center px-3 py-1 bg-red-100 text-red-800 text-xs font-bold rounded-full"> <span class="inline-flex items-center gap-1.5 px-3 py-1 bg-red-50 text-red-700 text-xs font-semibold rounded-lg border border-red-100">
<i class="bi bi-tag-fill text-red-400 text-[10px]"></i>
${tag} ${tag}
<button type="button" onclick="removeTag(${index})" class="ml-2 text-red-600 hover:text-red-900"></button> <button type="button" onclick="removeTag(${index})"
class="ml-0.5 text-red-300 hover:text-red-600 transition leading-none">
<i class="bi bi-x-lg text-[10px]"></i>
</button>
</span>`; </span>`;
}); });
tagsHidden.value = JSON.stringify(tags); tagsHidden.value = JSON.stringify(tags);

View File

@ -130,8 +130,8 @@ class="p-2 rounded-lg hover:bg-gray-700 transition-colors"
<a href="{{ route('admin.dashboard') }}" <a href="{{ route('admin.dashboard') }}"
class="menu-item flex items-center px-4 py-3 rounded-xl hover:bg-gray-700 {{ request()->routeIs('admin.dashboard') ? 'active bg-gray-700' : '' }} group"> class="menu-item flex items-center px-4 py-3 rounded-xl hover:bg-gray-700 {{ request()->routeIs('admin.dashboard') ? 'active bg-gray-700' : '' }} group">
<div class="flex items-center flex-1"> <div class="flex items-center flex-1">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-green-500/20 group-hover:bg-green-500/30 transition-colors"> <div class="w-10 h-10 flex items-center justify-center rounded-lg bg-blue-500/20 group-hover:bg-blue-500/30 transition-colors">
<svg class="w-5 h-5 text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg class="w-5 h-5 text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"></path> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"></path>
</svg> </svg>
</div> </div>
@ -143,8 +143,8 @@ class="menu-item flex items-center px-4 py-3 rounded-xl hover:bg-gray-700 {{ req
<a href="{{ route('admin.penyakit.index') }}" <a href="{{ route('admin.penyakit.index') }}"
class="menu-item flex items-center px-4 py-3 rounded-xl hover:bg-gray-700 {{ request()->routeIs('admin.penyakit.*') ? 'active bg-gray-700' : '' }} group"> class="menu-item flex items-center px-4 py-3 rounded-xl hover:bg-gray-700 {{ request()->routeIs('admin.penyakit.*') ? 'active bg-gray-700' : '' }} group">
<div class="flex items-center flex-1"> <div class="flex items-center flex-1">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-green-500/20 group-hover:bg-green-500/30 transition-colors"> <div class="w-10 h-10 flex items-center justify-center rounded-lg bg-red-500/20 group-hover:bg-red-500/30 transition-colors">
<svg class="w-5 h-5 text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg class="w-5 h-5 text-red-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path>
</svg> </svg>
</div> </div>
@ -169,8 +169,8 @@ class="menu-item flex items-center px-4 py-3 rounded-xl hover:bg-gray-700 {{ req
<a href="{{ route('admin.rule-basis.index') }}" <a href="{{ route('admin.rule-basis.index') }}"
class="menu-item flex items-center px-4 py-3 rounded-xl hover:bg-gray-700 {{ request()->routeIs('admin.rule-basis.*') ? 'active bg-gray-700' : '' }} group"> class="menu-item flex items-center px-4 py-3 rounded-xl hover:bg-gray-700 {{ request()->routeIs('admin.rule-basis.*') ? 'active bg-gray-700' : '' }} group">
<div class="flex items-center flex-1"> <div class="flex items-center flex-1">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-green-500/20 group-hover:bg-green-500/30 transition-colors"> <div class="w-10 h-10 flex items-center justify-center rounded-lg group-hover:bg-blue-500/30 transition-colors" style="background-color: rgba(139, 92, 246, 0.2);">
<svg class="w-5 h-5 text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg class="w-5 h-5" style="color: #a78bfa;" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"></path> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"></path>
</svg> </svg>
</div> </div>
@ -185,8 +185,8 @@ class="menu-item flex items-center px-4 py-3 rounded-xl hover:bg-gray-700 {{ req
<button @click="informasiOpen = !informasiOpen" <button @click="informasiOpen = !informasiOpen"
class="menu-item w-full flex items-center px-4 py-3 rounded-xl hover:bg-gray-700 {{ request()->routeIs('admin.artikel-budidaya.*') || request()->routeIs('admin.artikel-hama-penyakit.*') ? 'active bg-gray-700' : '' }} group"> class="menu-item w-full flex items-center px-4 py-3 rounded-xl hover:bg-gray-700 {{ request()->routeIs('admin.artikel-budidaya.*') || request()->routeIs('admin.artikel-hama-penyakit.*') ? 'active bg-gray-700' : '' }} group">
<div class="flex items-center flex-1"> <div class="flex items-center flex-1">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-green-500/20 group-hover:bg-green-500/30 transition-colors"> <div class="w-10 h-10 flex items-center justify-center rounded-lg bg-yellow-500/20 group-hover:bg-yellow-500/30 transition-colors">
<svg class="w-5 h-5 text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg class="w-5 h-5 text-yellow-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"></path> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"></path>
</svg> </svg>
</div> </div>