Procházet zdrojové kódy

intégration de BulmaCSS avec asset-mapper

garthh před 1 týdnem
rodič
revize
e306f3c5ab

+ 1 - 0
assets/styles/app.css

@@ -1,3 +1,4 @@
+/* Styles spécifiques à l'application */
 body {
     background-color: skyblue;
 }

+ 2 - 2
config/packages/security.yaml

@@ -36,8 +36,8 @@ security:
     # Easy way to control access for large sections of your site
     # Note: Only the *first* access control that matches will be used
     access_control:
-        - { path: ^/admin, roles: ROLE_ADMIN }
-        - { path: ^/profile, roles: ROLE_USER }
+        #- { path: ^/admin, roles: ROLE_ADMIN }
+        #- { path: ^/profile, roles: ROLE_USER }
 
 when@test:
     security:

+ 8 - 0
get_bulma.sh

@@ -0,0 +1,8 @@
+#! /bin/bash
+# Script de téléchartement et d'extraction de Bulma CSS
+
+rm -rf assets/vendor/bulma
+mkdir -p assets/vendor/bulma
+curl -L https://github.com/jgthms/bulma/releases/download/0.9.4/bulma-0.9.4.zip -o bulma.zip
+unzip bulma.zip -d assets/vendor/
+rm bulma.zip

+ 0 - 32
src/Controller/Admin/userController.php

@@ -1,32 +0,0 @@
-<?php
-
-namespace App\Controller;
-
-use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
-use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\Routing\Attribute\Route;
-
-final class Admin/userController extends AbstractController
-{
-    // Lister tous les utilisateurs
-    #[Route('/admin/user', name: 'app_admin_user')]
-    public function index(): Response
-    {
-        return $this->render('admin/user/index.html.twig', [
-            'controller_name' => 'Admin/userController',
-        ]);
-    }
-
-    // Afficher un utilisateur
-    #[Route('/admin/user/{uuid}/show', name: 'app_admin_user_show')]
-    public function show(string $uuid): Response
-    {
-        // Logique pour récupérer l'utilisateur par UUID
-        // ...
-
-        return $this->render('admin/user/show.html.twig', [
-            'uuid' => $uuid,
-            'controller_name' => 'Admin/userController',
-        ]);
-    }
-}

+ 6 - 0
templates/admin/index.html.twig

@@ -15,6 +15,12 @@
     <ul>
         <li>Your controller at <code>/Users/garthh/Developpement/orgasso/src/Controller/AdminController.php</code></li>
         <li>Your template at <code>/Users/garthh/Developpement/orgasso/templates/admin/index.html.twig</code></li>
+
+        
     </ul>
 </div>
+<div class="container">
+    <h1 class="title is-2">Hello Bulma avec AssetMapper 👋</h1>
+    <p class="notification is-success">C'est simple, sans Webpack ni bundle !</p>
+</div>
 {% endblock %}

+ 0 - 20
templates/admin/user/index.html.twig

@@ -1,20 +0,0 @@
-{% extends 'base.html.twig' %}
-
-{% block title %}Hello Admin/userController!{% endblock %}
-
-{% block body %}
-<style>
-    .example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
-    .example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
-</style>
-
-<div class="example-wrapper">
-    <h1>Hello {{ controller_name }}! ✅</h1>
-
-    This friendly message is coming from:
-    <ul>
-        <li>Your controller at <code>/Users/garthh/Developpement/orgasso/src/Controller/Admin/userController.php</code></li>
-        <li>Your template at <code>/Users/garthh/Developpement/orgasso/templates/admin/user/index.html.twig</code></li>
-    </ul>
-</div>
-{% endblock %}

+ 8 - 1
templates/base.html.twig

@@ -3,15 +3,22 @@
     <head>
         <meta charset="UTF-8">
         <title>{% block title %}Welcome!{% endblock %}</title>
+
+        <!-- feuilles de style -->
         <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>">
+        <link rel="stylesheet" href="{{ asset('vendor/bulma/css/bulma.min.css') }}">
+        <link rel="stylesheet" href="{{ asset('app.css') }}">
         {% block stylesheets %}
         {% endblock %}
+        <!-- /feuilles de style -->
 
+        <!-- javascripts -->
         {% block javascripts %}
             {% block importmap %}{{ importmap('app') }}{% endblock %}
         {% endblock %}
+        <!-- /javascripts -->
     </head>
     <body>
         {% block body %}{% endblock %}
     </body>
-</html>
+</html>