add debriefing front page
This commit is contained in:
parent
22cd0dc375
commit
6a66fe3210
13
assets/css/cr.scss
Normal file
13
assets/css/cr.scss
Normal file
|
@ -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;
|
||||||
|
}
|
1
assets/js/cr.js
Normal file
1
assets/js/cr.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
import '../css/cr.scss'
|
|
@ -2,13 +2,18 @@ core:
|
||||||
site:
|
site:
|
||||||
name: "Suivi des interventions"
|
name: "Suivi des interventions"
|
||||||
logo: "build/images/tinternet.png"
|
logo: "build/images/tinternet.png"
|
||||||
# controllers:
|
controllers:
|
||||||
# - {name: 'Foo', action: 'App\Controller\ExampleController::foo'}
|
- {name: 'Compte-rendu', action: 'App\Controller\DebriefingController::debriefing'}
|
||||||
pages:
|
pages:
|
||||||
App\Entity\Page\SimplePage:
|
App\Entity\Page\SimplePage:
|
||||||
name: 'Simple page'
|
name: 'Simple page'
|
||||||
templates:
|
templates:
|
||||||
- {name: "Default", file: "page/simple/default.html.twig"}
|
- {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:
|
file_manager:
|
||||||
# mimes:
|
# mimes:
|
||||||
# - image/png
|
# - image/png
|
||||||
|
|
25
src/Controller/DebriefingController.php
Normal file
25
src/Controller/DebriefingController.php
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controller;
|
||||||
|
|
||||||
|
use App\Core\Controller\Site\PageController;
|
||||||
|
use App\Entity\Debriefing;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
|
class DebriefingController extends PageController
|
||||||
|
{
|
||||||
|
public function debriefing(Debriefing $entity, \DateTime $date): Response
|
||||||
|
{
|
||||||
|
if (!$this->siteRequest->getPage()) {
|
||||||
|
throw $this->createNotFoundException();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($entity->getDate() != $date) {
|
||||||
|
throw $this->createNotFoundException();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->defaultRender($this->siteRequest->getPage()->getTemplate(), [
|
||||||
|
'entity' => $entity,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
|
@ -57,7 +57,7 @@ class Debriefing implements EntityInterface
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->project = new ArrayCollection();
|
$this->projects = new ArrayCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
|
@ -94,7 +94,7 @@ class Debriefing implements EntityInterface
|
||||||
*/
|
*/
|
||||||
public function getProjects(): Collection
|
public function getProjects(): Collection
|
||||||
{
|
{
|
||||||
return $this->projects ?? new ArrayCollection();
|
return $this->projects;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addProject(Project $project): self
|
public function addProject(Project $project): self
|
||||||
|
|
19
src/Entity/Page/EntityPage.php
Normal file
19
src/Entity/Page/EntityPage.php
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity\Page;
|
||||||
|
|
||||||
|
use App\Core\Entity\Site\Page\Page;
|
||||||
|
use App\Core\Entity\Site\Page as BlockEntity;
|
||||||
|
use App\Core\Form\Site\Page as Block;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Entity
|
||||||
|
*/
|
||||||
|
class EntityPage extends Page
|
||||||
|
{
|
||||||
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
|
@ -36,6 +36,15 @@
|
||||||
-
|
-
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</li>
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<span class="font-weight-bold pb-2 d-block">Partager</span>
|
||||||
|
|
||||||
|
{% set url = safe_path('main_fr_menu_debriefing', {entity: entity.id, date: entity.date|date('d-m-Y')}) %}
|
||||||
|
|
||||||
|
<a class="btn btn-success border btn-sm mb-2 d-block" href="{{ url }}">
|
||||||
|
Partager
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-9 p-3">
|
<div class="col-md-9 p-3">
|
||||||
|
|
|
@ -22,7 +22,9 @@
|
||||||
{{ encore_entry_link_tags('app') }}
|
{{ encore_entry_link_tags('app') }}
|
||||||
{%- endblock -%}
|
{%- endblock -%}
|
||||||
|
|
||||||
<title>{{ _page.metaTitle }}</title>
|
{%- block title -%}
|
||||||
|
<title>{{ _page.metaTitle }}</title>
|
||||||
|
{%- endblock -%}
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
81
templates/page/debriefing/default.html.twig
Normal file
81
templates/page/debriefing/default.html.twig
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{%- block opengraph -%}
|
||||||
|
<meta property="og:title" content="{{ _page.ogTitle|build_string(entity) }}" />
|
||||||
|
<meta property="og:description" content="{{ _page.ogDescription|build_string(entity) }}" />
|
||||||
|
<meta property="og:type" content="website" />
|
||||||
|
<meta property="og:url" content="{{ app.request.uri }}" />
|
||||||
|
|
||||||
|
{%- if _page.ogImage -%}
|
||||||
|
<meta property="og:image" content="{{ absolute_url(asset(_page.ogImage)) }}" />
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endblock -%}
|
||||||
|
|
||||||
|
{%- block stylesheets -%}
|
||||||
|
{{ encore_entry_link_tags('cr') }}
|
||||||
|
{%- endblock -%}
|
||||||
|
|
||||||
|
{%- block javascripts -%}
|
||||||
|
{{ encore_entry_script_tags('cr') }}
|
||||||
|
{%- endblock -%}
|
||||||
|
|
||||||
|
{%- block title -%}
|
||||||
|
<title>{{ _page.metaTitle|build_string(entity) }}</title>
|
||||||
|
{%- endblock -%}
|
||||||
|
|
||||||
|
{% block page %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row mt-3 mb-3">
|
||||||
|
<div class="col-md-3 text-center">
|
||||||
|
<img src="{{ asset('build/images/tinternet.png') }}" alt="Tinternet & Cie" width="120">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
<h1 class="h2">{{ entity.topic }}</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3 p-3">
|
||||||
|
<ul class="list-group">
|
||||||
|
<li class="list-group-item">
|
||||||
|
<span class="font-weight-bold pb-2 d-block">Date</span>
|
||||||
|
|
||||||
|
{{ entity.date|date('d/m/Y') }}
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<span class="font-weight-bold pb-2 d-block">Projets</span>
|
||||||
|
|
||||||
|
{% for item in entity.projects %}
|
||||||
|
{{ item.label }}<br>
|
||||||
|
{% else %}
|
||||||
|
Aucun projet
|
||||||
|
{% endfor %}
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<span class="font-weight-bold pb-2 d-block">Contributeurs internes</span>
|
||||||
|
|
||||||
|
{{ entity.internalContributors|nl2br }}
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<span class="font-weight-bold pb-2 d-block">Contributeurs externes</span>
|
||||||
|
|
||||||
|
{{ entity.externalContributors|nl2br }}
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<span class="font-weight-bold pb-2 d-block">Fichiers</span>
|
||||||
|
|
||||||
|
{% for item in entity.files %}
|
||||||
|
<a class="btn btn-light border btn-sm mb-2 d-block" href="{{ asset(item.file) }}" target="_blank">
|
||||||
|
{{ item.name }}
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
|
-
|
||||||
|
{% endfor %}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9 p-3">
|
||||||
|
{{ entity.content|raw }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
|
@ -22,6 +22,7 @@ Encore
|
||||||
*/
|
*/
|
||||||
.addEntry('admin', './assets/js/admin.js')
|
.addEntry('admin', './assets/js/admin.js')
|
||||||
.addEntry('app', './assets/js/app.js')
|
.addEntry('app', './assets/js/app.js')
|
||||||
|
.addEntry('cr', './assets/js/cr.js')
|
||||||
|
|
||||||
// When enabled, Webpack "splits" your files into smaller pieces for greater optimization.
|
// When enabled, Webpack "splits" your files into smaller pieces for greater optimization.
|
||||||
.splitEntryChunks()
|
.splitEntryChunks()
|
||||||
|
|
Loading…
Reference in a new issue