This commit is contained in:
ExostFlash 2023-12-05 13:13:27 +01:00
parent f03af6ba0c
commit 68c6ef343e
8 changed files with 61 additions and 89 deletions

92
composer.lock generated
View file

@ -1740,16 +1740,16 @@
}, },
{ {
"name": "phpstan/phpdoc-parser", "name": "phpstan/phpdoc-parser",
"version": "1.24.3", "version": "1.24.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git", "url": "https://github.com/phpstan/phpdoc-parser.git",
"reference": "12f01d214f1c73b9c91fdb3b1c415e4c70652083" "reference": "6bd0c26f3786cd9b7c359675cb789e35a8e07496"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/12f01d214f1c73b9c91fdb3b1c415e4c70652083", "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/6bd0c26f3786cd9b7c359675cb789e35a8e07496",
"reference": "12f01d214f1c73b9c91fdb3b1c415e4c70652083", "reference": "6bd0c26f3786cd9b7c359675cb789e35a8e07496",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1781,9 +1781,9 @@
"description": "PHPDoc parser with support for nullable, intersection and generic types", "description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": { "support": {
"issues": "https://github.com/phpstan/phpdoc-parser/issues", "issues": "https://github.com/phpstan/phpdoc-parser/issues",
"source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.3" "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.4"
}, },
"time": "2023-11-18T20:15:32+00:00" "time": "2023-11-26T18:29:22+00:00"
}, },
{ {
"name": "psr/cache", "name": "psr/cache",
@ -6807,23 +6807,24 @@
}, },
{ {
"name": "symfony/var-exporter", "name": "symfony/var-exporter",
"version": "v6.3.6", "version": "v6.4.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/var-exporter.git", "url": "https://github.com/symfony/var-exporter.git",
"reference": "374d289c13cb989027274c86206ddc63b16a2441" "reference": "2d08ca6b9cc704dce525615d1e6d1788734f36d9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/var-exporter/zipball/374d289c13cb989027274c86206ddc63b16a2441", "url": "https://api.github.com/repos/symfony/var-exporter/zipball/2d08ca6b9cc704dce525615d1e6d1788734f36d9",
"reference": "374d289c13cb989027274c86206ddc63b16a2441", "reference": "2d08ca6b9cc704dce525615d1e6d1788734f36d9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=8.1" "php": ">=8.1",
"symfony/deprecation-contracts": "^2.5|^3"
}, },
"require-dev": { "require-dev": {
"symfony/var-dumper": "^5.4|^6.0" "symfony/var-dumper": "^5.4|^6.0|^7.0"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -6861,7 +6862,7 @@
"serialize" "serialize"
], ],
"support": { "support": {
"source": "https://github.com/symfony/var-exporter/tree/v6.3.6" "source": "https://github.com/symfony/var-exporter/tree/v6.4.1"
}, },
"funding": [ "funding": [
{ {
@ -6877,7 +6878,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-10-13T09:16:49+00:00" "time": "2023-11-30T10:32:10+00:00"
}, },
{ {
"name": "symfony/web-link", "name": "symfony/web-link",
@ -7114,27 +7115,27 @@
}, },
{ {
"name": "twig/extra-bundle", "name": "twig/extra-bundle",
"version": "v3.7.1", "version": "v3.8.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/twigphp/twig-extra-bundle.git", "url": "https://github.com/twigphp/twig-extra-bundle.git",
"reference": "f10baafe6eb0ecd615d52d5cbfb713a39f68e8f3" "reference": "32807183753de0388c8e59f7ac2d13bb47311140"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/twigphp/twig-extra-bundle/zipball/f10baafe6eb0ecd615d52d5cbfb713a39f68e8f3", "url": "https://api.github.com/repos/twigphp/twig-extra-bundle/zipball/32807183753de0388c8e59f7ac2d13bb47311140",
"reference": "f10baafe6eb0ecd615d52d5cbfb713a39f68e8f3", "reference": "32807183753de0388c8e59f7ac2d13bb47311140",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.2.5", "php": ">=7.2.5",
"symfony/framework-bundle": "^5.4|^6.0", "symfony/framework-bundle": "^5.4|^6.0|^7.0",
"symfony/twig-bundle": "^5.4|^6.0", "symfony/twig-bundle": "^5.4|^6.0|^7.0",
"twig/twig": "^2.7|^3.0" "twig/twig": "^3.0"
}, },
"require-dev": { "require-dev": {
"league/commonmark": "^1.0|^2.0", "league/commonmark": "^1.0|^2.0",
"symfony/phpunit-bridge": "^5.4|^6.3", "symfony/phpunit-bridge": "^6.4|^7.0",
"twig/cache-extra": "^3.0", "twig/cache-extra": "^3.0",
"twig/cssinliner-extra": "^2.12|^3.0", "twig/cssinliner-extra": "^2.12|^3.0",
"twig/html-extra": "^2.12|^3.0", "twig/html-extra": "^2.12|^3.0",
@ -7172,7 +7173,7 @@
"twig" "twig"
], ],
"support": { "support": {
"source": "https://github.com/twigphp/twig-extra-bundle/tree/v3.7.1" "source": "https://github.com/twigphp/twig-extra-bundle/tree/v3.8.0"
}, },
"funding": [ "funding": [
{ {
@ -7184,30 +7185,31 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-07-29T15:34:56+00:00" "time": "2023-11-21T14:02:01+00:00"
}, },
{ {
"name": "twig/twig", "name": "twig/twig",
"version": "v3.7.1", "version": "v3.8.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/twigphp/Twig.git", "url": "https://github.com/twigphp/Twig.git",
"reference": "a0ce373a0ca3bf6c64b9e3e2124aca502ba39554" "reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/a0ce373a0ca3bf6c64b9e3e2124aca502ba39554", "url": "https://api.github.com/repos/twigphp/Twig/zipball/9d15f0ac07f44dc4217883ec6ae02fd555c6f71d",
"reference": "a0ce373a0ca3bf6c64b9e3e2124aca502ba39554", "reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.2.5", "php": ">=7.2.5",
"symfony/polyfill-ctype": "^1.8", "symfony/polyfill-ctype": "^1.8",
"symfony/polyfill-mbstring": "^1.3" "symfony/polyfill-mbstring": "^1.3",
"symfony/polyfill-php80": "^1.22"
}, },
"require-dev": { "require-dev": {
"psr/container": "^1.0|^2.0", "psr/container": "^1.0|^2.0",
"symfony/phpunit-bridge": "^5.4.9|^6.3" "symfony/phpunit-bridge": "^5.4.9|^6.3|^7.0"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -7243,7 +7245,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/twigphp/Twig/issues", "issues": "https://github.com/twigphp/Twig/issues",
"source": "https://github.com/twigphp/Twig/tree/v3.7.1" "source": "https://github.com/twigphp/Twig/tree/v3.8.0"
}, },
"funding": [ "funding": [
{ {
@ -7255,7 +7257,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-08-28T11:09:02+00:00" "time": "2023-11-21T18:54:41+00:00"
}, },
{ {
"name": "webmozart/assert", "name": "webmozart/assert",
@ -7931,16 +7933,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "9.6.13", "version": "9.6.15",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be" "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3d767f7f9e191eab4189abe41ab37797e30b1be", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/05017b80304e0eb3f31d90194a563fd53a6021f1",
"reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be", "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -8014,7 +8016,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues", "issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy", "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.13" "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.15"
}, },
"funding": [ "funding": [
{ {
@ -8030,7 +8032,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-09-19T05:39:22+00:00" "time": "2023-12-01T16:55:19+00:00"
}, },
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",
@ -9376,16 +9378,16 @@
}, },
{ {
"name": "symfony/phpunit-bridge", "name": "symfony/phpunit-bridge",
"version": "v6.3.8", "version": "v6.4.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/phpunit-bridge.git", "url": "https://github.com/symfony/phpunit-bridge.git",
"reference": "45610900872a35b77db7698651f36129906041ea" "reference": "cca5373a41d45edbeaf38b7b67f376da2205ff95"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/45610900872a35b77db7698651f36129906041ea", "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/cca5373a41d45edbeaf38b7b67f376da2205ff95",
"reference": "45610900872a35b77db7698651f36129906041ea", "reference": "cca5373a41d45edbeaf38b7b67f376da2205ff95",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -9396,7 +9398,7 @@
}, },
"require-dev": { "require-dev": {
"symfony/deprecation-contracts": "^2.5|^3.0", "symfony/deprecation-contracts": "^2.5|^3.0",
"symfony/error-handler": "^5.4|^6.0", "symfony/error-handler": "^5.4|^6.0|^7.0",
"symfony/polyfill-php81": "^1.27" "symfony/polyfill-php81": "^1.27"
}, },
"bin": [ "bin": [
@ -9437,7 +9439,7 @@
"description": "Provides utilities for PHPUnit, especially user deprecation notices management", "description": "Provides utilities for PHPUnit, especially user deprecation notices management",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/phpunit-bridge/tree/v6.3.8" "source": "https://github.com/symfony/phpunit-bridge/tree/v6.4.1"
}, },
"funding": [ "funding": [
{ {
@ -9453,7 +9455,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-10-31T08:07:48+00:00" "time": "2023-12-01T09:25:07+00:00"
}, },
{ {
"name": "symfony/web-profiler-bundle", "name": "symfony/web-profiler-bundle",

View file

@ -21,7 +21,7 @@ nav {
} }
.account-image { .account-image {
border: 3px solid green; border: 3px solid #006a1d;
} }
.user-account { .user-account {

View file

@ -118,17 +118,4 @@ class HomeController extends AbstractController
return $this->redirectToRoute('app_home', [], Response::HTTP_SEE_OTHER); return $this->redirectToRoute('app_home', [], Response::HTTP_SEE_OTHER);
} }
#[Route('/menu/{idresto}', name: 'app_home_menu')]
public function menu($idresto): Response
{
$resto = $this->restoRepository->find($idresto);
$menus = $this->menuRepository->findBy(['id_resto' => $idresto]);
return $this->render('home/menu.html.twig', [
'controller_name' => 'Home',
'resto' => $resto,
'menus' => $menus,
]);
}
} }

View file

@ -21,7 +21,7 @@ class AvisType extends AbstractType
[ [
'attr' => [ 'attr' => [
'min' => 1, // Valeur minimale autorisée 'min' => 1, // Valeur minimale autorisée
'max' => 10, // Valeur maximale autorisée 'max' => 5, // Valeur maximale autorisée
], ],
'data' => 1, // Valeur par défaut 'data' => 1, // Valeur par défaut
'constraints' => [ 'constraints' => [

View file

@ -6,7 +6,7 @@
<link rel="icon" href="https://www.mcdonalds.fr/favicon.ico"> <link rel="icon" href="https://www.mcdonalds.fr/favicon.ico">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@1/css/pico.min.css" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@1/css/pico.min.css" />
<link rel="stylesheet" href="/css/style.css?v=1"/> <link rel="stylesheet" href="/css/style.css?v=2"/>
{% block stylesheets %} {% block stylesheets %}
{% endblock %} {% endblock %}
@ -20,14 +20,17 @@
</a> </a>
McDo McDo
<div class="user-account"> <div class="user-account">
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTTKH9wi35hrzL8VwoC21_g64uU6_Vwn7kR2Do__YnDJYg-2rXyi8ACbaYz-JrrqmKAS3Y&usqp=CAU" alt="Image de compte utilisateur" class="account-image" />
<div class="hover-text">
{% if not app.user %} {% if not app.user %}
<img src="https://icones.pro/wp-content/uploads/2022/07/icones-d-administration-vert.png" alt="Image de compte utilisateur" class="account-image" />
<div class="hover-text">
<div class="list"> <div class="list">
<span><a href="/user/login">Connexion</a></span> <span><a href="/user/login">Connexion</a></span>
<span><a href="/user/signup">Inscription</a></span> <span><a href="/user/signup">Inscription</a></span>
</div> </div>
</div>
{% else %} {% else %}
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTTKH9wi35hrzL8VwoC21_g64uU6_Vwn7kR2Do__YnDJYg-2rXyi8ACbaYz-JrrqmKAS3Y&usqp=CAU" alt="Image de compte utilisateur" class="account-image" />
<div class="hover-text">
<div class="list"> <div class="list">
<span>{{ app.user.email }}</span> <span>{{ app.user.email }}</span>
{% set roles = app.user.roles %} {% set roles = app.user.roles %}
@ -45,8 +48,8 @@
<span><a href="/avis">Avis</a></span> <span><a href="/avis">Avis</a></span>
<span><a href="/user/logout">Logout</a></span> <span><a href="/user/logout">Logout</a></span>
</div> </div>
</div>
{% endif %} {% endif %}
</div>
</div> </div>
</nav> </nav>

View file

@ -7,8 +7,9 @@
<div class="center"> <div class="center">
<h1>Commande/Resa</h1> <h1>Commande/Resa</h1>
<h5>{{ resto.address }}, {{ resto.ville }}, {{ resto.pay }}</h5> <h5>{{ resto.address }}, {{ resto.ville }}, {{ resto.pay }}</h5>
{% if app.user %}
<p>Vous souhaitez reserver au restaurant : <code><a href="{{ path('app_home_resa', {'idresto': resto.id}) }}">C'est par ici !</a></code> <p>Vous souhaitez reserver au restaurant : <code><a href="{{ path('app_home_resa', {'idresto': resto.id}) }}">C'est par ici !</a></code>
{% endif %}
{% for menu in menus %} {% for menu in menus %}
<article> <article>
@ -18,7 +19,9 @@
<li><code>Plat :</code> {{ menu.plat }}</li> <li><code>Plat :</code> {{ menu.plat }}</li>
<li><code>Dessert :</code> {{ menu.dessert }}</li> <li><code>Dessert :</code> {{ menu.dessert }}</li>
</ul> </ul>
{% if app.user %}
<code><a href="{{ path('app_home_ticket', {'idresto': resto.id, 'idmenu': menu.id}) }}">Commandez en ligne ce menu !</a></code> <code><a href="{{ path('app_home_ticket', {'idresto': resto.id, 'idmenu': menu.id}) }}">Commandez en ligne ce menu !</a></code>
{% endif %}
</article> </article>
{% endfor %} {% endfor %}

View file

@ -17,7 +17,7 @@
<h6>Réserver/Commander :</h6> <h6>Réserver/Commander :</h6>
<ul class="center"> <ul class="center">
{% for resto in restos %} {% for resto in restos %}
<li><code><a href="{{ path('app_home_menu', {'idresto': resto.id}) }}">{{ resto.address }}, {{ resto.ville }}, {{ resto.pay }}</a></code></li> <li><code><a href="{{ path('app_home_choice', {'idresto': resto.id}) }}">{{ resto.address }}, {{ resto.ville }}, {{ resto.pay }}</a></code></li>
{% endfor %} {% endfor %}
</ul> </ul>
{% else %} {% else %}

View file

@ -1,23 +0,0 @@
{% extends 'base.html.twig' %}
{% block title %}Menu{% endblock %}
{% block body %}
<div class="center">
<h1>Menu</h1>
<h5>{{ resto.address }}, {{ resto.ville }}, {{ resto.pay }}</h5>
{% for menu in menus %}
<article>
<h3>Menu {{ menu.id }}</h3>
<ul>
<li><code>Entrée :</code> {{ menu.entre }}</li>
<li><code>Plat :</code> {{ menu.plat }}</li>
<li><code>Dessert :</code> {{ menu.dessert }}</li>
</ul>
</article>
{% endfor %}
</div>
{% endblock %}