Update Kelompok Tani
This commit is contained in:
+56
-13
@@ -246,15 +246,6 @@ body > .select2-container--open {
|
||||
border-color: var(--bs-form-invalid-border-color);
|
||||
}
|
||||
|
||||
.kelompok-tani-page .kelompok-tani-summary-name {
|
||||
font-size: .9rem;
|
||||
}
|
||||
|
||||
.kelompok-tani-page .kelompok-tani-summary-note {
|
||||
font-size: .75rem;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.kelompok-tani-page .kelompok-tani-help {
|
||||
margin-top: -.75rem;
|
||||
}
|
||||
@@ -400,17 +391,20 @@ body > .select2-container--open {
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.bumdes-profile-summary .bumdes-summary-content {
|
||||
.bumdes-profile-summary .bumdes-summary-content,
|
||||
.kelompok-profile-summary .kelompok-summary-content {
|
||||
min-inline-size: 0;
|
||||
}
|
||||
|
||||
.bumdes-profile-summary .bumdes-summary-label {
|
||||
.bumdes-profile-summary .bumdes-summary-label,
|
||||
.kelompok-profile-summary .kelompok-summary-label {
|
||||
color: var(--bs-secondary-color);
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.bumdes-profile-summary .badge {
|
||||
.bumdes-profile-summary .badge,
|
||||
.kelompok-profile-summary .badge {
|
||||
max-inline-size: 100%;
|
||||
line-height: 1.45;
|
||||
white-space: normal;
|
||||
@@ -418,7 +412,56 @@ body > .select2-container--open {
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.bumdes-profile-summary .bumdes-summary-more {
|
||||
.bumdes-profile-summary .bumdes-summary-more,
|
||||
.kelompok-profile-summary .kelompok-summary-more {
|
||||
min-block-size: 1.5rem;
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
|
||||
/* Daftar kelompok tani. */
|
||||
@media (min-width: 768px) {
|
||||
.kelompok-tani-page .nav-pills-custom-spacing { display: flex; width: 100%; gap: .5rem; flex-wrap: nowrap !important; overflow-x: auto; }
|
||||
.kelompok-tani-page .nav-pills-custom-spacing::-webkit-scrollbar { display: none; }
|
||||
.kelompok-tani-page .nav-pills-custom-spacing .nav-item { margin-right: 0 !important; flex: 1; }
|
||||
.kelompok-tani-page .nav-pills-custom-spacing .nav-link { display: flex; justify-content: center; align-items: center; padding-left: .5rem !important; padding-right: .5rem !important; width: 100%; white-space: nowrap; font-size: var(--bs-body-font-size) !important; }
|
||||
.kelompok-tani-page .nav-pills-custom-spacing .nav-link i { margin-right: .4rem !important; }
|
||||
}
|
||||
.kelompok-tani-row { cursor: pointer; }
|
||||
.kelompok-filter-row { padding-block: 1.5rem; }
|
||||
.kelompok-filter-line { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
|
||||
.kelompok-filter-label { display: flex; align-items: center; font-weight: 500; margin-right: .5rem; white-space: nowrap; }
|
||||
.kelompok-filter-line .form-select,
|
||||
.kelompok-filter-line .btn { min-height: 31px; }
|
||||
.kelompok-filter-line .form-select {
|
||||
background-color: var(--bs-paper-bg);
|
||||
border-color: var(--bs-border-color);
|
||||
border-radius: var(--bs-border-radius);
|
||||
color: var(--bs-body-color);
|
||||
}
|
||||
.kelompok-filter-line .form-select:focus {
|
||||
border-color: rgba(40, 167, 69, .55);
|
||||
box-shadow: 0 0 0 .2rem rgba(40, 167, 69, .12);
|
||||
}
|
||||
.kelompok-filter-line .btn { white-space: nowrap; }
|
||||
.kelompok-filter-static {
|
||||
display: flex; align-items: center; min-height: 31px;
|
||||
padding: .25rem .75rem; font-size: .8125rem;
|
||||
background-color: var(--bs-paper-bg);
|
||||
border: 1px solid var(--bs-border-color);
|
||||
border-radius: var(--bs-border-radius);
|
||||
color: var(--bs-body-color);
|
||||
}
|
||||
.kelompok-filter-line .input-group-sm { width: 240px; }
|
||||
.kelompok-data-filters > div:not(.kelompok-filter-label) { flex: 1 1 12rem; min-inline-size: 0; }
|
||||
.kelompok-data-filters .form-select { text-overflow: ellipsis; }
|
||||
.kelompok-data-filters .input-group-sm { width: 100%; }
|
||||
.kelompok-list-table .kelompok-list-identity { min-inline-size: 15rem; max-inline-size: 21rem; }
|
||||
.kelompok-list-table .kelompok-list-commodities { min-inline-size: 10rem; max-inline-size: 15rem; }
|
||||
.kelompok-list-table .kelompok-list-status { min-inline-size: 10rem; max-inline-size: 15rem; }
|
||||
@media (max-width: 767.98px) {
|
||||
.kelompok-filter-line { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; }
|
||||
.kelompok-filter-label { margin-right: 0; }
|
||||
.kelompok-filter-line .btn { justify-content: center; width: 100%; }
|
||||
.kelompok-filter-line .input-group-sm { width: 100%; }
|
||||
.kelompok-filter-line .input-group .btn { width: auto; }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
'use strict';
|
||||
|
||||
$(function () {
|
||||
const filterForm = document.getElementById('kelompok-filter-form');
|
||||
if (!filterForm) return;
|
||||
|
||||
const headers = {
|
||||
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content,
|
||||
'Accept': 'application/json'
|
||||
};
|
||||
const $desa = $('#filter-desa');
|
||||
let desaRequest;
|
||||
|
||||
$('#filter-kecamatan').on('change', function () {
|
||||
if (desaRequest) desaRequest.abort();
|
||||
$desa.empty().append(new Option('Semua Desa', '')).prop('disabled', true);
|
||||
if (!this.value) return;
|
||||
|
||||
desaRequest = $.ajax({
|
||||
url: filterForm.dataset.desaUrl.replace(':id', this.value),
|
||||
method: 'GET',
|
||||
headers,
|
||||
success: function (data) {
|
||||
data.forEach(desa => $desa.append(new Option(desa.nama, desa.id)));
|
||||
$desa.prop('disabled', false);
|
||||
},
|
||||
error: function (xhr, status) {
|
||||
if (status !== 'abort') $desa.empty().append(new Option('Gagal memuat desa', ''));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#kelompok-per-page').on('change', function () { this.form.submit(); });
|
||||
|
||||
$(document).on('click', '.kelompok-tani-row', function (event) {
|
||||
if ($(event.target).closest('a, button, input, select, textarea, label').length) return;
|
||||
window.location.href = this.querySelector('.edit-record').href;
|
||||
});
|
||||
|
||||
$(document).on('click', '.kelompok-tani-page .delete-record', function () {
|
||||
const url = this.dataset.deleteUrl;
|
||||
const name = this.dataset.nama;
|
||||
Swal.fire({
|
||||
title: 'Hapus kelompok tani?',
|
||||
text: `Data kelompok tani "${name}" akan dihapus.`,
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Ya, hapus',
|
||||
cancelButtonText: 'Batal',
|
||||
customClass: { confirmButton: 'btn btn-danger me-3', cancelButton: 'btn btn-label-secondary' },
|
||||
buttonsStyling: false
|
||||
}).then(function (result) {
|
||||
if (!result.isConfirmed) return;
|
||||
$.ajax({
|
||||
url,
|
||||
method: 'DELETE',
|
||||
headers,
|
||||
success: function (response) {
|
||||
Swal.fire({ icon: 'success', title: 'Terhapus', text: response.message, showConfirmButton: false, timer: 1500 })
|
||||
.then(() => window.location.reload());
|
||||
},
|
||||
error: () => Swal.fire({ icon: 'error', title: 'Gagal menghapus', text: 'Data kelompok tani gagal dihapus. Silakan coba lagi.' })
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user