108 lines
4.9 KiB
Twig
Executable File
108 lines
4.9 KiB
Twig
Executable File
{% extends "layouts/base.twig" %}
|
|
|
|
{% block title %}{{ __('auth.resend_verification') }} - {% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="row justify-content-center">
|
|
<div class="col-lg-5">
|
|
<div class="card shadow-lg border-0 rounded-lg mt-5">
|
|
<div class="card-header">
|
|
<h3 class="text-center font-weight-light my-4">
|
|
{{ __('auth.resend_verification') }}
|
|
</h3>
|
|
</div>
|
|
<div class="card-body p-4">
|
|
{% if error %}
|
|
<div class="alert alert-danger" role="alert">
|
|
{{ error == 1 ? __('auth.email_not_found') : '' }}
|
|
{{ error == 'captcha' ? __('auth.invalid_captcha') : '' }}
|
|
{{ error == 'rate' ? __('auth.too_many_attempts') : '' }}
|
|
{{ error == 'verified' ? __('auth.email_already_verified') : '' }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if success %}
|
|
<div class="alert alert-success" role="alert">
|
|
{{ __('auth.verification_email_sent') }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<form method="POST" action="{{ url('verify-email/resend') }}">
|
|
{{ csrf_field() }}
|
|
|
|
<div class="form-floating mb-3">
|
|
<input type="email" class="form-control" id="email" name="email" placeholder="{{ __('auth.email_placeholder') }}" required value="{{ old('email') }}">
|
|
<label for="email">{{ __('auth.email') }}</label>
|
|
</div>
|
|
|
|
{% if require_captcha_resend %}
|
|
<div class="mb-3" x-data="{
|
|
num1: 0,
|
|
num2: 0,
|
|
userAnswer: '',
|
|
solved: false,
|
|
generate() {
|
|
this.num1 = Math.floor(Math.random() * 10) + 1;
|
|
this.num2 = Math.floor(Math.random() * 10) + 1;
|
|
this.userAnswer = '';
|
|
this.solved = false;
|
|
},
|
|
check() {
|
|
if (parseInt(this.userAnswer) === (this.num1 + this.num2)) {
|
|
this.solved = true;
|
|
} else {
|
|
this.solved = false;
|
|
}
|
|
}
|
|
}" x-init="generate()">
|
|
<div class="mb-3">
|
|
<label class="form-label fw-bold mb-2">{{ __('auth.security_check') }}</label>
|
|
<div class="d-flex align-items-center gap-2">
|
|
<div class="px-3 py-2 bg-white border rounded fw-bold fs-5 text-nowrap">
|
|
<span x-text="num1"></span> + <span x-text="num2"></span> =
|
|
</div>
|
|
<input type="number" class="form-control" style="width: 80px;" x-model="userAnswer" @input="check()" placeholder="?">
|
|
<button type="button" class="btn btn-outline-secondary btn-sm ms-1" @click="generate()" title="{{ __('auth.captcha_reload') }}">
|
|
<i class="bi bi-arrow-clockwise"></i> ↻
|
|
</button>
|
|
</div>
|
|
<div class="mt-2" style="min-height: 24px;">
|
|
<span x-show="solved" class="text-success fw-bold small">
|
|
✓ {{ __('auth.captcha_solved') }}
|
|
</span>
|
|
<span x-show="!solved" class="text-muted small">
|
|
{{ __('auth.captcha_instruction') }}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<input type="hidden" name="captcha_valid" :value="solved ? '1' : ''">
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="d-grid">
|
|
<button class="btn btn-primary" type="submit">
|
|
{{ __('auth.resend_verification') }}
|
|
</button>
|
|
<a href="{{ url('login') }}" class="btn btn-link">
|
|
{{ __('auth.back_to_login') }}
|
|
</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script>
|
|
// Auto-focus on email field
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const emailField = document.getElementById('email');
|
|
if (emailField) {
|
|
emailField.focus();
|
|
}
|
|
});
|
|
</script>
|
|
{% endblock %}
|