From 09a907d4e9a906228edd7769a85ac2ec69232189 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Tue, 16 Jul 2024 17:08:22 +0200 Subject: [PATCH] account menu pages --- .idea/workspace.xml | 35 +++++---- assets/styles/_global.scss | 9 +++ config/packages/easy_admin.yaml | 5 ++ src/Controller/AccountController.php | 81 +++++++++++++++++--- src/Controller/Admin/DashboardController.php | 3 +- templates/account/caisse-templates.html.twig | 20 +++++ templates/account/caisse.html.twig | 16 ++++ templates/account/festivals.html.twig | 27 +++++++ templates/account/history.html.twig | 2 +- templates/account/index.html.twig | 27 +++++++ templates/account/money.html.twig | 17 ++++ templates/account/nav.html.twig | 32 +++++++- templates/account/products.html.twig | 17 ++++ 13 files changed, 261 insertions(+), 30 deletions(-) create mode 100644 config/packages/easy_admin.yaml create mode 100644 templates/account/caisse-templates.html.twig create mode 100644 templates/account/caisse.html.twig create mode 100644 templates/account/festivals.html.twig create mode 100644 templates/account/money.html.twig create mode 100644 templates/account/products.html.twig diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3cb5d027..6d178d02 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -24,9 +24,12 @@ + + - - + + + - { - "keyToString": { - "dart.analysis.tool.window.visible": "false", - "git-widget-placeholder": "master", - "last_opened_file_path": "/home/poule/encrypted/stockage-syncable/www/development/html/caisse", - "node.js.detected.package.eslint": "true", - "node.js.detected.package.tslint": "true", - "node.js.selected.package.eslint": "(autodetect)", - "node.js.selected.package.tslint": "(autodetect)", - "nodejs_package_manager_path": "yarn", - "vue.rearranger.settings.migration": "true" + +}]]> + - @@ -311,7 +314,7 @@ - + diff --git a/assets/styles/_global.scss b/assets/styles/_global.scss index d759a0cd..f1773c8e 100644 --- a/assets/styles/_global.scss +++ b/assets/styles/_global.scss @@ -10,3 +10,12 @@ body { min-height: 100vh; background-color: $bg_main_color; } + +.todo{ + background: #eed096; + border-left: solid 1rem #ccc; + color: black !important; + padding-left: 0.5rem; + padding-top: 0.5rem; + padding-bottom: 0.5rem; +} diff --git a/config/packages/easy_admin.yaml b/config/packages/easy_admin.yaml new file mode 100644 index 00000000..0f0158f9 --- /dev/null +++ b/config/packages/easy_admin.yaml @@ -0,0 +1,5 @@ +easy_admin: + design: + menu: + main: + - { label: 'Accueil', route: 'app_index', icon: 'home' } diff --git a/src/Controller/AccountController.php b/src/Controller/AccountController.php index f44bed13..1d51d053 100644 --- a/src/Controller/AccountController.php +++ b/src/Controller/AccountController.php @@ -6,22 +6,83 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; +use Doctrine\ORM\EntityManagerInterface; +use App\Entity\User; +use App\Entity\ExepenseConfig; +use App\Entity\SerieFestival; +use App\Entity\Festival; +use App\Entity\Product; +use App\Entity\ProductSold; +use App\Entity\ProductCategory; + + class AccountController extends AbstractController { #[Route('/account', name: 'app_account')] - public function index(): Response + public function index(EntityManagerInterface $entityManager): Response { + +$currentFestival = "aucun"; + $repository = $entityManager->getRepository(Product::class); + $productsOfOwner = $repository->findByOwner($this->getUser()->getId()); + + $repository = $entityManager->getRepository(ProductSold::class); + $productsSoldOfOwner = $repository->findByOwner($this->getUser()->getId()); + + return $this->render('account/index.html.twig' + , [ + 'productsOfOwner'=> $productsOfOwner, + 'productsSoldOfOwner'=> $productsSoldOfOwner, + 'currentFestival'=> $currentFestival, + ] + ); + return $this->render('account/index.html.twig', [ 'controller_name' => 'AccountController', ]); } -/*** - page d'exemple - **/ -#[Route('/account/history', name: 'app_account_history')] - public function history(): Response - { - return $this->render('account/history.html.twig', [ - ]); - } + /*** + historique des ventes + **/ + #[Route('/account/history', name: 'app_account_history')] + public function history(): Response + { + return $this->render('account/history.html.twig', [ + ]); + } + /*** + gestion du pognon + **/ + #[Route('/account/money', name: 'app_account_money')] + public function money(): Response + { + return $this->render('account/money.html.twig', [ + ]); + } + + #[Route('/account/caisse', name: 'app_account_caisse')] + public function caisse(): Response + { + return $this->render('account/caisse.html.twig', [ + ]); + } + + #[Route('/account/caisse-templates', name: 'app_account_caisse_templates')] + public function caisseTemplates(): Response + { + return $this->render('account/caisse.html.twig', [ + ]); + } + #[Route('/account/products', name: 'app_account_products')] + public function products(): Response + { + return $this->render('account/products.html.twig', [ + ]); + } + #[Route('/account/festivals', name: 'app_account_festivals')] + public function festivals(): Response + { + return $this->render('account/festivals.html.twig', [ + ]); + } } diff --git a/src/Controller/Admin/DashboardController.php b/src/Controller/Admin/DashboardController.php index dd3de5bd..0ae0d2d2 100644 --- a/src/Controller/Admin/DashboardController.php +++ b/src/Controller/Admin/DashboardController.php @@ -23,9 +23,10 @@ use App\Entity\ProductCategory; class DashboardController extends AbstractDashboardController { #[Route('/admin', name: 'admin')] + public function index(): Response { - return $this->render('admin/dashboard.html.twig'); + return $this->render('admin/dashboard.html.twig' ); } public function configureDashboard(): Dashboard diff --git a/templates/account/caisse-templates.html.twig b/templates/account/caisse-templates.html.twig new file mode 100644 index 00000000..33c50117 --- /dev/null +++ b/templates/account/caisse-templates.html.twig @@ -0,0 +1,20 @@ +{% extends 'account/base.html.twig' %} + +{% block title %}Caisse{% endblock %} +{#Ici on fait les ventes pendant un festival#} +{% block account_body %} +
+ +

+ Templates de caisse +

+

+ Réalisez le design de vos écrans de caisse pour mieux correspondre à des contextes de vente précis. + Il vous suffira ensuite d'assigner un template par défaut, ou à un festival. +

+

+ todo +

+
+ +{% endblock account_body %} diff --git a/templates/account/caisse.html.twig b/templates/account/caisse.html.twig new file mode 100644 index 00000000..51de749a --- /dev/null +++ b/templates/account/caisse.html.twig @@ -0,0 +1,16 @@ +{% extends 'account/base.html.twig' %} + +{% block title %}Caisse{% endblock %} +{#Ici on fait les ventes pendant un festival#} +{% block account_body %} +
+ +

+ Caisse +

+

+ todo +

+
+ +{% endblock account_body %} diff --git a/templates/account/festivals.html.twig b/templates/account/festivals.html.twig new file mode 100644 index 00000000..b2547c80 --- /dev/null +++ b/templates/account/festivals.html.twig @@ -0,0 +1,27 @@ +{% extends 'account/base.html.twig' %} + +{% block title %}Votre historique{% endblock %} + +{% block account_body %} +
+ +

+ Festivals +

+

Actuel:

+

+ todo +

+
+

Liste des festivals

+

+ todo +

+
+

Séries de Festivals

+

+ todo +

+
+ +{% endblock account_body %} diff --git a/templates/account/history.html.twig b/templates/account/history.html.twig index 47632c4f..d24d21e8 100644 --- a/templates/account/history.html.twig +++ b/templates/account/history.html.twig @@ -12,7 +12,7 @@ Page historique

-

Votre historique d'actions

+

Votre historique de ventes

Blah blah blah.

diff --git a/templates/account/index.html.twig b/templates/account/index.html.twig index e17d2fcc..3d80972e 100644 --- a/templates/account/index.html.twig +++ b/templates/account/index.html.twig @@ -17,6 +17,33 @@ Votre description: {{ app.user.description }}

+
+ Festival en cours: {{ currentFestival }} +
+
+ + + + + + + + + + + +
+ Produits + + {{ productsOfOwner|length }} +
+ Ventes + + {{ productsSoldOfOwner|length }} +
+ + +