uiLogin #28

Merged
corentin.richard merged 2 commits from uiLogin into master 10 months ago

@ -2,6 +2,7 @@
framework: framework:
secret: '%env(APP_SECRET)%' secret: '%env(APP_SECRET)%'
#csrf_protection: true #csrf_protection: true
# error_controller: App\Controller\ErrorController::show
# Note that the session will be started ONLY if you read or write from it. # Note that the session will be started ONLY if you read or write from it.
session: true session: true

@ -1,6 +1,7 @@
twig: twig:
file_name_pattern: '*.twig' file_name_pattern: '*.twig'
form_themes: ['form_div_layout.html.twig'] form_themes: ['form_div_layout.html.twig']
when@test: when@test:
twig: twig:

@ -8,12 +8,22 @@
<link rel="stylesheet" href="{{ asset('styles/app.css')}}"> <link rel="stylesheet" href="{{ asset('styles/app.css')}}">
{% block stylesheets %} {% block stylesheets %}
<style>
.body-container {
display: flex;
justify-content: center;
align-items: center;
min-height: 80vh;
padding: 20px;
background-color: #f0f0f0;
}
</style>
{% endblock %} {% endblock %}
{% block javascripts %} {% block javascripts %}
{% endblock %} {% endblock %}
</head> </head>
<body> <body >
<header class="{{ nightmare|default('') }}"> <header class="{{ nightmare|default('') }}">
<nav> <nav>
<div class="nav-links"> <div class="nav-links">
@ -34,6 +44,8 @@
</div> </div>
</nav> </nav>
</header> </header>
{% block body %}{% endblock %} <div class="body-container">
{% block body %}{% endblock %}
</div>
<button class="floating-button" onclick="location.href='/post/new'">+</button> <button class="floating-button" onclick="location.href='/post/new'">+</button>
</html> </html>

@ -1,4 +1,9 @@
<!DOCTYPE html> {% extends 'base.html.twig' %}
{% block title %}Page non trouvée{% endblock %}
{% block body %}
<!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
@ -54,3 +59,5 @@
</div> </div>
</body> </body>
</html> </html>
{% endblock %}

