diff --git a/assets/css/cr.scss b/assets/css/cr.scss new file mode 100644 index 0000000..512076f --- /dev/null +++ b/assets/css/cr.scss @@ -0,0 +1,13 @@ +$theme-colors: ( + "primary": #1ab5dc, + "primary-light": lighten(#3183aa, 40%), + "dark-blue": #1e2430, +) !default; + +@import "~bootstrap/scss/bootstrap.scss"; +@import "~@fortawesome/fontawesome-free/css/all.css"; + +h1 { + padding-top: 30px; + text-align: center; +} diff --git a/assets/js/cr.js b/assets/js/cr.js new file mode 100644 index 0000000..2ba4454 --- /dev/null +++ b/assets/js/cr.js @@ -0,0 +1 @@ +import '../css/cr.scss' diff --git a/config/packages/app.yaml b/config/packages/app.yaml index 05aeb67..a875a70 100644 --- a/config/packages/app.yaml +++ b/config/packages/app.yaml @@ -2,13 +2,18 @@ core: site: name: "Suivi des interventions" logo: "build/images/tinternet.png" - # controllers: - # - {name: 'Foo', action: 'App\Controller\ExampleController::foo'} + controllers: + - {name: 'Compte-rendu', action: 'App\Controller\DebriefingController::debriefing'} pages: App\Entity\Page\SimplePage: name: 'Simple page' templates: - {name: "Default", file: "page/simple/default.html.twig"} + App\Entity\Page\EntityPage: + name: 'Entité' + templates: + - {name: "Compte-rendu", file: "page/debriefing/default.html.twig"} + file_manager: # mimes: # - image/png diff --git a/src/Controller/DebriefingController.php b/src/Controller/DebriefingController.php new file mode 100644 index 0000000..3d9b9f5 --- /dev/null +++ b/src/Controller/DebriefingController.php @@ -0,0 +1,25 @@ +siteRequest->getPage()) { + throw $this->createNotFoundException(); + } + + if ($entity->getDate() != $date) { + throw $this->createNotFoundException(); + } + + return $this->defaultRender($this->siteRequest->getPage()->getTemplate(), [ + 'entity' => $entity, + ]); + } +} diff --git a/src/Entity/Debriefing.php b/src/Entity/Debriefing.php index be757d7..1676bf9 100644 --- a/src/Entity/Debriefing.php +++ b/src/Entity/Debriefing.php @@ -57,7 +57,7 @@ class Debriefing implements EntityInterface public function __construct() { - $this->project = new ArrayCollection(); + $this->projects = new ArrayCollection(); } public function getId(): ?int @@ -94,7 +94,7 @@ class Debriefing implements EntityInterface */ public function getProjects(): Collection { - return $this->projects ?? new ArrayCollection(); + return $this->projects; } public function addProject(Project $project): self diff --git a/src/Entity/Page/EntityPage.php b/src/Entity/Page/EntityPage.php new file mode 100644 index 0000000..b340bd9 --- /dev/null +++ b/src/Entity/Page/EntityPage.php @@ -0,0 +1,19 @@ + +