Merge branch 'main' of https://homehud.duckdns.org/javier/Nexora
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled

This commit is contained in:
2025-05-07 00:21:14 +02:00
11 changed files with 378 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
<<<<<<< HEAD
<div x-data="{ isUploading: false }"
x-on:livewire-upload-start="isUploading = true"
x-on:livewire-upload-finish="isUploading = false"
@@ -54,4 +55,49 @@
<div class="alert alert-danger mt-2">{{ $message }}</div>
@enderror
</div>
=======
<div>
<!-- Preview de imagen -->
<div class="relative mb-4">
<img src="{{ $photo ? $photo->temporaryUrl() : ($currentImage ?? $placeholder) }}"
alt="Preview"
class="w-32 h-32 rounded-full object-cover border-2 border-gray-300">
@if($photo || $currentImage)
<button type="button"
wire:click="removePhoto"
class="absolute top-0 right-0 bg-red-500 text-white rounded-full p-1 hover:bg-red-600 transition"
title="Eliminar foto">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
@endif
</div>
<!-- Input de archivo -->
<label class="cursor-pointer bg-white px-4 py-2 rounded-md shadow-sm border border-gray-300 hover:bg-gray-50 inline-block">
<span class="text-sm font-medium text-gray-700">
{{ $photo || $currentImage ? 'Cambiar imagen' : 'Seleccionar imagen' }}
</span>
<input type="file"
wire:model="photo"
class="hidden"
accept="image/*"
name="{{ $fieldName }}_input"> <!-- Input oculto para Livewire -->
<!-- Input real para el formulario -->
@if($photo)
<input type="hidden" name="{{ $fieldName }}" value="{{ $photo->getFilename() }}">
@elseif($currentImage)
<input type="hidden" name="{{ $fieldName }}" value="current">
@endif
</label>
@error('photo')
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
@enderror
<p class="mt-1 text-xs text-gray-500">PNG, JPG o JPEG (Max. 2MB)</p>
>>>>>>> f97a7a84985ea300216ba3ea2ab4c31306e1659a
</div>

View File

@@ -0,0 +1,117 @@
<div>
<!-- Header y Breadcrumbs -->
<div class="p-4 bg-white border-b">
<div class="flex items-center justify-between">
<div>
<nav class="flex space-x-2 text-sm">
<a wire:click="currentFolder = null" class="cursor-pointer text-gray-600 hover:text-blue-600">
Inicio
</a>
@foreach($this->breadcrumbs as $folder)
<span class="text-gray-400">/</span>
<a wire:click="selectFolder({{ $folder->id }})"
class="cursor-pointer text-gray-600 hover:text-blue-600">
{{ $folder->name }}
</a>
@endforeach
</nav>
<h1 class="mt-2 text-2xl font-bold">{{ $project->name }}</h1>
</div>
<a href="{{ route('projects.edit', $project) }}"
class="px-4 py-2 text-white bg-blue-600 rounded-lg hover:bg-blue-700">
Editar Proyecto
</a>
</div>
</div>
<!-- Barra de Herramientas y Contenido -->
<div class="grid grid-cols-1 gap-6 p-4 lg:grid-cols-4">
<!-- Treeview de Carpetas -->
<div class="col-span-1 bg-white rounded-lg shadow">
<div class="p-4 border-b">
<div class="flex items-center justify-between">
<h3 class="font-medium">Carpetas</h3>
<button wire:click="createFolder" class="p-1 text-gray-600 hover:bg-gray-100 rounded">
<x-icons icon="plus" class="w-5 h-5" />
</button>
</div>
<input type="text"
wire:model.live="folderName"
placeholder="Nueva carpeta"
class="w-full p-2 mt-2 border rounded"
@keyup.enter="createFolder">
</div>
<div class="p-4">
<ul class="space-y-2">
@foreach($project->rootFolders as $folder)
<x-folder-item
:folder="$folder"
:currentFolder="$currentFolder"
:expandedFolders="$expandedFolders"
wire:key="folder-{{ $folder->id }}"
/>
@endforeach
</ul>
</div>
</div>
<!-- Documentos y Subida de Archivos -->
<div class="col-span-3">
<div class="bg-white rounded-lg shadow">
<div class="p-4 border-b">
<div class="flex items-center justify-between">
<h3 class="font-medium">Documentos</h3>
<input type="file"
wire:model="files"
multiple
class="hidden"
id="file-upload">
<label for="file-upload" class="px-4 py-2 text-sm text-white bg-green-600 rounded-lg cursor-pointer hover:bg-green-700">
Subir Archivos
</label>
</div>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase">Nombre</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>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
@forelse($this->documents as $document)
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<x-icons icon="document" class="w-5 h-5 mr-2 text-gray-400" />
{{ $document->name }}
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
{{ $document->versions_count }}
</td>
<td class="px-6 py-4 whitespace-nowrap">
{{ $document->updated_at->diffForHumans() }}
</td>
<td class="px-6 py-4 whitespace-nowrap">
<x-status-badge :status="$document->status" />
</td>
</tr>
@empty
<tr>
<td colspan="4" class="px-6 py-4 text-center text-gray-500">
No se encontraron documentos
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>

View File

@@ -75,7 +75,11 @@
<!-- Foto del usuario -->
@if($user->profile_photo_path)
<div class="mr-3 flex-shrink-0">
<<<<<<< HEAD
<img src="{{ asset('storage/' . $user->profile_photo_path) }}"
=======
<img src="{{ asset($user->profile_photo_path) }}"
>>>>>>> f97a7a84985ea300216ba3ea2ab4c31306e1659a
alt="{{ $user->full_name }}"
class="w-8 h-8 rounded-full object-cover transition-transform group-hover:scale-110">
</div>