@ -0,0 +1,64 @@
{% extends 'base.html.twig' %}
{% block title %}Page non trouvée{% endblock %}
{% block body %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Error</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #1a2c4c; /* Big Stone */
color: #bda3b6; /* Lily */
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.error-container {
text-align: center;
border: 1px solid #38476b; /* Rhino */
background-color: #5c5d7f; /* Comet */
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.error-container h1 {
font-size: 48px;
margin: 0;
color: #928ba2; /* Manatee */
}
.error-container p {
font-size: 18px;
margin: 10px 0 20px;
}
.error-container a {
text-decoration: none;
color: #1a2c4c; /* Big Stone */
font-weight: bold;
border: 1px solid #1a2c4c; /* Big Stone */
padding: 10px 20px;
border-radius: 5px;
background-color: #bda3b6; /* Lily */
}
.error-container a:hover {
background-color: #928ba2; /* Manatee */
}
</style>
</head>
<body>
<div class="error-container">
<h1>Page Not Found</h1>
<h2>Error 404 </h2>
<p>We're sorry, but something went wrong. Please try again later.</p>
{# <a href="{{ path('homepage') }}">Go to Homepage</a> #}
</div>
</body>
</html>
{% endblock %}

@ -3,21 +3,68 @@
{% block title %}Register{% endblock %} {% block title %}Register{% endblock %}
{% block stylesheets %} {% block stylesheets %}
<link rel="stylesheet" href="{{ asset('styles/app.css') }}"> <style>
.form-container {
background-color: #ffffff;
padding: 2rem;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 400px;
text-align: center;
}
.form-container h1 {
margin-bottom: 1.5rem;
}
.form-container .btn {
margin-top: 1rem;
width: 100%;
padding: 0.5rem;
border: none;
background-color: #007bff;
color: #ffffff;
border-radius: 4px;
cursor: pointer;
}
.form-container .btn:hover {
background-color: #0056b3;
}
.form-container a {
display: block;
margin-top: 1rem;
color: #007bff;
text-decoration: none;
}
.form-container a:hover {
text-decoration: underline;
}
</style>
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<h1>Register</h1> <div class="form-container" >
<h1>Register</h1>
{{ form_errors(registrationForm) }}
{{ form_errors(registrationForm) }} {{ form_start(registrationForm) }}
{{ form_row(registrationForm.name) }}
{{ form_row(registrationForm.plainPassword, {
label: 'Password'
}) }}
{{ form_row(registrationForm.agreeTerms) }}
{{ form_start(registrationForm) }} <button type="submit" class="btn">Register</button>
{{ form_row(registrationForm.name) }} {{ form_end(registrationForm) }}
{{ form_row(registrationForm.plainPassword, {
label: 'Password'
}) }}
{{ form_row(registrationForm.agreeTerms) }}
<button type="submit" class="btn">Register</button> <a href="/login"> or Login </a>
{{ form_end(registrationForm) }} </div>
{% endblock %} {% endblock %}

@ -3,46 +3,86 @@
{% block title %}Log in!{% endblock %} {% block title %}Log in!{% endblock %}
{% block stylesheets %} {% block stylesheets %}
<link rel="stylesheet" href="{{ asset ('styles/app.css')}}"> <link rel="stylesheet" href="{{ asset('styles/app.css') }}">
<style>
.form-container {
background-color: #ffffff;
padding: 2rem;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 400px;
text-align: center;
}
.form-container h1 {
margin-bottom: 1.5rem;
}
.form-container .btn {
margin-top: 1rem;
width: 100%;
padding: 0.5rem;
border: none;
background-color: #007bff;
color: #ffffff;
border-radius: 4px;
cursor: pointer;
}
.form-container .btn:hover {
background-color: #0056b3;
}
.form-container a {
display: block;
margin-top: 1rem;
color: #007bff;
text-decoration: none;
}
.form-container a:hover {
text-decoration: underline;
}
</style>
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<form method="post"> <div class="form-container">
{% if error %} <form method="post">
<div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div> {% if error %}
{% endif %} <div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}
{% if app.user %}
<div class="mb-3"> {% if app.user %}
You are logged in as {{ app.user.userIdentifier }}, <a href="{{ path('app_logout') }}">Logout</a> <div class="mb-3">
</div> You are logged in as {{ app.user.userIdentifier }}, <a href="{{ path('app_logout') }}">Logout</a>
{% endif %} </div>
{% endif %}
<h1 class="h3 mb-3 font-weight-normal">Please sign in</h1>
<label for="username">Name</label> <h1 class="h3 mb-3 font-weight-normal">Please sign in</h1>
<input type="text" value="{{ last_username }}" name="_username" id="username" class="form-control" autocomplete="username" required autofocus> <label for="username">Name</label>
<label for="password">Password</label> <input type="text" value="{{ last_username }}" name="_username" id="username" class="form-control" autocomplete="username" required autofocus>
<input type="password" name="_password" id="password" class="form-control" autocomplete="current-password" required> <label for="password">Password</label>
<input type="password" name="_password" id="password" class="form-control" autocomplete="current-password" required>
<input type="hidden" name="_csrf_token"
value="{{ csrf_token('authenticate') }}" <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
>
{#
{# Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
Uncomment this section and add a remember_me option below your firewall to activate remember me functionality. See https://symfony.com/doc/current/security/remember_me.html
See https://symfony.com/doc/current/security/remember_me.html
<div class="checkbox mb-3">
<div class="checkbox mb-3"> <label>
<label> <input type="checkbox" name="_remember_me"> Remember me
<input type="checkbox" name="_remember_me"> Remember me </label>
</label> </div>
</div> #}
#}
<button class="btn btn-lg btn-primary" type="submit">Sign in</button>
<button class="btn btn-lg btn-primary" type="submit"> </form>
Sign in
</button> <a href="/register">Or Register</a>
</form> </div>
<a href="/register">Or Register</a>
{% endblock %} {% endblock %}

Loading…
Cancel
Save