netgescon-day0/resources/views/auth/register.blade.php

104 lines
5.0 KiB
PHP
Executable File

<x-guest-layout>
@if(!($registrationEnabled ?? true))
<div class="mb-4 p-4 rounded-md bg-yellow-50 border border-yellow-200 text-yellow-800 text-sm">
La registrazione e temporaneamente disabilitata. Contatta il supporto per l'attivazione dell'account.
</div>
@endif
<form method="POST" action="{{ route('register') }}">
@csrf
<!-- Nome -->
<div>
<x-input-label for="name" :value="__('Nome')" />
<x-text-input id="name" class="block mt-1 w-full" type="text" name="name" :value="old('name')" required autofocus autocomplete="name" />
<x-input-error :messages="$errors->get('name')" class="mt-2" />
</div>
<!-- Email -->
<div class="mt-4">
<x-input-label for="email" :value="__('Email')" />
<x-text-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autocomplete="username" />
<x-input-error :messages="$errors->get('email')" class="mt-2" />
</div>
<!-- Password -->
<div class="mt-4">
<x-input-label for="password" :value="__('Password')" />
<x-text-input id="password" class="block mt-1 w-full"
type="password"
name="password"
required autocomplete="new-password" />
<x-input-error :messages="$errors->get('password')" class="mt-2" />
</div>
<!-- Conferma Password -->
<div class="mt-4">
<x-input-label for="password_confirmation" :value="__('Conferma password')" />
<x-text-input id="password_confirmation" class="block mt-1 w-full"
type="password"
name="password_confirmation" required autocomplete="new-password" />
<x-input-error :messages="$errors->get('password_confirmation')" class="mt-2" />
</div>
<!-- Ruolo -->
<div class="mt-4">
<x-input-label for="role" :value="__('Ruolo')" />
<select id="role" name="role" class="block mt-1 w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500">
<option value="amministratore" {{ old('role', 'amministratore') === 'amministratore' ? 'selected' : '' }}>Amministratore</option>
<option value="collaboratore" {{ old('role') === 'collaboratore' ? 'selected' : '' }}>Collaboratore</option>
<option value="condomino" {{ old('role') === 'condomino' ? 'selected' : '' }}>Condomino</option>
<option value="inquilino" {{ old('role') === 'inquilino' ? 'selected' : '' }}>Inquilino</option>
</select>
<p class="text-sm text-gray-500 mt-1">L'account resta in attesa di approvazione super-admin prima del primo accesso.</p>
</div>
@if(($recaptchaVersion ?? 'none') === 'v2' && !empty($recaptchaSiteKey))
<div class="mt-4">
<div class="g-recaptcha" data-sitekey="{{ $recaptchaSiteKey }}"></div>
<x-input-error :messages="$errors->get('g-recaptcha-response')" class="mt-2" />
</div>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
@endif
@if(($recaptchaVersion ?? 'none') === 'v3' && !empty($recaptchaSiteKey))
<input type="hidden" name="g-recaptcha-response" id="g-recaptcha-response">
<x-input-error :messages="$errors->get('g-recaptcha-response')" class="mt-2" />
<script src="https://www.google.com/recaptcha/api.js?render={{ $recaptchaSiteKey }}"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
if (typeof grecaptcha === 'undefined') {
return;
}
grecaptcha.ready(function () {
grecaptcha.execute('{{ $recaptchaSiteKey }}', {action: 'register'}).then(function (token) {
var field = document.getElementById('g-recaptcha-response');
if (field) {
field.value = token;
}
});
});
});
</script>
@endif
<div class="flex items-center justify-end mt-4">
<a 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" href="{{ route('login') }}">
{{ __('Hai già un account?') }}
</a>
<x-primary-button class="ms-4">
{{ __('Registrati') }}
</x-primary-button>
</div>
<p class="text-xs text-gray-500 mt-4">
Dopo la registrazione riceverai una email di verifica e l'accesso verra abilitato solo dopo approvazione.
</p>
</form>
</x-guest-layout>