From 8ac56c7960d4daa6c1f8c4e1a0227d516f492caa Mon Sep 17 00:00:00 2001 From: Coassolo-Lucas Date: Sat, 4 Apr 2026 16:37:14 -0300 Subject: [PATCH] Deje de usar cdn y mejore el calendario --- .../Controllers/AppointmentController.php | 13 +++ resources/css/app.css | 5 +- resources/js/app.js | 30 +++-- resources/views/agenda.blade.php | 5 +- resources/views/appointments/show.blade.php | 107 ++++++++++++++++++ routes/web.php | 6 +- 6 files changed, 152 insertions(+), 14 deletions(-) create mode 100644 app/Http/Controllers/AppointmentController.php create mode 100644 resources/views/appointments/show.blade.php diff --git a/app/Http/Controllers/AppointmentController.php b/app/Http/Controllers/AppointmentController.php new file mode 100644 index 0000000..17baf46 --- /dev/null +++ b/app/Http/Controllers/AppointmentController.php @@ -0,0 +1,13 @@ + -
@@ -21,6 +20,9 @@ +
@@ -42,7 +44,6 @@ Ver turno diff --git a/resources/views/appointments/show.blade.php b/resources/views/appointments/show.blade.php new file mode 100644 index 0000000..f5574aa --- /dev/null +++ b/resources/views/appointments/show.blade.php @@ -0,0 +1,107 @@ + + + + + + +
+ + @php + $statusMap = [ + 'pending' => 'Pendiente', + 'confirmed' => 'Confirmado', + 'in_progress' => 'En progreso', + 'ready' => 'Listo', + 'delivered' => 'Entregado', + ]; + + $translatedStatus = $statusMap[$appointment->status] ?? 'Desconocido'; + + $colorMap = [ + 'pending' => '#ef4444', + 'in_progress' => '#f59e0b', + 'completed' => '#22c55e', + 'ready' => '#22c55e', + 'delivered' => '#22c55e', + ]; + + $color = $colorMap[$appointment->status] ?? '#3b82f6'; + + @endphp + + {{-- Estado --}} +
+ + Estado + + +
+ + {{ $translatedStatus }} + +
+
+ + {{-- Información principal --}} +
+ +
+

Cliente

+

+ {{ $appointment->client->name }} +

+
+ +
+

Teléfono

+

+ {{ $appointment->contact_phone ?? '-' }} +

+
+ +
+

Fecha pactada de entrega

+

+ {{ $appointment->scheduled_at->format('d/m/Y') }} +

+
+ +
+

Hora

+

+ {{ $appointment->scheduled_at->format('H:i') }} +

+
+ +
+

Modelo de Bicicleta

+

+ {{ $appointment->bike_model ?? '-' }} +

+
+ +
+

Problema Reportado

+

+ {{ $appointment->problem_description }} +

+
+ +
+

Notas

+

+ {{ $appointment->notes ?? '-' }} +

+
+ +
+ +
+ +
diff --git a/routes/web.php b/routes/web.php index 8d67948..4b5f9ae 100644 --- a/routes/web.php +++ b/routes/web.php @@ -11,6 +11,7 @@ use App\Http\Controllers\ProductosController; use App\Http\Controllers\RegisterController; use App\Http\Controllers\TallerController; use App\Http\Controllers\AgendaController; +use App\Http\Controllers\AppointmentController; use App\Models\Product; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; @@ -49,11 +50,14 @@ Route::middleware(['auth'])->group(function () { Route::post('/', 'store')->name('store'); Route::patch('/{appointment}/status', 'updateStatus')->name('updateStatus'); }); + Route::get('/agenda', [AgendaController::class, 'index'])->name('agenda'); + Route::get('/appointments/{appointment}', [AppointmentController::class, 'show']) + ->name('appointments.show'); }); Route::get('/productos/{id}/vistaUsuario', [ProductosController::class,'vistaUsuario'])->name('productos.vistaUsuario'); -Route::get('/agenda', [AgendaController::class, 'index'])->name('agenda'); +