444 lines
20 KiB
Plaintext
444 lines
20 KiB
Plaintext
@{
|
|
ViewData["Title"] = "CMS";
|
|
}
|
|
|
|
<div class="flex gap-2 flex-row justify-between md:gap-0 mt-2 mb-2">
|
|
<div class="prose">
|
|
<span class="text-xl font-semibold text-black font-['Plus Jakarta Sans']">Content Management System (Landing Page)</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex flex-col gap-6">
|
|
<!-- Section 1 -->
|
|
<div class="collapse collapse-arrow bg-base-100 shadow-xl">
|
|
<input type="checkbox" checked />
|
|
<div class="collapse-title text-gray-900 text-base font-semibold font-['Plus_Jakarta_Sans'] leading-8">
|
|
Gambar Utama Landing Page
|
|
</div>
|
|
<div class="collapse-content">
|
|
<form id="formTambah" onsubmit="submitForm(event)">
|
|
<div class="pt-4 flex flex-col gap-6">
|
|
<!-- Slide 1 -->
|
|
<div class="form-control w-full">
|
|
<label class="label">
|
|
<span class="label-text text-base font-medium">Slide 1 <span class="text-red-500">*</span></span>
|
|
</label>
|
|
<input type="file" class="file-input file-input-bordered w-full" accept="image/*" />
|
|
<label class="label">
|
|
<span class="label-text-alt text-base-content/60">Ukuran file maksimal 30 MB</span>
|
|
</label>
|
|
</div>
|
|
|
|
<!-- Slide 2 -->
|
|
<div class="form-control w-full">
|
|
<label class="label">
|
|
<span class="label-text text-base font-medium">Slide 2 <span class="text-red-500">*</span></span>
|
|
</label>
|
|
<input type="file" class="file-input file-input-bordered w-full" accept="image/*" />
|
|
<label class="label">
|
|
<span class="label-text-alt text-base-content/60">Ukuran file maksimal 30 MB</span>
|
|
</label>
|
|
</div>
|
|
|
|
<!-- Slide 3 -->
|
|
<div class="form-control w-full">
|
|
<label class="label">
|
|
<span class="label-text text-base font-medium">Slide 3 <span class="text-red-500">*</span></span>
|
|
</label>
|
|
<input type="file" class="file-input file-input-bordered w-full" accept="image/*" />
|
|
<label class="label">
|
|
<span class="label-text-alt text-base-content/60">Ukuran file maksimal 30 MB</span>
|
|
</label>
|
|
</div>
|
|
|
|
<!-- Submit Button -->
|
|
<div class="flex justify-end mb-4">
|
|
<button type="submit" class="w-full sm:w-auto px-8 py-2.5 bg-green-800 rounded-full text-white text-base font-semibold font-['Plus_Jakarta_Sans'] leading-6 hover:bg-green-900">
|
|
Simpan
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Section 2 -->
|
|
<div class="collapse collapse-arrow bg-base-100 shadow-xl">
|
|
<input type="checkbox" checked />
|
|
<div class="collapse-title text-gray-900 text-base font-semibold font-['Plus_Jakarta_Sans'] leading-8">
|
|
Tentang Kami
|
|
</div>
|
|
<div class="collapse-content">
|
|
<form id="formTambah" onsubmit="submitForm(event)">
|
|
<div class="pt-4 flex flex-col gap-6">
|
|
<div class="flex flex-col">
|
|
<fieldset class="fieldset">
|
|
<legend class="text-base">
|
|
Judul
|
|
</legend>
|
|
<input type="text" id="judul" class="input w-full" placeholder="Judul" required />
|
|
</fieldset>
|
|
</div>
|
|
|
|
<div class="flex flex-col">
|
|
<fieldset class="fieldset">
|
|
<legend class="text-base">
|
|
Deskripsi
|
|
</legend>
|
|
<textarea id="deskripsi" class="textarea w-full h-32" placeholder="Deskripsi" required></textarea>
|
|
</fieldset>
|
|
</div>
|
|
|
|
<div class="flex justify-end mb-4">
|
|
<button type="submit" class="w-full sm:w-auto px-8 py-2.5 bg-green-800 rounded-full text-white text-base font-semibold font-['Plus_Jakarta_Sans'] leading-6 hover:bg-green-900">
|
|
Simpan
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Regulasi -->
|
|
<div class="collapse collapse-arrow bg-base-100 shadow-xl">
|
|
<input type="checkbox" checked />
|
|
<div class="collapse-title text-gray-900 text-base font-semibold font-['Plus_Jakarta_Sans'] leading-8">
|
|
Regulasi
|
|
</div>
|
|
<div class="collapse-content">
|
|
<div class="flex justify-end mb-4">
|
|
<button type="button" class="btn bg-[#344054] text-white hover:bg-gray-900 px-4 py-2 rounded-full">
|
|
Tambah Regulasi
|
|
<i class="ph ph-plus"></i>
|
|
</button>
|
|
</div>
|
|
<div class="w-full overflow-x-auto">
|
|
<table class="table-zebra table w-full" id="example">
|
|
<!-- head -->
|
|
<thead>
|
|
<tr>
|
|
<th class="w-[10%]">No</th>
|
|
<th class="w-[20%]">Judul</th>
|
|
<th class="w-[15%]">Sub Judul</th>
|
|
<th class="w-[15%]">Ditetapkan</th>
|
|
<th class="w-[15%]">Status</th>
|
|
<th class="w-[10%]">Dokumen</th>
|
|
<th class="w-[15%]">Aksi</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Helpdesk -->
|
|
<div class="collapse collapse-arrow bg-base-100 shadow-xl">
|
|
<input type="checkbox" checked />
|
|
<div class="collapse-title text-gray-900 text-base font-semibold font-['Plus_Jakarta_Sans'] leading-8">
|
|
Halp Desk
|
|
</div>
|
|
<div class="collapse-content">
|
|
<div class="pt-4 flex flex-col gap-6">
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
<div class="flex flex-col">
|
|
<fieldset class="fieldset">
|
|
<legend class="text-base">
|
|
Nama Help Desk 1
|
|
</legend>
|
|
<input type="text" id="judul" class="input w-full" placeholder="Admin 1" required />
|
|
</fieldset>
|
|
</div>
|
|
<div class="flex flex-col">
|
|
<fieldset class="fieldset">
|
|
<legend class="text-base">
|
|
No. WhatsApp
|
|
</legend>
|
|
<input type="text" id="judul" class="input w-full" placeholder="08123456789" required />
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
<div class="flex flex-col">
|
|
<fieldset class="fieldset">
|
|
<legend class="text-base">
|
|
Nama Help Desk 2
|
|
</legend>
|
|
<input type="text" id="judul" class="input w-full" placeholder="Admin 2" required />
|
|
</fieldset>
|
|
</div>
|
|
<div class="flex flex-col">
|
|
<fieldset class="fieldset">
|
|
<legend class="text-base">
|
|
No. WhatsApp
|
|
</legend>
|
|
<input type="text" id="judul" class="input w-full" placeholder="08123456789" required />
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
<div class="flex flex-col">
|
|
<fieldset class="fieldset">
|
|
<legend class="text-base">
|
|
Nama Help Desk 3
|
|
</legend>
|
|
<input type="text" id="judul" class="input w-full" placeholder="Admin 3" required />
|
|
</fieldset>
|
|
</div>
|
|
<div class="flex flex-col">
|
|
<fieldset class="fieldset">
|
|
<legend class="text-base">
|
|
No. WhatsApp
|
|
</legend>
|
|
<input type="text" id="judul" class="input w-full" placeholder="08123456789" required />
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
<div class="flex flex-col">
|
|
<fieldset class="fieldset">
|
|
<legend class="text-base">
|
|
Nama Help Desk 4
|
|
</legend>
|
|
<input type="text" id="judul" class="input w-full" placeholder="Admin 4" required />
|
|
</fieldset>
|
|
</div>
|
|
<div class="flex flex-col">
|
|
<fieldset class="fieldset">
|
|
<legend class="text-base">
|
|
No. WhatsApp
|
|
</legend>
|
|
<input type="text" id="judul" class="input w-full" placeholder="08123456789" required />
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
<div class="flex flex-col">
|
|
<fieldset class="fieldset">
|
|
<legend class="text-base">
|
|
Nama Help Desk 5
|
|
</legend>
|
|
<input type="text" id="judul" class="input w-full" placeholder="Admin 5" required />
|
|
</fieldset>
|
|
</div>
|
|
<div class="flex flex-col">
|
|
<fieldset class="fieldset">
|
|
<legend class="text-base">
|
|
No. WhatsApp
|
|
</legend>
|
|
<input type="text" id="judul" class="input w-full" placeholder="08123456789" required />
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
<div class="flex flex-col">
|
|
<fieldset class="fieldset">
|
|
<legend class="text-base">
|
|
Nama Help Desk 6
|
|
</legend>
|
|
<input type="text" id="judul" class="input w-full" placeholder="Admin 6" required />
|
|
</fieldset>
|
|
</div>
|
|
<div class="flex flex-col">
|
|
<fieldset class="fieldset">
|
|
<legend class="text-base">
|
|
No. WhatsApp
|
|
</legend>
|
|
<input type="text" id="judul" class="input w-full" placeholder="08123456789" required />
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div class="flex justify-end mb-4">
|
|
<button type="submit" class="w-full sm:w-auto px-8 py-2.5 bg-green-800 rounded-full text-white text-base font-semibold font-['Plus_Jakarta_Sans'] leading-6 hover:bg-green-900">
|
|
Simpan
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Panduan -->
|
|
<div class="collapse collapse-arrow bg-base-100 shadow-xl">
|
|
<input type="checkbox" checked />
|
|
<div class="collapse-title text-gray-900 text-base font-semibold font-['Plus_Jakarta_Sans'] leading-8">
|
|
Regulasi
|
|
</div>
|
|
<div class="collapse-content">
|
|
<div class="flex justify-end mb-4">
|
|
<button type="button" class="btn bg-[#344054] text-white hover:bg-gray-900 px-4 py-2 rounded-full">
|
|
Tambah Regulasi
|
|
<i class="ph ph-plus"></i>
|
|
</button>
|
|
</div>
|
|
<div class="w-full overflow-x-auto">
|
|
<table class="table-zebra table w-full" id="examplePanduan">
|
|
<!-- head -->
|
|
<thead>
|
|
<tr>
|
|
<th class="w-[10%]">No</th>
|
|
<th class="w-[30%]">Judul</th>
|
|
<th class="w-[30%]">Jenis</th>
|
|
<th class="w-[15%]">Dokumen</th>
|
|
<th class="w-[15%]">Aksi</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
@section Scripts {
|
|
<script type="text/javascript">
|
|
var table, tablePanduan;
|
|
|
|
$(document).ready(function () {
|
|
table = new DataTable('#example', {
|
|
ajax: '/Main/Cms/TableRegulasi',
|
|
scrollX: true,
|
|
autoWidth: false,
|
|
initComplete: function () {
|
|
$('div.dt-scroll-body thead').css('visibility', 'collapse');
|
|
},
|
|
columns: [
|
|
{ data: null, render: (d, t, r, m) => m.row + 1, orderable: false, searchable: false },
|
|
{ data: 'judul' },
|
|
{
|
|
data: 'sub_judul',
|
|
className: 'truncate', // Class untuk efek ellipsis
|
|
render: function (data, type, row) {
|
|
// Menambahkan styling untuk memastikan ellipsis berfungsi dengan baik
|
|
return `<div class="truncate max-w-[15rem]" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">${data}</div>`;
|
|
}
|
|
},
|
|
{ data: 'ditetapkan' },
|
|
{ data: 'status' },
|
|
{ data: 'dokumen', orderable: false, searchable: false, },
|
|
{ data: 'aksi', orderable: false, searchable: false, },
|
|
]
|
|
});
|
|
|
|
// Delete button handler
|
|
$('#example').on('click', '.delete-btn', function (e) {
|
|
e.preventDefault();
|
|
|
|
var id = $(this).data('id');
|
|
|
|
Swal.fire({
|
|
title: 'Apakah anda yakin?',
|
|
text: "Data yang dihapus tidak dapat dikembalikan lagi",
|
|
icon: 'warning',
|
|
showCancelButton: true,
|
|
confirmButtonText: 'Ya, Hapus',
|
|
cancelButtonText: 'Batal',
|
|
buttonsStyling: false,
|
|
customClass: {
|
|
confirmButton: 'btn bg-red-500 text-white hover:bg-red-600 px-4 py-2 rounded-full mr-2',
|
|
cancelButton: 'btn bg-white text-gray-500 hover:bg-gray-50 px-4 py-2 rounded-full border border-gray-300',
|
|
},
|
|
}).then((result) => {
|
|
if (result.isConfirmed) {
|
|
// TODO: Implement actual delete API call
|
|
Swal.fire({
|
|
title: 'Terhapus!',
|
|
text: 'Data berhasil dihapus.',
|
|
icon: 'success',
|
|
confirmButtonText: 'OK',
|
|
buttonsStyling: false,
|
|
customClass: {
|
|
confirmButton: 'btn bg-green-800 text-white hover:bg-green-900 px-4 py-2 rounded-full',
|
|
},
|
|
}).then(() => {
|
|
// Reload table
|
|
table.ajax.reload();
|
|
});
|
|
}
|
|
});
|
|
});
|
|
|
|
tablePanduan = new DataTable('#examplePanduan', {
|
|
ajax: '/Main/Cms/TablePanduan',
|
|
scrollX: true,
|
|
autoWidth: false,
|
|
initComplete: function () {
|
|
$('div.dt-scroll-body thead').css('visibility', 'collapse');
|
|
},
|
|
columns: [
|
|
{ data: null, render: (d, t, r, m) => m.row + 1, orderable: false, searchable: false },
|
|
{ data: 'judul' },
|
|
{ data: 'jenis' },
|
|
{ data: 'dokumen', orderable: false, searchable: false, },
|
|
{ data: 'aksi', orderable: false, searchable: false, },
|
|
]
|
|
});
|
|
|
|
// Delete button handler
|
|
$('#examplePanduan').on('click', '.delete-btn', function (e) {
|
|
e.preventDefault();
|
|
|
|
var id = $(this).data('id');
|
|
|
|
Swal.fire({
|
|
title: 'Apakah anda yakin?',
|
|
text: "Data yang dihapus tidak dapat dikembalikan lagi",
|
|
icon: 'warning',
|
|
showCancelButton: true,
|
|
confirmButtonText: 'Ya, Hapus',
|
|
cancelButtonText: 'Batal',
|
|
buttonsStyling: false,
|
|
customClass: {
|
|
confirmButton: 'btn bg-red-500 text-white hover:bg-red-600 px-4 py-2 rounded-full mr-2',
|
|
cancelButton: 'btn bg-white text-gray-500 hover:bg-gray-50 px-4 py-2 rounded-full border border-gray-300',
|
|
},
|
|
}).then((result) => {
|
|
if (result.isConfirmed) {
|
|
// TODO: Implement actual delete API call
|
|
Swal.fire({
|
|
title: 'Terhapus!',
|
|
text: 'Data berhasil dihapus.',
|
|
icon: 'success',
|
|
confirmButtonText: 'OK',
|
|
buttonsStyling: false,
|
|
customClass: {
|
|
confirmButton: 'btn bg-green-800 text-white hover:bg-green-900 px-4 py-2 rounded-full',
|
|
},
|
|
}).then(() => {
|
|
// Reload table
|
|
table.ajax.reload();
|
|
});
|
|
}
|
|
});
|
|
});
|
|
});
|
|
|
|
function submitForm(e) {
|
|
e.preventDefault();
|
|
|
|
var isEditMode = $('#edit_mode').val() === 'true';
|
|
|
|
// TODO: Implement form submission logic
|
|
Swal.fire({
|
|
title: 'Berhasil!',
|
|
text: isEditMode ? 'Data berhasil diperbarui' : 'Data berhasil ditambahkan',
|
|
icon: 'success',
|
|
confirmButtonText: 'OK',
|
|
buttonsStyling: false,
|
|
customClass: {
|
|
confirmButton: 'btn bg-green-800 text-white hover:bg-green-900 px-4 py-2 rounded-full',
|
|
},
|
|
}).then(() => {
|
|
closeModal();
|
|
|
|
// Reload table
|
|
table.ajax.reload();
|
|
});
|
|
}
|
|
</script>
|
|
}
|
|
|