First Commit
This commit is contained in:
Executable
+259
@@ -0,0 +1,259 @@
|
||||
{% extends "layouts/base.twig" %}
|
||||
|
||||
{% block title %}{{ __('auth.login_title', {'platformName': platformName}) }}{% endblock %}
|
||||
|
||||
{% block head %}
|
||||
<style>
|
||||
.login-container {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 20px 0;
|
||||
}
|
||||
.login-card {
|
||||
border: none;
|
||||
border-radius: 15px;
|
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
||||
overflow: hidden;
|
||||
max-width: 450px;
|
||||
width: 100%;
|
||||
}
|
||||
.login-header {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
padding: 30px 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.login-header h3 {
|
||||
margin: 0;
|
||||
font-weight: 600;
|
||||
}
|
||||
.login-body {
|
||||
padding: 40px 30px;
|
||||
background-color: #fff;
|
||||
}
|
||||
.form-floating {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.form-control {
|
||||
border-radius: 10px;
|
||||
border: 1px solid #e0e0e0;
|
||||
padding: 12px 15px;
|
||||
font-size: 16px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.form-control:focus {
|
||||
border-color: #667eea;
|
||||
box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
|
||||
}
|
||||
.btn-primary {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
padding: 12px;
|
||||
font-weight: 600;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.btn-primary:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
|
||||
}
|
||||
.btn-link {
|
||||
color: #667eea;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.btn-link:hover {
|
||||
color: #764ba2;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.form-check-input:checked {
|
||||
background-color: #667eea;
|
||||
border-color: #667eea;
|
||||
}
|
||||
.alert {
|
||||
border-radius: 10px;
|
||||
border: none;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.captcha-container {
|
||||
background-color: #f8f9fa;
|
||||
border-radius: 10px;
|
||||
padding: 15px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.captcha-image {
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
display: inline-block;
|
||||
}
|
||||
.password-toggle {
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
cursor: pointer;
|
||||
color: #6c757d;
|
||||
z-index: 10;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="login-container">
|
||||
<div class="row justify-content-center w-100">
|
||||
<div class="col-lg-5">
|
||||
<div class="card login-card">
|
||||
<div class="login-header">
|
||||
<h3>{{ __('auth.login_title', {'platformName': platformName}) }}</h3>
|
||||
</div>
|
||||
<div class="login-body">
|
||||
{% if password_reset_success %}
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ __('auth.password_reset_success') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if error %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
{{ error == 1 ? __('auth.invalid_credentials') : '' }}
|
||||
{{ error == 2 ? __('auth.account_inactive') : '' }}
|
||||
{{ error == 3 ? __('auth.registration_pending') : '' }}
|
||||
{{ error == 'captcha' ? __('auth.invalid_captcha') : '' }}
|
||||
{{ error == 'rate' ? __('auth.too_many_attempts') : '' }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if expired %}
|
||||
<div class="alert alert-warning" role="alert">
|
||||
{{ __('auth.session_expired') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="POST" action="{{ url('login') }}">
|
||||
{{ csrf_field() }}
|
||||
|
||||
<div class="form-floating mb-3">
|
||||
<input type="email" class="form-control" id="email" name="email" placeholder="{{ __('auth.email_placeholder') }}" value="{{ old('email') }}" required>
|
||||
<label for="email">{{ __('auth.email') }}</label>
|
||||
</div>
|
||||
|
||||
{% include 'components/password-field.twig' with {
|
||||
id: 'password',
|
||||
name: 'password',
|
||||
label: __('auth.password'),
|
||||
placeholder: __('auth.password_placeholder'),
|
||||
required: true
|
||||
} %}
|
||||
|
||||
{% if require_captcha_login %}
|
||||
<div class="captcha-container" 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="form-check mb-3">
|
||||
<input class="form-check-input" type="checkbox" id="remember" name="remember">
|
||||
<label class="form-check-label" for="remember">{{ __('auth.remember_me') }}</label>
|
||||
</div>
|
||||
|
||||
<div class="d-grid gap-3">
|
||||
<button class="btn btn-primary btn-lg" type="submit">
|
||||
{{ __('auth.login_button') }}
|
||||
</button>
|
||||
<a href="{{ url('forgot-password') }}" class="btn btn-link">
|
||||
{{ __('auth.forgot_password') }}
|
||||
</a>
|
||||
{% if allow_registration %}
|
||||
<a href="{{ url('register') }}" class="btn btn-link">
|
||||
{{ __('auth.register_button') }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="mt-3 d-grid">
|
||||
<a href="{{ url('verify-email/resend') }}" class="btn btn-outline-secondary btn-sm">
|
||||
{{ __('auth.resend_verification') }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{% if success %}
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ __('auth.logout_success') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if registered %}
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ __('auth.registration_success') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if verified %}
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ __('auth.email_verified_success') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if resend %}
|
||||
<div class="alert alert-info" role="alert">
|
||||
{{ __('auth.verification_email_sent') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</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 %}
|
||||
Reference in New Issue
Block a user