setup viste
This commit is contained in:
@@ -5,6 +5,9 @@
|
||||
@php
|
||||
$canWriteDocumenti = Auth::user()->canManage('documenti');
|
||||
$canDeleteDocumenti = Auth::user()->canDelete('documenti');
|
||||
$vistaDefaultJson = isset($vista) ? $vista->toJson() : 'null';
|
||||
$visibleColumnsJson = json_encode($visibleColumns ?? []);
|
||||
$tableColumnsJson = json_encode($tableColumns ?? []);
|
||||
@endphp
|
||||
|
||||
@section('css')
|
||||
@@ -293,21 +296,21 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
|
||||
{{-- View: Lista --}}
|
||||
<div id="viewList" style="display:none;">
|
||||
@if($sottoCartelle->count() > 0 || $documenti->count() > 0)
|
||||
<table class="table table-bordered table-hover table-striped mb-0">
|
||||
<table class="table table-bordered table-hover table-striped mb-0" id="documenti-table">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
@if($canDeleteDocumenti)
|
||||
<th style="width: 40px;">
|
||||
<th style="width: 40px;" data-column="select">
|
||||
<input type="checkbox" id="selectAll" onchange="toggleAll(this)">
|
||||
</th>
|
||||
@endif
|
||||
<th>Nome</th>
|
||||
<th style="width: 100px;">Tipologia</th>
|
||||
<th style="width: 90px;">Dimensione</th>
|
||||
<th style="width: 120px;">Contesto</th>
|
||||
<th style="width: 100px;">Tag</th>
|
||||
<th style="width: 110px;">Data</th>
|
||||
<th style="width: 130px;">Azioni</th>
|
||||
<th data-column="nome">Nome</th>
|
||||
<th style="width: 100px;" data-column="tipologia">Tipologia</th>
|
||||
<th style="width: 90px;" data-column="dimensione">Dimensione</th>
|
||||
<th style="width: 120px;" data-column="visibilita">Contesto</th>
|
||||
<th style="width: 100px;" data-column="tag">Tag</th>
|
||||
<th style="width: 110px;" data-column="created_at">Data</th>
|
||||
<th style="width: 130px;" data-column="azioni">Azioni</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -515,6 +518,10 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
|
||||
</div>
|
||||
</form>{{-- /massForm --}}
|
||||
|
||||
@include('partials.table-settings')
|
||||
|
||||
<div id="vista-data" style="display:none;">{{ $vistaDefaultJson }}</div>
|
||||
|
||||
{{-- MODAL: Nuova Cartella --}}
|
||||
<div class="modal fade" id="newFolderModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
||||
@@ -938,6 +945,7 @@ $canDeleteDocumenti = Auth::user()->canDelete('documenti');
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script src="{{ asset('js/column-manager.js') }}"></script>
|
||||
<script>
|
||||
const individui = @json($individui->map(fn($i) => ['id' => $i->id, 'label' => $i->cognome . ' ' . $i->nome]));
|
||||
const gruppi = @json($gruppi->map(fn($g) => ['id' => $g->id, 'label' => $g->nome]));
|
||||
@@ -1941,5 +1949,24 @@ function deleteFolder(id, nome) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const table = document.getElementById('documenti-table');
|
||||
if (table) {
|
||||
window.columnManager = new ColumnManager('documenti-table', {
|
||||
entityType: 'documenti',
|
||||
storageKey: 'cm_documenti',
|
||||
resizable: true,
|
||||
reorderable: false,
|
||||
});
|
||||
initTableSettings();
|
||||
}
|
||||
});
|
||||
|
||||
window.printWithCurrentSettings = function () {
|
||||
if (window.columnManager) {
|
||||
window.columnManager.printWithSettings();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user