107 lines
3.2 KiB
Twig
107 lines
3.2 KiB
Twig
{% extends 'Game/index.html.twig' %}
|
|
|
|
{% block title %} - Sign In{% endblock %}
|
|
|
|
{% block body %}
|
|
<div class="auth-page">
|
|
|
|
{% for message in app.flashes('success') %}
|
|
<div class="auth-flash auth-flash--success">
|
|
<i class="fa fa-check-circle"></i> {{ message }}
|
|
</div>
|
|
{% endfor %}
|
|
|
|
{% for message in app.flashes('error') %}
|
|
<div class="auth-flash auth-flash--error">
|
|
<i class="fa fa-exclamation-triangle"></i> {{ message }}
|
|
</div>
|
|
{% endfor %}
|
|
|
|
<div class="auth-card">
|
|
<h2 class="auth-title">Sign In</h2>
|
|
<p class="auth-sub">Welcome back, commander</p>
|
|
|
|
{% if error %}
|
|
<div class="auth-error">
|
|
<i class="fa fa-exclamation-triangle"></i>
|
|
{{ error.messageKey|trans(error.messageData, 'security') }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<form class="auth-form" method="post" action="{{ path('MineSeekerBundle_login') }}">
|
|
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}"/>
|
|
|
|
<div class="auth-field">
|
|
<label for="username" class="auth-label">Username</label>
|
|
<div class="auth-input-wrap">
|
|
<i class="fa fa-user auth-input-icon"></i>
|
|
<input
|
|
type="text"
|
|
id="username"
|
|
name="_username"
|
|
class="auth-input"
|
|
value="{{ last_username }}"
|
|
autocomplete="username"
|
|
autofocus
|
|
required
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="auth-field">
|
|
<label for="password" class="auth-label">Password</label>
|
|
<div class="auth-input-wrap">
|
|
<i class="fa fa-lock auth-input-icon"></i>
|
|
<input
|
|
type="password"
|
|
id="password"
|
|
name="_password"
|
|
class="auth-input"
|
|
autocomplete="current-password"
|
|
required
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
<label class="auth-remember">
|
|
<input type="checkbox" name="_remember_me"/>
|
|
<span>Remember me</span>
|
|
</label>
|
|
|
|
<input type="hidden" id="g-recaptcha-response" name="g-recaptcha-response"/>
|
|
|
|
<button type="submit" class="auth-submit">
|
|
<i class="fa fa-sign-in"></i> Sign In
|
|
</button>
|
|
</form>
|
|
|
|
<p class="auth-switch">
|
|
<a href="{{ path('MineSeekerBundle_forgot_password') }}">Forgot your password?</a>
|
|
</p>
|
|
|
|
<p class="auth-switch">
|
|
No account yet?
|
|
<a href="{{ path('MineSeekerBundle_register') }}">Create one</a>
|
|
</p>
|
|
</div>
|
|
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block javascripts %}
|
|
{{ parent() }}
|
|
<script src="https://www.google.com/recaptcha/api.js?render={{ recaptcha_site_key }}" async defer></script>
|
|
<script>
|
|
document.querySelector('.auth-form').addEventListener('submit', function (e) {
|
|
e.preventDefault();
|
|
const form = this;
|
|
grecaptcha.ready(function () {
|
|
grecaptcha.execute('{{ recaptcha_site_key }}', {action: 'login'}).then(function (token) {
|
|
document.getElementById('g-recaptcha-response').value = token;
|
|
form.submit();
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock %}
|