updates to document handling and code editing features
This commit is contained in:
@@ -60,8 +60,8 @@
|
||||
|
||||
<!-- Status Badge -->
|
||||
<span class="px-4 py-2 w-30 rounded-lg text-sm text-center font-semibold
|
||||
{{ $project->is_active ? 'bg-green-600 text-white' : 'bg-red-100 text-red-800' }}">
|
||||
{{ $project->is_active ? 'Activo' : 'Inactivo' }}
|
||||
{{ $project->status == "Activo" ? 'bg-green-600 text-white' : 'bg-red-100 text-red-800' }}">
|
||||
{{ /*$project->is_active ? 'Activo' : 'Inactivo'*/ $project->status}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -73,7 +73,7 @@
|
||||
|
||||
|
||||
<!-- Contend: -->
|
||||
<div x-data="{ activeTab: 'info' }" class="bg-white rounded-lg shadow-md border-1">
|
||||
<div x-data="{ activeTab: 'documents' }" class="bg-white rounded-lg shadow-md border-1">
|
||||
<!-- Tab Headers -->
|
||||
<div class="border-b border-gray-200">
|
||||
<nav class="flex space-x-8 px-6">
|
||||
@@ -244,97 +244,11 @@
|
||||
</div>
|
||||
|
||||
<div class="overflow-x-auto">
|
||||
<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">
|
||||
<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) }}"
|
||||
target="_blank"
|
||||
class="flex items-center hover:text-blue-600 transition-colors">
|
||||
@php
|
||||
$type = App\Helpers\FileHelper::getFileType($document->name);
|
||||
$iconComponent = "icons." . $type;
|
||||
$iconClass = [
|
||||
'pdf' => 'pdf text-red-500',
|
||||
'word' => 'word text-blue-500',
|
||||
'excel' => 'excel text-green-500',
|
||||
][$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" x-show="$store.columns.visible.includes('Versiones')">
|
||||
{{ $document->versions_count }}
|
||||
</td>
|
||||
<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" 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="9" class="px-6 py-4 text-center text-gray-500">
|
||||
No se encontraron documentos en esta carpeta
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
<livewire:project-document-list
|
||||
:project-id="$project->id"
|
||||
:folder-id="$currentFolder?->id"
|
||||
wire:key="document-table-{{ $currentFolder?->id ?? 'root' }}-{{ now()->timestamp }}"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -435,7 +349,7 @@
|
||||
<div class="flex items-center truncate">
|
||||
<x-icons icon="document" class="w-4 h-4 mr-2 text-gray-400" />
|
||||
<span class="text-sm truncate">
|
||||
{{ $file->getClientOriginalName() }} <!-- Ahora funciona -->
|
||||
{{ $file->getClientOriginalName() }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user