diff --git a/assets/app.js b/assets/app.js index 19988eb..9d6984e 100644 --- a/assets/app.js +++ b/assets/app.js @@ -5,10 +5,16 @@ import $ from 'jquery'; window.$ = $; // Bootstrap +import 'bootstrap' import 'bootstrap/dist/css/bootstrap.min.css'; +// Fontawsome +import '@fortawesome/fontawesome-free' +import '@fortawesome/fontawesome-free/css/all.min.css'; + // Local CSS import './styles/bootswatch.min.css' import './styles/app.css'; + console.log('This log comes from assets/app.js - welcome to AssetMapper! đ'); diff --git a/assets/styles/app.css b/assets/styles/app.css index dca526b..59709a8 100644 --- a/assets/styles/app.css +++ b/assets/styles/app.css @@ -2,4 +2,9 @@ .navbar-brand img { width:40px; margin-right:10px; +} + +.navbar-toggler { + border: none; + box-shadow: none !important; } \ No newline at end of file diff --git a/config/packages/security.yaml b/config/packages/security.yaml index ace4899..bf1e77c 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -20,6 +20,7 @@ security: login_path: app_login check_path: app_login enable_csrf: true + default_target_path: / logout: path: app_logout # where to redirect after logout @@ -34,8 +35,11 @@ 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: ^/login, roles: PUBLIC_ACCESS } + - { path: ^/register, roles: PUBLIC_ACCESS } + + - { path: ^/admin, roles: ROLE_ADMIN } + - { path: ^/, roles: ROLE_USER } when@test: security: diff --git a/importmap.php b/importmap.php index 3289872..4991d52 100644 --- a/importmap.php +++ b/importmap.php @@ -32,4 +32,21 @@ return [ 'version' => '5.3.3', 'type' => 'css', ], + '@fortawesome/fontawesome-free' => [ + 'version' => '6.7.1', + ], + '@fortawesome/fontawesome-free/css/fontawesome.min.css' => [ + 'version' => '6.7.1', + 'type' => 'css', + ], + '@fortawesome/fontawesome-free/css/all.min.css' => [ + 'version' => '6.7.1', + 'type' => 'css', + ], + 'bootstrap' => [ + 'version' => '5.3.3', + ], + '@popperjs/core' => [ + 'version' => '2.11.8', + ], ]; diff --git a/src/Entity/Accounting.php b/src/Entity/Accounting.php index 09a810a..17c9fff 100644 --- a/src/Entity/Accounting.php +++ b/src/Entity/Accounting.php @@ -24,11 +24,11 @@ class Accounting #[ORM\Column(length: 255)] private ?string $title = null; - #[ORM\Column(length: 255)] + #[ORM\Column(length: 255, nullable: true)] private ?string $icon = null; - #[ORM\Column] - private ?bool $actif = null; + #[ORM\Column(length: 255)] + private ?string $category = null; #[ORM\ManyToOne(inversedBy: 'accountings')] #[ORM\JoinColumn(nullable: false)] @@ -98,21 +98,21 @@ class Accounting return $this->icon; } - public function setIcon(string $icon): static + public function setIcon(?string $icon): static { $this->icon = $icon; return $this; } - public function isActif(): ?bool + public function getCategory(): ?string { - return $this->actif; + return $this->category; } - public function setActif(bool $actif): static + public function setCategory(string $category): static { - $this->actif = $actif; + $this->category = $category; return $this; } diff --git a/src/Entity/Company.php b/src/Entity/Company.php index 88bb3de..7845e7e 100644 --- a/src/Entity/Company.php +++ b/src/Entity/Company.php @@ -89,7 +89,7 @@ class Company return $this->adress; } - public function setAdress(string $adress): static + public function setAdress(?string $adress): static { $this->adress = $adress; @@ -260,4 +260,5 @@ class Company return $this; } + } diff --git a/src/Entity/Operation.php b/src/Entity/Operation.php index a520891..c97aae6 100644 --- a/src/Entity/Operation.php +++ b/src/Entity/Operation.php @@ -95,4 +95,5 @@ class Operation return $this; } + } diff --git a/src/EventSubscriber/CompanySubscriber.php b/src/EventSubscriber/CompanySubscriber.php index 298ef08..0eab24a 100644 --- a/src/EventSubscriber/CompanySubscriber.php +++ b/src/EventSubscriber/CompanySubscriber.php @@ -27,15 +27,15 @@ class CompanySubscriber $entityManager = $args->getObjectManager(); // GĂ©nĂ©ration des accounting par dĂ©faut - $this->insertAccounting($company,"512","000","Banque",true); - $this->insertAccounting($company,"530","000","Caisse",true); - $this->insertAccounting($company,"600","000","Charge",false); - $this->insertAccounting($company,"700","000","Produit",false); + $this->insertAccounting($company,"512","000","Banque","actif","fa-building-columns"); + $this->insertAccounting($company,"530","000","Caisse","actif","fa-piggy-bank"); + $this->insertAccounting($company,"600","000","Charge","charge",null); + $this->insertAccounting($company,"700","000","Produit","produit",null); // GĂ©nĂ©ration du year par } - private function insertAccounting(Company $company,string $num01, string $num02, string $title, bool $isactif): void + private function insertAccounting(Company $company,string $num01, string $num02, string $title, string $category, ?string $icon): void { $accounting=$this->em->getRepository("App\Entity\Accounting")->findOneBy(["company"=>$company,"num01"=>$num01,"num02"=>$num02]); if(!$accounting) { @@ -44,7 +44,7 @@ class CompanySubscriber $accounting->setNum01($num01); $accounting->setNum02($num02); $accounting->setTitle($title); - $accounting->SetActif($isactif); + $accounting->SetCategory($category); $this->em->persist($accounting); $this->em->flush(); } diff --git a/templates/base.html.twig b/templates/base.html.twig index 8eb16f1..0da7164 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -14,10 +14,9 @@