Files
dockergprompt/resources/views/auth/register.blade.php
T
2026-09-01 09:22:30 -03:00

139 lines
7.7 KiB
PHP
Executable File

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>Cadastro - GPrompt</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" rel="stylesheet">
<style>
body { font-family: 'Roboto', sans-serif; background-color: #f8f9fc; }
.register-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.register-card { border: none; box-shadow: 0 2px 15px rgba(0,0,0,0.1); border-radius: 10px; width: 100%; max-width: 400px; }
.register-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-radius: 10px 10px 0 0; padding: 2rem; text-align: center; }
.password-toggle { cursor: pointer; position: absolute; right: 10px; top: 38px; }
</style>
</head>
<body>
<div class="register-container d-flex flex-column">
<div class="register-card flex-grow-0">
<div class="register-header">
<i class="bi bi-cpu" style="font-size: 3rem;"></i>
<h2 class="mt-2">Criar Conta</h2>
<p>Junte-se ao GPrompt</p>
</div>
<div class="card-body p-4">
@if(session('error'))
<div class="alert alert-danger">{{ session('error') }}</div>
@endif
<form method="POST" action="{{ route('register') }}">
@csrf
<div class="mb-3">
<label for="name" class="form-label">Nome</label>
<input type="text" class="form-control" id="name" name="name" value="{{ old('name') }}" required autofocus autocomplete="name">
@error('name') <div class="text-danger small">{{ $message }}</div> @enderror
</div>
<div class="mb-3">
<label for="email" class="form-label">E-mail</label>
<input type="email" class="form-control" id="email" name="email" value="{{ old('email') }}" required autocomplete="email">
@error('email') <div class="text-danger small">{{ $message }}</div> @enderror
</div>
<div class="mb-3 position-relative">
<label for="password" class="form-label">Senha</label>
<input type="password" class="form-control" id="password" name="password" required autocomplete="new-password">
<i class="bi bi-eye-slash password-toggle" id="togglePassword"></i>
@error('password') <div class="text-danger small">{{ $message }}</div> @enderror
</div>
<div class="mb-3 position-relative">
<label for="password_confirmation" class="form-label">Confirmar Senha</label>
<input type="password" class="form-control" id="password_confirmation" name="password_confirmation" required autocomplete="new-password">
<i class="bi bi-eye-slash password-toggle" id="toggleConfirmPassword"></i>
@error('password_confirmation') <div class="text-danger small">{{ $message }}</div> @enderror
</div>
<div class="mb-3">
<label for="captcha" class="form-label">Captcha</label>
<div class="input-group">
<span class="input-group-text" id="captchaQuestion">Carregando...</span>
<input type="text" class="form-control" id="captcha" name="captcha" required maxlength="4">
<button type="button" class="btn btn-outline-secondary captcha-refresh" id="refreshCaptcha">
<i class="bi bi-arrow-clockwise"></i>
</button>
</div>
@error('captcha') <div class="text-danger small">{{ $message }}</div> @enderror
</div>
<div class="mb-3 form-check">
<input type="checkbox" class="form-check-input" id="terms_of_service" name="terms_of_service" required>
<label class="form-check-label" for="terms_of_service">
@lang('auth.accept_terms') <a href="{{ route('legal.document.show', 'terms-of-service') }}" target="_blank">@lang('legal_documents.terms_of_service')</a>
</label>
</div>
<div class="mb-3 form-check">
<input type="checkbox" class="form-check-input" id="privacy_policy" name="privacy_policy" required>
<label class="form-check-label" for="privacy_policy">
@lang('auth.accept_privacy') <a href="{{ route('legal.document.show', 'privacy-policy') }}" target="_blank">@lang('legal_documents.privacy_policy')</a>
</label>
</div>
<div class="mb-3 form-check">
<input type="checkbox" class="form-check-input" id="terms" name="terms" required>
<label class="form-check-label" for="terms">Conta sujeita a aprovação do SuperAdmin.</label>
</div>
<button type="submit" class="btn btn-primary w-100">Cadastrar</button>
</form>
<div class="mt-3 text-center">
<span>Já tem conta? <a href="{{ route('login') }}">Faça login</a></span>
</div>
</div>
</div>
@include('components.app-footer')
</div>
@include('components.cookie-consent-banner')
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script>
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', function() {
initRegister();
});
} else {
initRegister();
}
function initRegister() {
const toggles = document.querySelectorAll('.password-toggle');
toggles.forEach(toggle => {
toggle.addEventListener('click', function() {
const input = this.previousElementSibling;
const type = input.getAttribute('type') === 'password' ? 'text' : 'password';
input.setAttribute('type', type);
this.classList.toggle('bi-eye');
this.classList.toggle('bi-eye-slash');
});
});
function loadCaptcha() {
const question = document.getElementById('captchaQuestion');
fetch('{{ route('captcha.generate') }}')
.then(response => response.json())
.then(data => {
if (question) question.textContent = data.expression;
})
.catch(() => {
if (question) question.textContent = 'Erro ao carregar captcha.';
});
}
const refresh = document.getElementById('refreshCaptcha');
if (refresh) {
refresh.addEventListener('click', loadCaptcha);
}
loadCaptcha();
}
</script>
</body>
</html>