[Operator] Perbaikan Laman Portal -> Mahasiswa

This commit is contained in:
Ariyutta
2026-11-11 08:46:29 +07:00
parent ef46b84da8
commit 52d49cdb41
15 changed files with 1153 additions and 390 deletions
@@ -4,7 +4,8 @@
(fetch JSON ke $url), sehingga alamat halaman tidak berubah. Halaman pertama ikut dirender sebagai data awal.
columns: [['key', 'label', 'num' => bool, 'badge' => bool]]; kolom badge memakai row.{key} dan nada row.tone.
filters: [['name', 'label', 'options' => [], 'value' => bawaan]] atau ['name', 'label', 'type' => 'check'].
Opsional: $viewUrl (aksi Lihat, "__ID__" diganti row.id), $destroyUrl + $destroy['title'|'message'] (Hapus sungguhan
Opsional: $tools (kunci tombol bilah yang boleh tampil, [] = tanpa tombol), $selectable (false = tanpa kotak centang),
$viewUrl (aksi Lihat, "__ID__" diganti row.id), $destroyUrl + $destroy['title'|'message'] (Hapus sungguhan
lewat POST {ids}); $form = ['title', 'storeUrl', 'updateUrl' ("__ID__"), 'fields' => [['name', 'label', 'type' =>
text|number|date|select, 'options', 'required', 'max', 'min', 'hint', 'multiple', 'default']]] untuk Tambah/Ubah lewat
modal (baris data menyediakan row.form = nilai isian). Hanya tombol yang sungguh bekerja yang ditampilkan; Lihat tanpa
@@ -14,15 +15,18 @@
$viewUrl ??= null;
$destroyUrl ??= null;
$form ??= null;
$selectable ??= true;
$destroy = ($destroy ?? []) + ['title' => 'Hapus data terpilih?', 'message' => 'Data yang dipilih akan dihapus.'];
$tools = [
$allTools = [
'T' => ['Tambah', 'plus', 'primary', 'startInsert()'],
'H' => ['Hapus', 'trash', 'danger', 'remove()'],
'C' => ['Cetak', 'printer', 'secondary', 'window.print()'],
];
$active = array_filter($tools, fn (string $key): bool => str_contains($page['flags'], $key)
// $tools (opsional): daftar kunci tombol yang boleh tampil (T, H, C); kosong = tanpa tombol. Bawaan: menurut flags katalog.
$allowed = isset($tools) ? array_flip($tools) : $allTools;
$active = array_filter($allTools, fn (string $key): bool => isset($allowed[$key]) && str_contains($page['flags'], $key)
&& match ($key) { 'T' => (bool) $form, 'H' => (bool) $destroyUrl, default => true }, ARRAY_FILTER_USE_KEY);
$checkbox = in_array('#', $page['columns'], true);
$checkbox = $selectable && in_array('#', $page['columns'], true);
$actions = in_array('Aksi', $page['columns'], true);
@endphp