From a9755e1a03b778f476a154143139c851bea31fa0 Mon Sep 17 00:00:00 2001 From: Kayn Ty Date: Wed, 9 May 2018 10:27:59 +0200 Subject: [PATCH] fix tabs for nav --- .../views/default/login-choices.html.twig | 14 +++++++++----- src/AppBundle/Controller/DefaultController.php | 10 +++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/app/Resources/views/default/login-choices.html.twig b/app/Resources/views/default/login-choices.html.twig index 54ad2a59..61d3703b 100755 --- a/app/Resources/views/default/login-choices.html.twig +++ b/app/Resources/views/default/login-choices.html.twig @@ -30,7 +30,8 @@ btn-success {% else %} btn-default - {% endif %}" href="{{ path('productcategory_index') }}"> + {% endif %} " + href="{{ path('productcategory_index') }}"> Catégories @@ -44,7 +45,9 @@ btn-success {% else %} btn-default - {% endif %}" href="{{ path('product_index') }}" data-toggle="tab"> + {% endif %} " + href="{{ path('product_index') }}" + > Produits @@ -57,8 +60,9 @@ btn-success {% else %} btn-default - {% endif %}" href='{{ path('festival_index') }}' - data-toggle="tab"> + {% endif %} + " href='{{ path('festival_index') }}' + > Festivals @@ -72,7 +76,7 @@ {% else %} btn-default {% endif %}" href="{{ path('history') }}" - data-toggle="tab"> + > Historique diff --git a/src/AppBundle/Controller/DefaultController.php b/src/AppBundle/Controller/DefaultController.php index b6227da6..5a1fdc4d 100755 --- a/src/AppBundle/Controller/DefaultController.php +++ b/src/AppBundle/Controller/DefaultController.php @@ -45,7 +45,7 @@ class DefaultController extends Controller { $m = $this->getDoctrine()->getManager(); $currentUser = $this->getUser(); - +// TODO on first login set default values $lastFestival = $currentUser->getActiveFestival(); if ( ! $lastFestival ) { $lastFestival = $m->getRepository( 'AppBundle:Festival' ) @@ -54,14 +54,14 @@ class DefaultController extends Controller { 0, 1 ); } - if($lastFestival){ - - $lastFestival->recalculateChiffreAffaire(); + if ( $lastFestival ) { + + $lastFestival->recalculateChiffreAffaire(); } $categRepo = $m->getRepository( 'AppBundle:ProductCategory' ); $sellingRepo = $m->getRepository( 'AppBundle:SellRecord' ); $categories = $categRepo->findAll(); - $recentSells = $sellingRepo->findBy( ['user'=>$currentUser->getId()], [ 'id' => 'desc' ], 0, 5 ); + $recentSells = $sellingRepo->findBy( [ 'user' => $currentUser->getId() ], [ 'id' => 'desc' ], 0, 5 ); return $this->render( 'logged/dashboard.html.twig', [