87 lines
4.0 KiB
PHP
87 lines
4.0 KiB
PHP
<section>
|
|
<header>
|
|
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
|
{{ __('Informacje o profilu') }}
|
|
</h2>
|
|
|
|
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
{{ __('Zaktualizuj swoje dane osobowe, rolę oraz adres e-mail.') }}
|
|
</p>
|
|
</header>
|
|
|
|
<form id="send-verification" method="post" action="{{ route('verification.send') }}">
|
|
@csrf
|
|
</form>
|
|
|
|
<form method="post" action="{{ route('profile.update') }}" class="mt-6 space-y-6">
|
|
@csrf
|
|
@method('patch')
|
|
|
|
{{-- IMIĘ --}}
|
|
<div>
|
|
<x-input-label for="name" :value="__('Imię')" />
|
|
<x-text-input id="name" name="name" type="text" class="mt-1 block w-full" :value="old('name', $user->name)" required autofocus autocomplete="name" />
|
|
<x-input-error class="mt-2" :messages="$errors->get('name')" />
|
|
</div>
|
|
|
|
{{-- NAZWISKO --}}
|
|
<div>
|
|
<x-input-label for="surname" :value="__('Nazwisko')" />
|
|
<x-text-input id="surname" name="surname" type="text" class="mt-1 block w-full" :value="old('surname', $user->surname)" required autocomplete="family-name" />
|
|
<x-input-error class="mt-2" :messages="$errors->get('surname')" />
|
|
</div>
|
|
|
|
{{-- ROLA W SYSTEMIE --}}
|
|
<div>
|
|
<x-input-label for="role" :value="__('Rola w systemie')" />
|
|
<select id="role" name="role" class="mt-1 block w-full border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm">
|
|
@foreach(\App\Enums\UserRole::cases() as $role)
|
|
<option value="{{ $role->value }}" {{ old('role', $user->role->value ?? $user->role) === $role->value ? 'selected' : '' }}>
|
|
{{ ucfirst($role->value) }}
|
|
</option>
|
|
@endforeach
|
|
</select>
|
|
<x-input-error class="mt-2" :messages="$errors->get('role')" />
|
|
</div>
|
|
|
|
{{-- EMAIL --}}
|
|
<div>
|
|
<x-input-label for="email" :value="__('Email')" />
|
|
<x-text-input id="email" name="email" type="email" class="mt-1 block w-full" :value="old('email', $user->email)" required autocomplete="username" />
|
|
<x-input-error class="mt-2" :messages="$errors->get('email')" />
|
|
|
|
@if ($user instanceof \Illuminate\Contracts\Auth\MustVerifyEmail && ! $user->hasVerifiedEmail())
|
|
<div>
|
|
<p class="text-sm mt-2 text-gray-800 dark:text-gray-200">
|
|
{{ __('Twoj adres e-mail jest niezweryfikowany.') }}
|
|
|
|
<button form="send-verification" class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800">
|
|
{{ __('Kliknij tutaj, aby wysłać ponownie link weryfikacyjny.') }}
|
|
</button>
|
|
</p>
|
|
|
|
@if (session('status') === 'verification-link-sent')
|
|
<p class="mt-2 font-medium text-sm text-green-600 dark:text-green-400">
|
|
{{ __('Nowy link weryfikacyjny został wysłany.') }}
|
|
</p>
|
|
@endif
|
|
</div>
|
|
@endif
|
|
</div>
|
|
|
|
{{-- PRZYCISK ZAPISZ --}}
|
|
<div class="flex items-center gap-4">
|
|
<x-primary-button>{{ __('Zapisz') }}</x-primary-button>
|
|
|
|
@if (session('status') === 'profile-updated')
|
|
<p
|
|
x-data="{ show: true }"
|
|
x-show="show"
|
|
x-transition
|
|
x-init="setTimeout(() => show = false, 2000)"
|
|
class="text-sm text-gray-600 dark:text-gray-400"
|
|
>{{ __('Zapisano.') }}</p>
|
|
@endif
|
|
</div>
|
|
</form>
|
|
</section> |