This commit is contained in:
Serreau Jovann
2025-07-16 15:06:56 +02:00
parent 3012d59717
commit 849acc4b36
13 changed files with 137 additions and 23 deletions

View File

@@ -1 +1,2 @@
import './app.scss'
import * as Turbo from "@hotwired/turbo"

View File

@@ -1,4 +1,11 @@
# Documentation on how to configure the bundle can be found at: https://symfony.com/doc/current/bundles/LiipImagineBundle/basic-usage.html
liip_imagine:
# valid drivers options include "gd" or "gmagick" or "imagick"
# Use the gd or imagick driver. Imagick is often more powerful.
driver: "gd"
twig:
mode: lazy
filter_sets:
webp:
quality: 85
format: 'webp'
filters:
strip: true

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
public/favicon/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -0,0 +1,21 @@
{
"name": "Mainframe",
"short_name": "Mainframe",
"icons": [
{
"src": "/favicon/web-app-manifest-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/favicon/web-app-manifest-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -7,13 +7,17 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
class HomeController extends AbstractController
{
#[Route(path: '/',name: 'root',methods: 'GET')]
public function index(): Response
#[Route(path: '/',name: 'app_login',methods: 'GET')]
public function index(AuthenticationUtils $authenticationUtils): Response
{
return$this->json([]);
return$this->render('admin/login.twig',[
'last_username' => $authenticationUtils->getLastUsername(),
'error' => $authenticationUtils->getLastAuthenticationError(),
]);
}
}

View File

@@ -20,7 +20,7 @@ class SitemapSubscriber implements EventSubscriberInterface
{
$urlContainer = $sitemapPopulateEvent->getUrlContainer();
$urlGenerator = $sitemapPopulateEvent->getUrlGenerator();
$pathMenuItem = new UrlConcrete($urlGenerator->generate('root', [], UrlGeneratorInterface::ABSOLUTE_URL));
$pathMenuItem = new UrlConcrete($urlGenerator->generate('app_login', [], UrlGeneratorInterface::ABSOLUTE_URL));
$urlContainer->addUrl($pathMenuItem, 'main');
}
}

View File

@@ -0,0 +1,95 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mainframe - Connexion</title>
<meta name="robots" content="noindex, nofollow">
<link rel="icon" type="image/png" href="{{ asset('favicon/favicon-96x96.png') }}" sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="{{ asset('favicon/favicon.svg') }}" />
<link rel="shortcut icon" href="{{ asset('favicon/favicon.ico') }}" />
<link rel="apple-touch-icon" sizes="180x180" href="{{ asset('favicon/apple-touch-icon.png') }}" />
<meta name="apple-mobile-web-app-title" content="Mainframe" />
<link rel="manifest" href="{{ asset('favicon/site.webmanifest') }}" />
{{ vite_asset('app.js',[]) }}
</head>
{# Changement ici : fond noir, texte blanc #}
<body class="bg-gray-900 font-sans antialiased text-gray-100">
<div class="min-h-screen flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
{# Changement ici : fond du formulaire gris foncé, ombre plus subtile #}
<div class="max-w-md w-full space-y-8 p-10 bg-gray-800 rounded-xl shadow-xl z-10">
<div class="text-center">
<img class="mx-auto h-12 w-auto" src="{{ asset('assets/logo.png') | imagine_filter('webp') }}" alt="Logo Mainframe">
{# Changement ici : texte du titre blanc #}
<h2 class="mt-6 text-3xl font-extrabold text-white">
Connectez-vous à votre compte
</h2>
</div>
{% if error %}
{# Changement ici : couleurs de l'alerte pour le thème sombre #}
<div class="bg-red-900 border border-red-700 text-red-200 px-4 py-3 rounded relative" role="alert">
<strong class="font-bold">Erreur de connexion !</strong>
<span class="block sm:inline">{{ error.messageKey|trans(error.messageData, 'security') }}</span>
</div>
{% endif %}
<form data-turbo="false" class="mt-8 space-y-6" action="{{ path('app_login') }}" method="POST">
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
<div class="rounded-md shadow-sm -space-y-px">
<div>
<label for="username" class="sr-only">Adresse email</label>
{# Changement ici : champs de saisie pour le thème sombre #}
<input id="username" name="_username" type="email" autocomplete="email" required
class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-600 placeholder-gray-400 text-gray-100 bg-gray-700 rounded-t-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm"
placeholder="Adresse email" value="{{ last_username }}">
</div>
<div>
<label for="password" class="sr-only">Mot de passe</label>
{# Changement ici : champs de saisie pour le thème sombre #}
<input id="password" name="_password" type="password" autocomplete="current-password" required
class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-600 placeholder-gray-400 text-gray-100 bg-gray-700 rounded-b-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm"
placeholder="Mot de passe">
</div>
</div>
<div class="flex items-center justify-between">
<div class="flex items-center">
{# Changement ici : case à cocher pour le thème sombre #}
<input id="remember_me" name="_remember_me" type="checkbox"
class="h-4 w-4 text-indigo-500 focus:ring-indigo-500 border-gray-600 rounded bg-gray-700">
{# Changement ici : texte du label blanc #}
<label for="remember_me" class="ml-2 block text-sm text-gray-100">
Se souvenir de moi
</label>
</div>
<div class="text-sm">
{# Changement ici : couleur du lien plus claire #}
<a href="#" class="font-medium text-indigo-400 hover:text-indigo-300">
Mot de passe oublié ?
</a>
</div>
</div>
<div>
{# Le bouton reste indigo pour un bon contraste et une visibilité #}
<button type="submit"
class="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
<span class="absolute left-0 inset-y-0 flex items-center pl-3">
<svg class="h-5 w-5 text-indigo-500 group-hover:text-indigo-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z" clip-rule="evenodd" />
</svg>
</span>
Se connecter
</button>
</div>
</form>
</div>
</div>
</body>
</html>

View File

@@ -1,17 +0,0 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>{% block title %}Welcome!{% endblock %}</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
{% block stylesheets %}
{% endblock %}
{% block javascripts %}
{% block importmap %}{{ importmap('app') }}{% endblock %}
{% endblock %}
</head>
<body>
{% block body %}{% endblock %}
</body>
</html>