[Superuser] Perbaikan Halaman Akses Superuser
This commit is contained in:
@@ -26,6 +26,11 @@
|
||||
$editable ??= true;
|
||||
$ownRowsOnly ??= false;
|
||||
$viewable ??= true;
|
||||
// $barLinks (opsional): tautan tambahan di kanan bilah cari, [['label', 'href', 'icon']].
|
||||
$barLinks ??= [];
|
||||
// $detailColumns (opsional): kolom modal Lihat bila berbeda dari kolom tabel; kolom ber-'detail' => 'kunci' menampilkan
|
||||
// row.{kunci} (larik teks) sebagai daftar bernomor selebar modal, mis. anggota grup mata kuliah.
|
||||
$detailColumns ??= $columns;
|
||||
$destroy = ($destroy ?? []) + ['title' => 'Hapus data terpilih?', 'message' => 'Data yang dipilih akan dihapus.'];
|
||||
$allTools = [
|
||||
'T' => ['Tambah', 'plus', 'primary', 'startInsert()'],
|
||||
@@ -99,6 +104,9 @@
|
||||
</div>
|
||||
|
||||
<div class="satu-bar__tools">
|
||||
@foreach ($barLinks as $link)
|
||||
<x-ui.button variant="secondary" :icon="$link['icon'] ?? null" size="sm" :href="$link['href']">{{ $link['label'] }}</x-ui.button>
|
||||
@endforeach
|
||||
@foreach ($active as [$label, $icon, $variant, $click])
|
||||
<x-ui.button :variant="$variant" :icon="$icon" size="sm" x-on:click="{{ $click }}">{{ $label }}</x-ui.button>
|
||||
@endforeach
|
||||
@@ -202,12 +210,27 @@
|
||||
<x-ui.dialog-close />
|
||||
</div>
|
||||
<dl class="satu-form satu-detail">
|
||||
<template x-for="col in columns" x-bind:key="col.key">
|
||||
<div>
|
||||
<dt x-text="col.label"></dt>
|
||||
<dd x-text="viewing && viewing[col.key] !== null && viewing[col.key] !== '' && viewing[col.key] !== undefined ? viewing[col.key] : '-'"></dd>
|
||||
</div>
|
||||
</template>
|
||||
@foreach ($detailColumns as $column)
|
||||
@if ($column['detail'] ?? false)
|
||||
{{-- Rincian berupa daftar (row.{detail} = larik teks): selebar modal, satu butir per baris --}}
|
||||
<div class="satu-detail__wide">
|
||||
<dt>{{ $column['label'] }} <span x-text="viewing && Array.isArray(viewing.{{ $column['detail'] }}) && viewing.{{ $column['detail'] }}.length ? '(' + viewing.{{ $column['detail'] }}.length + ')' : ''"></span></dt>
|
||||
<dd>
|
||||
<ol class="satu-detail__list" x-show="viewing && Array.isArray(viewing.{{ $column['detail'] }}) && viewing.{{ $column['detail'] }}.length">
|
||||
<template x-for="(item, i) in (viewing && Array.isArray(viewing.{{ $column['detail'] }}) ? viewing.{{ $column['detail'] }} : [])" x-bind:key="i">
|
||||
<li x-text="item"></li>
|
||||
</template>
|
||||
</ol>
|
||||
<span x-show="!viewing || !Array.isArray(viewing.{{ $column['detail'] }}) || !viewing.{{ $column['detail'] }}.length">-</span>
|
||||
</dd>
|
||||
</div>
|
||||
@else
|
||||
<div>
|
||||
<dt>{{ $column['label'] }}</dt>
|
||||
<dd x-text="viewing && viewing.{{ $column['key'] }} !== null && viewing.{{ $column['key'] }} !== '' && viewing.{{ $column['key'] }} !== undefined ? viewing.{{ $column['key'] }} : '-'"></dd>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
</dl>
|
||||
<div class="dialog__actions">
|
||||
<x-ui.button variant="secondary" x-on:click="$refs.detail.close()">Tutup</x-ui.button>
|
||||
|
||||
Reference in New Issue
Block a user