From ba84b491345d9e5fa2066bea236370aaeedd14df Mon Sep 17 00:00:00 2001 From: maurine Date: Mon, 23 Mar 2026 18:43:32 +0100 Subject: [PATCH] feat: mise en page de la page login et page accueil --- src/Controller/.gitignore => [all | 0 assets/styles/app.css | 36 +- config/packages/security.yaml | 10 +- public/css/app.css | 631 ------------------ public/img/logo.svg | 66 ++ src/Controller/HomeController.php | 2 +- src/Controller/UserController.php | 30 +- src/DataFixtures/AppFixtures.php | 4 +- src/Security/AppCustomAuthenticator.php | 60 -- tailwind.config.js | 23 - templates/_navbar.html.twig | 65 ++ templates/base.html.twig | 56 +- .../TwigBundles/Exception/error500.html.twig | 1 - templates/home/home.html.twig | 152 +++-- templates/security/login.html.twig | 114 +++- templates/user/edit_password.html.twig | 7 +- .../Exception/error404.html.twig => true], | 0 17 files changed, 421 insertions(+), 836 deletions(-) rename src/Controller/.gitignore => [all (100%) delete mode 100644 public/css/app.css create mode 100644 public/img/logo.svg delete mode 100644 src/Security/AppCustomAuthenticator.php delete mode 100644 tailwind.config.js create mode 100644 templates/_navbar.html.twig delete mode 100644 templates/bundles/TwigBundles/Exception/error500.html.twig rename templates/bundles/TwigBundles/Exception/error404.html.twig => true], (100%) diff --git a/src/Controller/.gitignore b/[all similarity index 100% rename from src/Controller/.gitignore rename to [all diff --git a/assets/styles/app.css b/assets/styles/app.css index 0434219..e6b1010 100644 --- a/assets/styles/app.css +++ b/assets/styles/app.css @@ -1,5 +1,35 @@ @import "tailwindcss"; -body { - background-color: bg-slate-100; -} \ No newline at end of file +/* Chargement des polices d'écriture */ +@import url('https://fonts.googleapis.com/css2?family=Sora:wght@100..800&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Sora:wght@100..800&display=swap'); + +/* Configuration charte graphique */ +@theme { + /* --- Couleurs de l'association --- */ + --color-bouton: #4DD5C8; + --color-bouton-hover: #6CE0D6; + --color-title: #E6A638; + --color-text: #000000; + --color-bg-primaire: #F9FCF7; + --color-bg-secondaire: #23978B; + + /* --- Couleurs liées à des actions --- */ + --color-danger: #EF4444; + --color-danger-hover: #DC2626; + + --color-success: #A7F3D0; + --color-success-text: #065F46; + + --color-info: #BFDBFE; + --color-info-hover: #93C5FD; + + /* --- Couleurs en plus --- */ + --color-gris-clair: #E5E7EB; + --color-gris-moyen: #9CA3AF; + --color-gris-fonce: #4B5563; + + /* Polices */ + --font-sora: "Sora", system-ui, sans-serif; + --font-caveat: "Caveat", cursive; +} diff --git a/config/packages/security.yaml b/config/packages/security.yaml index 98c92f1..12a4e8d 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -1,6 +1,12 @@ security: + # Hierarchie des rôles # + role_hierarchy: + ROLE_ORGANISATION: ROLE_USER + ROLE_ADMIN_ORGANISATION: ROLE_ORGANISATION + ROLE_ADMIN: ROLE_USER + # https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords - # comment sont hachés nos mots de passe + # Comment sont hachés nos mots de passe password_hashers: Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto' @@ -33,6 +39,7 @@ security: enable_csrf: true username_parameter: _username password_parameter: _password + default_target_path: app_home logout: path: app_logout # où rediriger après la déconnexion @@ -56,6 +63,7 @@ security: # autorisations access_control: - { path: ^/admin, roles: ROLE_ADMIN } + - { path: ^/organisation, roles: ROLE_ADMIN_ORGANISATION } - { path: ^/user, roles: ROLE_USER } when@test: diff --git a/public/css/app.css b/public/css/app.css deleted file mode 100644 index e1e0489..0000000 --- a/public/css/app.css +++ /dev/null @@ -1,631 +0,0 @@ -*, ::before, ::after { - --tw-border-spacing-x: 0; - --tw-border-spacing-y: 0; - --tw-translate-x: 0; - --tw-translate-y: 0; - --tw-rotate: 0; - --tw-skew-x: 0; - --tw-skew-y: 0; - --tw-scale-x: 1; - --tw-scale-y: 1; - --tw-pan-x: ; - --tw-pan-y: ; - --tw-pinch-zoom: ; - --tw-scroll-snap-strictness: proximity; - --tw-gradient-from-position: ; - --tw-gradient-via-position: ; - --tw-gradient-to-position: ; - --tw-ordinal: ; - --tw-slashed-zero: ; - --tw-numeric-figure: ; - --tw-numeric-spacing: ; - --tw-numeric-fraction: ; - --tw-ring-inset: ; - --tw-ring-offset-width: 0px; - --tw-ring-offset-color: #fff; - --tw-ring-color: rgb(59 130 246 / 0.5); - --tw-ring-offset-shadow: 0 0 #0000; - --tw-ring-shadow: 0 0 #0000; - --tw-shadow: 0 0 #0000; - --tw-shadow-colored: 0 0 #0000; - --tw-blur: ; - --tw-brightness: ; - --tw-contrast: ; - --tw-grayscale: ; - --tw-hue-rotate: ; - --tw-invert: ; - --tw-saturate: ; - --tw-sepia: ; - --tw-drop-shadow: ; - --tw-backdrop-blur: ; - --tw-backdrop-brightness: ; - --tw-backdrop-contrast: ; - --tw-backdrop-grayscale: ; - --tw-backdrop-hue-rotate: ; - --tw-backdrop-invert: ; - --tw-backdrop-opacity: ; - --tw-backdrop-saturate: ; - --tw-backdrop-sepia: ; - --tw-contain-size: ; - --tw-contain-layout: ; - --tw-contain-paint: ; - --tw-contain-style: ; -} - -::backdrop { - --tw-border-spacing-x: 0; - --tw-border-spacing-y: 0; - --tw-translate-x: 0; - --tw-translate-y: 0; - --tw-rotate: 0; - --tw-skew-x: 0; - --tw-skew-y: 0; - --tw-scale-x: 1; - --tw-scale-y: 1; - --tw-pan-x: ; - --tw-pan-y: ; - --tw-pinch-zoom: ; - --tw-scroll-snap-strictness: proximity; - --tw-gradient-from-position: ; - --tw-gradient-via-position: ; - --tw-gradient-to-position: ; - --tw-ordinal: ; - --tw-slashed-zero: ; - --tw-numeric-figure: ; - --tw-numeric-spacing: ; - --tw-numeric-fraction: ; - --tw-ring-inset: ; - --tw-ring-offset-width: 0px; - --tw-ring-offset-color: #fff; - --tw-ring-color: rgb(59 130 246 / 0.5); - --tw-ring-offset-shadow: 0 0 #0000; - --tw-ring-shadow: 0 0 #0000; - --tw-shadow: 0 0 #0000; - --tw-shadow-colored: 0 0 #0000; - --tw-blur: ; - --tw-brightness: ; - --tw-contrast: ; - --tw-grayscale: ; - --tw-hue-rotate: ; - --tw-invert: ; - --tw-saturate: ; - --tw-sepia: ; - --tw-drop-shadow: ; - --tw-backdrop-blur: ; - --tw-backdrop-brightness: ; - --tw-backdrop-contrast: ; - --tw-backdrop-grayscale: ; - --tw-backdrop-hue-rotate: ; - --tw-backdrop-invert: ; - --tw-backdrop-opacity: ; - --tw-backdrop-saturate: ; - --tw-backdrop-sepia: ; - --tw-contain-size: ; - --tw-contain-layout: ; - --tw-contain-paint: ; - --tw-contain-style: ; -} - -/* -! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com -*/ - -/* -1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) -2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) -*/ - -*, -::before, -::after { - box-sizing: border-box; - /* 1 */ - border-width: 0; - /* 2 */ - border-style: solid; - /* 2 */ - border-color: #e5e7eb; - /* 2 */ -} - -::before, -::after { - --tw-content: ''; -} - -/* -1. Use a consistent sensible line-height in all browsers. -2. Prevent adjustments of font size after orientation changes in iOS. -3. Use a more readable tab size. -4. Use the user's configured `sans` font-family by default. -5. Use the user's configured `sans` font-feature-settings by default. -6. Use the user's configured `sans` font-variation-settings by default. -7. Disable tap highlights on iOS -*/ - -html, -:host { - line-height: 1.5; - /* 1 */ - -webkit-text-size-adjust: 100%; - /* 2 */ - -moz-tab-size: 4; - /* 3 */ - -o-tab-size: 4; - tab-size: 4; - /* 3 */ - font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; - /* 4 */ - font-feature-settings: normal; - /* 5 */ - font-variation-settings: normal; - /* 6 */ - -webkit-tap-highlight-color: transparent; - /* 7 */ -} - -/* -1. Remove the margin in all browsers. -2. Inherit line-height from `html` so users can set them as a class directly on the `html` element. -*/ - -body { - margin: 0; - /* 1 */ - line-height: inherit; - /* 2 */ -} - -/* -1. Add the correct height in Firefox. -2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) -3. Ensure horizontal rules are visible by default. -*/ - -hr { - height: 0; - /* 1 */ - color: inherit; - /* 2 */ - border-top-width: 1px; - /* 3 */ -} - -/* -Add the correct text decoration in Chrome, Edge, and Safari. -*/ - -abbr:where([title]) { - -webkit-text-decoration: underline dotted; - text-decoration: underline dotted; -} - -/* -Remove the default font size and weight for headings. -*/ - -h1, -h2, -h3, -h4, -h5, -h6 { - font-size: inherit; - font-weight: inherit; -} - -/* -Reset links to optimize for opt-in styling instead of opt-out. -*/ - -a { - color: inherit; - text-decoration: inherit; -} - -/* -Add the correct font weight in Edge and Safari. -*/ - -b, -strong { - font-weight: bolder; -} - -/* -1. Use the user's configured `mono` font-family by default. -2. Use the user's configured `mono` font-feature-settings by default. -3. Use the user's configured `mono` font-variation-settings by default. -4. Correct the odd `em` font sizing in all browsers. -*/ - -code, -kbd, -samp, -pre { - font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; - /* 1 */ - font-feature-settings: normal; - /* 2 */ - font-variation-settings: normal; - /* 3 */ - font-size: 1em; - /* 4 */ -} - -/* -Add the correct font size in all browsers. -*/ - -small { - font-size: 80%; -} - -/* -Prevent `sub` and `sup` elements from affecting the line height in all browsers. -*/ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sub { - bottom: -0.25em; -} - -sup { - top: -0.5em; -} - -/* -1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) -2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) -3. Remove gaps between table borders by default. -*/ - -table { - text-indent: 0; - /* 1 */ - border-color: inherit; - /* 2 */ - border-collapse: collapse; - /* 3 */ -} - -/* -1. Change the font styles in all browsers. -2. Remove the margin in Firefox and Safari. -3. Remove default padding in all browsers. -*/ - -button, -input, -optgroup, -select, -textarea { - font-family: inherit; - /* 1 */ - font-feature-settings: inherit; - /* 1 */ - font-variation-settings: inherit; - /* 1 */ - font-size: 100%; - /* 1 */ - font-weight: inherit; - /* 1 */ - line-height: inherit; - /* 1 */ - letter-spacing: inherit; - /* 1 */ - color: inherit; - /* 1 */ - margin: 0; - /* 2 */ - padding: 0; - /* 3 */ -} - -/* -Remove the inheritance of text transform in Edge and Firefox. -*/ - -button, -select { - text-transform: none; -} - -/* -1. Correct the inability to style clickable types in iOS and Safari. -2. Remove default button styles. -*/ - -button, -input:where([type='button']), -input:where([type='reset']), -input:where([type='submit']) { - -webkit-appearance: button; - /* 1 */ - background-color: transparent; - /* 2 */ - background-image: none; - /* 2 */ -} - -/* -Use the modern Firefox focus style for all focusable elements. -*/ - -:-moz-focusring { - outline: auto; -} - -/* -Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737) -*/ - -:-moz-ui-invalid { - box-shadow: none; -} - -/* -Add the correct vertical alignment in Chrome and Firefox. -*/ - -progress { - vertical-align: baseline; -} - -/* -Correct the cursor style of increment and decrement buttons in Safari. -*/ - -::-webkit-inner-spin-button, -::-webkit-outer-spin-button { - height: auto; -} - -/* -1. Correct the odd appearance in Chrome and Safari. -2. Correct the outline style in Safari. -*/ - -[type='search'] { - -webkit-appearance: textfield; - /* 1 */ - outline-offset: -2px; - /* 2 */ -} - -/* -Remove the inner padding in Chrome and Safari on macOS. -*/ - -::-webkit-search-decoration { - -webkit-appearance: none; -} - -/* -1. Correct the inability to style clickable types in iOS and Safari. -2. Change font properties to `inherit` in Safari. -*/ - -::-webkit-file-upload-button { - -webkit-appearance: button; - /* 1 */ - font: inherit; - /* 2 */ -} - -/* -Add the correct display in Chrome and Safari. -*/ - -summary { - display: list-item; -} - -/* -Removes the default spacing and border for appropriate elements. -*/ - -blockquote, -dl, -dd, -h1, -h2, -h3, -h4, -h5, -h6, -hr, -figure, -p, -pre { - margin: 0; -} - -fieldset { - margin: 0; - padding: 0; -} - -legend { - padding: 0; -} - -ol, -ul, -menu { - list-style: none; - margin: 0; - padding: 0; -} - -/* -Reset default styling for dialogs. -*/ - -dialog { - padding: 0; -} - -/* -Prevent resizing textareas horizontally by default. -*/ - -textarea { - resize: vertical; -} - -/* -1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300) -2. Set the default placeholder color to the user's configured gray 400 color. -*/ - -input::-moz-placeholder, textarea::-moz-placeholder { - opacity: 1; - /* 1 */ - color: #9ca3af; - /* 2 */ -} - -input::placeholder, -textarea::placeholder { - opacity: 1; - /* 1 */ - color: #9ca3af; - /* 2 */ -} - -/* -Set the default cursor for buttons. -*/ - -button, -[role="button"] { - cursor: pointer; -} - -/* -Make sure disabled buttons don't get the pointer cursor. -*/ - -:disabled { - cursor: default; -} - -/* -1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) -2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) - This can trigger a poorly considered lint error in some tools but is included by design. -*/ - -img, -svg, -video, -canvas, -audio, -iframe, -embed, -object { - display: block; - /* 1 */ - vertical-align: middle; - /* 2 */ -} - -/* -Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14) -*/ - -img, -video { - max-width: 100%; - height: auto; -} - -/* Make elements with the HTML hidden attribute stay hidden by default */ - -[hidden]:where(:not([hidden="until-found"])) { - display: none; -} - -.visible { - visibility: visible; -} - -.static { - position: static; -} - -.fixed { - position: fixed; -} - -.mb-3 { - margin-bottom: 0.75rem; -} - -.mb-4 { - margin-bottom: 1rem; -} - -.block { - display: block; -} - -.hidden { - display: none; -} - -.transform { - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - -.rounded-lg { - border-radius: 0.5rem; -} - -.border { - border-width: 1px; -} - -.border-red-200 { - --tw-border-opacity: 1; - border-color: rgb(254 202 202 / var(--tw-border-opacity, 1)); -} - -.bg-red-50 { - --tw-bg-opacity: 1; - background-color: rgb(254 242 242 / var(--tw-bg-opacity, 1)); -} - -.p-4 { - padding: 1rem; -} - -.text-sm { - font-size: 0.875rem; - line-height: 1.25rem; -} - -.text-red-800 { - --tw-text-opacity: 1; - color: rgb(153 27 27 / var(--tw-text-opacity, 1)); -} - -.filter { - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); -} - -.transition { - transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter; - transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; - transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 150ms; -} \ No newline at end of file diff --git a/public/img/logo.svg b/public/img/logo.svg new file mode 100644 index 0000000..81d82ce --- /dev/null +++ b/public/img/logo.svg @@ -0,0 +1,66 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/src/Controller/HomeController.php b/src/Controller/HomeController.php index 7c96dfd..d9705a1 100644 --- a/src/Controller/HomeController.php +++ b/src/Controller/HomeController.php @@ -13,4 +13,4 @@ class HomeController extends AbstractController { return $this->render('home/home.html.twig'); } -} \ No newline at end of file +} diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index 79082ae..a8099a5 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -33,20 +33,34 @@ class UserController extends AbstractController * @throws TransportExceptionInterface */ - #[Route('/user/{email}', name: 'app_user', methods: ['GET'])] - public function index(string $email, KazApiService $apiClient): Response +// #[Route('/user/{email}', name: 'app_user', methods: ['GET'])] +// public function index(string $email, KazApiService $apiClient): Response +// { +// $exist = $apiClient->getUserData($email); +// +// return $this->render('user/index.html.twig', [ +// 'exist' => $exist, +// ]); +// } + + #[Route('/mon-profil', name: 'app_user', methods: ['GET'])] + public function index(KazApiService $apiClient): Response { - $exist = $apiClient->getUserData($email); + // Récupération de l'utilisateur actuellement connecté + $user = $this->getUser(); + + // Utilisation de son email pour interroger l'API + $userData = $apiClient->getUserData($user->getUserIdentifier()); return $this->render('user/index.html.twig', [ - 'exist' => $exist, + 'userData' => $userData, ]); } - #[Route('/user/mot-de-passe', name: 'app_user_edit_password', methods: ['GET', 'POST'])] + #[Route('/mot-de-passe', name: 'app_user_edit_password', methods: ['GET', 'POST'])] public function editPassword(Request $request, UserPasswordHasherInterface $hasher, EntityManagerInterface $entityManager): Response { - # Récupération de l'adhérent actuellement connecté + # Récupération de l'utilisateur actuellement connecté $user = $this->getUser(); # Création du formulaire @@ -73,7 +87,7 @@ class UserController extends AbstractController # Sauvegarde en BDD $entityManager->flush(); - # Message de succès pour l'adhérent + # Message de succès pour l'utilisateur $this->addFlash('success', 'Votre mot de passe a bien été mis à jour !'); return $this->redirectToRoute('app_user_edit_password'); @@ -83,4 +97,4 @@ class UserController extends AbstractController 'form' => $form->createView(), ]); } -} \ No newline at end of file +} diff --git a/src/DataFixtures/AppFixtures.php b/src/DataFixtures/AppFixtures.php index 23f759e..7788357 100644 --- a/src/DataFixtures/AppFixtures.php +++ b/src/DataFixtures/AppFixtures.php @@ -32,7 +32,7 @@ class AppFixtures extends Fixture # Attribution d'un email aléatoire et unique $user->setEmail($faker->unique()->safeEmail()); # Définition des droits d'accès de l'utilisateur - $user->setRoles(['ROLE_USER']); + $user->setRoles(['ROLE_USER', 'ROLE_ORGANISATION']); # Hachage sécurisé du mot de passe "password" $user->setPassword($this->hasher->hashPassword($user, 'password')); # Définition d'un NOM et Prénom @@ -52,7 +52,7 @@ class AppFixtures extends Fixture // Création d'un compte de test fixe $admin = new User(); $admin->setEmail('admin@kaz.bzh'); - $admin->setRoles(['ROLE_USER', 'ROLE_ADMIN']); + $admin->setRoles(['ROLE_USER', 'ROLE_ADMIN', 'ROLE_ORGANISATION']); $admin->setPassword($this->hasher->hashPassword($admin, 'password')); $admin->setFirstName('Admin'); $admin->setLastName('KAZ'); diff --git a/src/Security/AppCustomAuthenticator.php b/src/Security/AppCustomAuthenticator.php deleted file mode 100644 index b073d37..0000000 --- a/src/Security/AppCustomAuthenticator.php +++ /dev/null @@ -1,60 +0,0 @@ -getPayload()->getString('email'); - - $request->getSession()->set(SecurityRequestAttributes::LAST_USERNAME, $email); - - return new Passport( - new UserBadge($email), - new PasswordCredentials($request->getPayload()->getString('password')), - [ - new CsrfTokenBadge('authenticate', $request->getPayload()->getString('_csrf_token')), - new RememberMeBadge(), - ] - ); - } - - public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response - { - if ($targetPath = $this->getTargetPath($request->getSession(), $firewallName)) { - return new RedirectResponse($targetPath); - } - - // For example: - // return new RedirectResponse($this->urlGenerator->generate('some_route')); - throw new \Exception('TODO: provide a valid redirect inside '.__FILE__); - } - - protected function getLoginUrl(Request $request): string - { - return $this->urlGenerator->generate(self::LOGIN_ROUTE); - } -} diff --git a/tailwind.config.js b/tailwind.config.js deleted file mode 100644 index 4064a67..0000000 --- a/tailwind.config.js +++ /dev/null @@ -1,23 +0,0 @@ -/** @type {import('tailwindcss').Config} */ -module.exports = { - content: [ - "./assets/**/*.js", - "./templates/**/*.html.twig", - ], - theme: { - extend: { - colors: { - 'brand-teal': '#4DD5C8', // Boutons - 'brand-gold': '#E6A638', // Accent - 'brand-dark': '#000000', // Police - 'bg-primary': '#F9FCF7', // Fond principal - 'bg-secondary': '#23978B', // Fond secondaire - }, - fontFamily: { - 'sans': ['Sora', 'system-ui', 'sans-serif'], - 'title': ['Caveat', 'cursive'], - }, - }, - }, - plugins: [], -} \ No newline at end of file diff --git a/templates/_navbar.html.twig b/templates/_navbar.html.twig new file mode 100644 index 0000000..0e19a39 --- /dev/null +++ b/templates/_navbar.html.twig @@ -0,0 +1,65 @@ + diff --git a/templates/base.html.twig b/templates/base.html.twig index 89eb2cc..2090cb4 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -2,9 +2,13 @@ + + {% block title %}Association KAZ{% endblock %} - + + {% block stylesheets %} + {% endblock %} {% block javascripts %} @@ -13,18 +17,46 @@ -
- {# Section des notifications #} - {% for label, messages in app.flashes %} - {% for message in messages %} -
- {{ message }} + {# entête du site #} +
+
+ {{ include('_navbar.html.twig') }} +
+
+ {# contenu principal de chaque page #} +
+
+ {% block body %} + {% endblock body %} +
+
+ {# pied-de-page du site #} +
+
+
+ {# Logo de l'association #} + Logo de l'association + + {# Le texte et les liens #} + + © {{ 'now'|date('Y') }} | Kaz, le numérique sobre, libre, éthique et local. +
- {% endfor %} - {% endfor %} - - {% block body %}{% endblock %} -
+ + + diff --git a/templates/bundles/TwigBundles/Exception/error500.html.twig b/templates/bundles/TwigBundles/Exception/error500.html.twig deleted file mode 100644 index 031131d..0000000 --- a/templates/bundles/TwigBundles/Exception/error500.html.twig +++ /dev/null @@ -1 +0,0 @@ -error404.html.twig \ No newline at end of file diff --git a/templates/home/home.html.twig b/templates/home/home.html.twig index 4c5a93f..1133179 100644 --- a/templates/home/home.html.twig +++ b/templates/home/home.html.twig @@ -1,78 +1,106 @@ {% extends 'base.html.twig' %} -{% block title %}Tableau de bord | Association KAZ{% endblock %} +{% block title %}Accueil | Association KAZ{% endblock %} {% block body %} -
-
+
+
- {# --- EN-TÊTE DU TABLEAU DE BORD --- #} -
-
-

Espace Adhérent KAZ

-

Bienvenue sur votre intranet associatif.

+ {# Bloc "message d'accueil" #} +

+ Page d'accueil +

+ +
+

+ Bienvenue sur ton espace kaznaute {{ app.user ? app.user.userIdentifier : 'visiteur' }} ! +

+ + {# Zone réservée pour les futures données de l'API #} +
+

+ Votre abonnement actuellement : +

+ +
    +
  • + Formule souscrite : + {# TODO API : Remplacer par la vraie variable #} + Ajouter la vraie valeur +
  • +
  • + Date de validité : + {# TODO API : Remplacer par la vraie variable #} + Ajouter la vraie valeur +
  • +
- - {% if app.user %} -
- - 👤 {{ app.user.userIdentifier }} - - - Déconnexion - -
- {% endif %}
- {# --- GRILLE DES FONCTIONNALITÉS --- #} -
- {# Carte 1 : Profil #} -
-
-
-
- 📋 -
-
-
-
Mon Profil
-
Gérer mes informations
-
-
-
-
- -
+ {# Bloc "que souhaitez-vous faire ?" #} +

+ Que souhaitez-vous faire ? +

+ {# Gestion du responsive #} +
- {# Carte 2 : Mon abonnement KAZ #} -
-
-
-
- 💳 -
-
-
-
Mon abonnement KAZ
-
À jour
-
-
-
+ {# LIGNE 1 : Profil & Offre #} + +
+ 👤
-
- +
+

Mon Profil

+

Consulter et modifier mes informations

-
+ + +
+ 💳 +
+
+

Mon Offre

+

Gérer mon adhésion KAZ

+
+
+ + {# LIGNE 2 : Sécurité & Organisation/Contact #} + + +
+ 🔒 +
+
+

Sécurité

+

Modifier mes mots de passe

+
+
+ + {# Si la personne gère une asso, on montre l'organisation. Sinon, un bouton Contact pour garder la grille de 6 éléments équilibrée #} + {% if is_granted('ROLE_ADMIN_ORGANISATION') %} + +
+ 🏢 +
+
+

Mon Organisation

+

Espace de gestion du bureau

+
+
+ {% else %} + +
+ ✉️ +
+
+

Nous contacter

+

Besoin d'aide ou d'assistance ?

+
+
+ {% endif %}
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/templates/security/login.html.twig b/templates/security/login.html.twig index 8af8452..a634653 100644 --- a/templates/security/login.html.twig +++ b/templates/security/login.html.twig @@ -1,34 +1,92 @@ -{% extends 'base.html.twig' %} + + + + + + Page de connexion | Association KAZ -{% block title %}Se connecter | {{ parent() }}{% endblock %} + {% block importmap %}{{ importmap('app') }}{% endblock %} + -{% block body %} -
- {% if error %} -
{{ error.messageKey|trans(error.messageData, 'security') }}
- {% endif %} + +
+
- {% if app.user %} -
- You are logged in as {{ app.user.userIdentifier }}, Logout -
- {% endif %} +
+ Logo association +
-

Se connecter à mon tableau de bord KAZ

- - - - - +

Se connecter

-
- -
+ {% if error %} + + {% endif %} - - -{% endblock %} +
+ {# ajout du token csrf pour 2 fois plus de plaisir en toute sécurité #} + + + {# champ adresse-mail #} +
+ + +
+ + {# champ "mot de passe" #} +
+ + +
+ + {# checkbox "se souvenir de moi" #} +
+ + +
+ +
+ + + + M'inscrire + + +
+ +
+ {# TODO : faire route vers mot de passe oublié #} + + Mot de passe oublié ? + +
+
+
+ +
+ © {{ 'now'|date('Y') }} | Kaz, le numérique sobre, libre, éthique et local. +
+ + + diff --git a/templates/user/edit_password.html.twig b/templates/user/edit_password.html.twig index b1c27cd..f87ee24 100644 --- a/templates/user/edit_password.html.twig +++ b/templates/user/edit_password.html.twig @@ -1,7 +1,6 @@ -{# templates/user/edit_password.html.twig #} {% extends 'base.html.twig' %} -{% block title %}Modifier mon mot de passe | {{ parent() }}{% endblock %} +{% block title %}Modifier mes mots de passe | {{ parent() }}{% endblock %} {% block body %}
@@ -20,7 +19,7 @@ {{ form_errors(form.oldPassword) }}
- {# Champs Nouveau Mot de Passe (RepeatedType) #} + {# Champs Nouveau Mot de Passe #}
{{ form_row(form.newPassword.first, {'attr': {'class': 'w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-brand-teal outline-none'}}) }} {{ form_row(form.newPassword.second, {'attr': {'class': 'w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-brand-teal outline-none'}}) }} @@ -34,4 +33,4 @@
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/templates/bundles/TwigBundles/Exception/error404.html.twig b/true], similarity index 100% rename from templates/bundles/TwigBundles/Exception/error404.html.twig rename to true],