51 lines
2.4 KiB
Twig
51 lines
2.4 KiB
Twig
{# templates/login/login.html.twig #}
|
|
|
|
{% extends 'base.html.twig' %}
|
|
|
|
{% block title %}Connexion{% endblock %}
|
|
|
|
{% block body %}
|
|
<div class="min-h-screen flex items-center justify-center bg-gray-100">
|
|
<div class="max-w-lg w-full p-6 bg-white rounded-lg shadow-md">
|
|
<h2 class="text-2xl font-semibold text-center text-gray-700 mb-6">Connexion</h2>
|
|
|
|
<form action="{{ path('app_login') }}" method="post">
|
|
<div class="mb-4">
|
|
<label for="username" class="block text-sm font-medium text-gray-700">Email</label>
|
|
<div class="mt-1">
|
|
<input type="text" id="username" name="_username" value="{{ last_username }}" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required autofocus>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<label for="password" class="block text-sm font-medium text-gray-700">Mot de passe</label>
|
|
<div class="mt-1">
|
|
<input type="password" id="password" name="_password" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
|
|
</div>
|
|
</div>
|
|
|
|
{% if error %}
|
|
<div class="text-red-500 text-sm mt-2">
|
|
{{ error.messageKey|trans(error.messageData, 'security') }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="mt-6 text-center">
|
|
<button type="submit" class="w-full px-4 py-2 bg-indigo-600 text-white font-semibold rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
|
Se connecter
|
|
</button>
|
|
{% for type, messages in app.flashes %}
|
|
<div class="mb-4">
|
|
{% for message in messages %}
|
|
<div class="text-sm {% if type == 'success' %}text-green-600{% else %}text-red-600{% endif %}">
|
|
{{ message }}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|