Aggiungi campi per immagini e diametro del foro nel modello Articolo e nelle relative migrazioni; aggiorna i form e le viste per gestire i nuovi campi
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
@use('Illuminate\Support\Facades\Storage')
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<div class="flex justify-between items-center">
|
||||
@@ -15,7 +16,7 @@
|
||||
</div>
|
||||
</x-slot>
|
||||
|
||||
<div class="py-12">
|
||||
<div class="py-12" x-data="{ modalImg: null }">
|
||||
<div class="max-w-6xl mx-auto sm:px-6 lg:px-8">
|
||||
@if (session('success'))
|
||||
<div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-4">
|
||||
@@ -39,6 +40,10 @@
|
||||
<dt class="text-sm font-medium text-gray-500">Ciclo</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $articolo->ciclo ?? '-' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Hole Diameter</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $articolo->hole_diameter ?? '-' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Diametro</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $articolo->diametro ?? '-' }}</dd>
|
||||
@@ -55,6 +60,16 @@
|
||||
<dt class="text-sm font-medium text-gray-500">Descrizione</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $articolo->descrizione ?? '-' }}</dd>
|
||||
</div>
|
||||
@if ($articolo->immagine_articolo)
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Immagine Articolo</dt>
|
||||
<dd class="mt-2">
|
||||
<img src="{{ Storage::url($articolo->immagine_articolo) }}" alt="Immagine Articolo"
|
||||
class="h-16 w-16 object-cover rounded border cursor-pointer hover:opacity-80 transition-opacity"
|
||||
@click="modalImg = '{{ Storage::url($articolo->immagine_articolo) }}'">
|
||||
</dd>
|
||||
</div>
|
||||
@endif
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
@@ -88,10 +103,30 @@
|
||||
<dt class="text-sm font-medium text-gray-500">Max Thrust (A)</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $articolo->max_thrust_a ?? '-' }}</dd>
|
||||
</div>
|
||||
@if ($articolo->immagine_thrust)
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Immagine Thrust</dt>
|
||||
<dd class="mt-2">
|
||||
<img src="{{ Storage::url($articolo->immagine_thrust) }}" alt="Immagine Thrust"
|
||||
class="h-16 w-16 object-cover rounded border cursor-pointer hover:opacity-80 transition-opacity"
|
||||
@click="modalImg = '{{ Storage::url($articolo->immagine_thrust) }}'">
|
||||
</dd>
|
||||
</div>
|
||||
@endif
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Min Torque (A)</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $articolo->min_torque_a ?? '-' }}</dd>
|
||||
</div>
|
||||
@if ($articolo->immagine_tourque)
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Immagine Tourque</dt>
|
||||
<dd class="mt-2">
|
||||
<img src="{{ Storage::url($articolo->immagine_tourque) }}" alt="Immagine Tourque"
|
||||
class="h-16 w-16 object-cover rounded border cursor-pointer hover:opacity-80 transition-opacity"
|
||||
@click="modalImg = '{{ Storage::url($articolo->immagine_tourque) }}'">
|
||||
</dd>
|
||||
</div>
|
||||
@endif
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Quantita Fori</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $articolo->quantita_fori ?? '-' }}</dd>
|
||||
@@ -146,5 +181,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Image Modal -->
|
||||
<div x-show="modalImg" x-cloak
|
||||
class="fixed inset-0 bg-black/80 flex items-center justify-center z-50 p-4"
|
||||
@click="modalImg = null"
|
||||
@keydown.escape.window="modalImg = null">
|
||||
<img :src="modalImg" @click.stop class="max-h-[90vh] max-w-full rounded-lg shadow-2xl">
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
|
||||
Reference in New Issue
Block a user