mejoras en la gestión de nombres y códigos de proyectos y documentos según la norma ISO 19650
This commit is contained in:
@@ -244,18 +244,41 @@
|
||||
</div>
|
||||
|
||||
<div class="overflow-x-auto">
|
||||
<table class="min-w-full divide-y divide-gray-200">
|
||||
<table id="listofdocuments" class="min-w-full divide-y divide-gray-200">
|
||||
<thead class="bg-gray-50 sticky top-0">
|
||||
<tr>
|
||||
<th class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase">Nombre - javi</th>
|
||||
<th class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase">Versiones</th>
|
||||
<th class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase">Última Actualización</th>
|
||||
<th class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase">Estado</th>
|
||||
<th class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="relative" x-data="{ open: false }">
|
||||
<flux:dropdown>
|
||||
<flux:button icon="ellipsis-horizontal" variant="subtle" size="sm"/>
|
||||
<flux:menu>
|
||||
<template x-for="(column, index) in $store.columns.all" :key="index">
|
||||
<li class="px-4 py-2">
|
||||
<label class="inline-flex items-center">
|
||||
<input type="checkbox" class="form-checkbox" :checked="$store.columns.visible.includes(column)" @change="$store.columns.toggle(column)">
|
||||
<span class="ml-2" x-text="column"></span>
|
||||
</label>
|
||||
</li>
|
||||
</template>
|
||||
</flux:menu>
|
||||
</flux:dropdown>
|
||||
</div>
|
||||
<span><flux:checkbox /></span>
|
||||
</div>
|
||||
</th>
|
||||
<th class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase">
|
||||
NOMBRE
|
||||
</th>
|
||||
<template x-for="column in $store.columns.all" :key="column">
|
||||
<th class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase" x-show="$store.columns.visible.includes(column)" x-text="column"></th>
|
||||
</template>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white divide-y divide-gray-200">
|
||||
@forelse($this->documents as $document)
|
||||
<tr class="hover:bg-gray-50">
|
||||
<td class="w-4"></td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<div class="flex items-center">
|
||||
<a href="{{ route('documents.show', $document) }}"
|
||||
@@ -263,38 +286,49 @@
|
||||
class="flex items-center hover:text-blue-600 transition-colors">
|
||||
@php
|
||||
$type = App\Helpers\FileHelper::getFileType($document->name);
|
||||
$iconComponent = $iconComponent = "icons." . $type;
|
||||
|
||||
$iconComponent = "icons." . $type;
|
||||
$iconClass = [
|
||||
'pdf' => 'pdf text-red-500',
|
||||
'word' => 'word text-blue-500',
|
||||
'excel' => 'excel text-green-500',
|
||||
// ... agregar todos los tipos
|
||||
][$type] ?? 'document text-gray-400';
|
||||
@endphp
|
||||
|
||||
<x-dynamic-component
|
||||
component="{{ $iconComponent }}"
|
||||
class="w-5 h-5 mr-2 {{ explode(' ', $iconClass)[1] }}"
|
||||
/>
|
||||
|
||||
{{ $document->name }}
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<td class="px-6 py-4 whitespace-nowrap" x-show="$store.columns.visible.includes('Versiones')">
|
||||
{{ $document->versions_count }}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<td class="px-6 py-4 whitespace-nowrap" x-show="$store.columns.visible.includes('Última Actualización')">
|
||||
{{ $document->updated_at->diffForHumans() }}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<td class="px-6 py-4 whitespace-nowrap" x-show="$store.columns.visible.includes('Estado')">
|
||||
<x-status-badge :status="$document->status" />
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap" x-show="$store.columns.visible.includes('Revisión')">
|
||||
{{ $document->revision }}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap" x-show="$store.columns.visible.includes('Disciplina')">
|
||||
{{ $document->discipline }}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap" x-show="$store.columns.visible.includes('Tipo de Documento')">
|
||||
{{ $document->document_type }}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap" x-show="$store.columns.visible.includes('Emisor')">
|
||||
{{ $document->issuer }}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap" x-show="$store.columns.visible.includes('Fecha de Entrada')">
|
||||
{{ $document->entry_date }}
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="4" class="px-6 py-4 text-center text-gray-500">
|
||||
<td colspan="9" class="px-6 py-4 text-center text-gray-500">
|
||||
No se encontraron documentos en esta carpeta
|
||||
</td>
|
||||
</tr>
|
||||
@@ -442,6 +476,22 @@
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('alpine:init', () => {
|
||||
Alpine.store('columns', {
|
||||
all: ['Versiones', 'Última Actualización', 'Estado', 'Revisión', 'Disciplina', 'Tipo de Documento', 'Emisor', 'Fecha de Entrada'],
|
||||
visible: ['Versiones', 'Última Actualización', 'Estado', 'Revisión', 'Disciplina', 'Tipo de Documento', 'Emisor', 'Fecha de Entrada'],
|
||||
toggle(column) {
|
||||
if (this.visible.includes(column)) {
|
||||
this.visible = this.visible.filter(c => c !== column);
|
||||
} else {
|
||||
this.visible.push(column);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
document.addEventListener('livewire:init', () => {
|
||||
Livewire.on('upload-progress', (name, progress) => {
|
||||
|
||||
Reference in New Issue
Block a user