++ fix area profilo

This commit is contained in:
Francesco Picone
2026-07-25 23:35:03 +02:00
parent 95c9180f52
commit 34415862d2
3 changed files with 127 additions and 21 deletions

View File

@@ -7,9 +7,9 @@
<h1 class="text-2xl font-bold text-gray-900">Il mio profilo</h1>
</div>
<div class="max-w-2xl bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden">
<div class="max-w-2xl space-y-6">
{{-- Intestazione: avatar iniziale + nome --}}
<div class="p-6 flex items-center gap-4 border-b border-gray-100">
<div class="bg-white rounded-xl shadow-sm border border-gray-200 p-6 flex items-center gap-4">
<div class="h-16 w-16 flex-none rounded-full flex items-center justify-center text-white text-2xl font-bold shadow-sm"
style="background:linear-gradient(135deg,#4f46e5,#6366f1)">
{{ strtoupper(mb_substr($user->name, 0, 1)) }}
@@ -25,20 +25,70 @@
</div>
</div>
{{-- Dettagli --}}
<dl class="divide-y divide-gray-100">
<div class="px-6 py-4 grid grid-cols-1 sm:grid-cols-3 gap-1 sm:gap-4">
<dt class="text-sm font-medium text-gray-500">Nome</dt>
<dd class="text-sm text-gray-900 sm:col-span-2">{{ $user->name }}</dd>
</div>
<div class="px-6 py-4 grid grid-cols-1 sm:grid-cols-3 gap-1 sm:gap-4">
<dt class="text-sm font-medium text-gray-500">Email</dt>
<dd class="text-sm text-gray-900 sm:col-span-2 break-all">{{ $user->email }}</dd>
</div>
<div class="px-6 py-4 grid grid-cols-1 sm:grid-cols-3 gap-1 sm:gap-4">
<dt class="text-sm font-medium text-gray-500">Qualifica</dt>
<dd class="text-sm text-gray-900 sm:col-span-2">{{ ucfirst($user->roles->first()?->name ?? 'utente') }}</dd>
</div>
</dl>
{{-- Dati profilo --}}
<div class="bg-white rounded-xl shadow-sm border border-gray-200 p-6">
<h3 class="text-lg font-semibold text-gray-900 mb-1">Dati profilo</h3>
<p class="text-sm text-gray-500 mb-4">Aggiorna nome e cognome ed email.</p>
@if(session('profile_success'))
<div class="mb-4 rounded-lg bg-green-50 border border-green-200 px-4 py-2.5 text-sm text-green-800">
{{ session('profile_success') }}
</div>
@endif
<form wire:submit="updateProfile" class="space-y-4">
<div>
<label for="name" class="block text-sm font-medium text-gray-700">Nome e cognome</label>
<input wire:model="name" type="text" id="name" class="mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:ring-indigo-500 focus:border-indigo-500 text-sm">
@error('name') <p class="text-red-500 text-xs mt-1">{{ $message }}</p> @enderror
</div>
<div>
<label for="email" class="block text-sm font-medium text-gray-700">Email</label>
<input wire:model="email" type="email" id="email" class="mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:ring-indigo-500 focus:border-indigo-500 text-sm">
@error('email') <p class="text-red-500 text-xs mt-1">{{ $message }}</p> @enderror
</div>
<div class="flex justify-end">
<button type="submit" class="inline-flex items-center gap-1.5 px-4 py-2 text-sm font-medium text-white rounded-lg transition" style="background:#4f46e5" onmouseover="this.style.background='#4338ca'" onmouseout="this.style.background='#4f46e5'">
Salva modifiche
</button>
</div>
</form>
</div>
{{-- Cambio password --}}
<div class="bg-white rounded-xl shadow-sm border border-gray-200 p-6">
<h3 class="text-lg font-semibold text-gray-900 mb-1">Cambia password</h3>
<p class="text-sm text-gray-500 mb-4">Per motivi di sicurezza conferma la password attuale.</p>
@if(session('password_success'))
<div class="mb-4 rounded-lg bg-green-50 border border-green-200 px-4 py-2.5 text-sm text-green-800">
{{ session('password_success') }}
</div>
@endif
<form wire:submit="updatePassword" class="space-y-4">
<div>
<label for="current_password" class="block text-sm font-medium text-gray-700">Password attuale</label>
<input wire:model="current_password" type="password" id="current_password" autocomplete="current-password" class="mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:ring-indigo-500 focus:border-indigo-500 text-sm">
@error('current_password') <p class="text-red-500 text-xs mt-1">{{ $message }}</p> @enderror
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div>
<label for="password" class="block text-sm font-medium text-gray-700">Nuova password</label>
<input wire:model="password" type="password" id="password" autocomplete="new-password" class="mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:ring-indigo-500 focus:border-indigo-500 text-sm">
@error('password') <p class="text-red-500 text-xs mt-1">{{ $message }}</p> @enderror
</div>
<div>
<label for="password_confirmation" class="block text-sm font-medium text-gray-700">Conferma nuova password</label>
<input wire:model="password_confirmation" type="password" id="password_confirmation" autocomplete="new-password" class="mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:ring-indigo-500 focus:border-indigo-500 text-sm">
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="inline-flex items-center gap-1.5 px-4 py-2 text-sm font-medium text-white rounded-lg transition" style="background:#4f46e5" onmouseover="this.style.background='#4338ca'" onmouseout="this.style.background='#4f46e5'">
Aggiorna password
</button>
</div>
</form>
</div>
</div>
</div>