[backend] prepare new page: controller, route, link and minimal template

This commit is contained in:
Mathieu Jaumotte 2022-12-13 15:46:17 +01:00
parent 7abecdea02
commit 6ab5e708ec
5 changed files with 53 additions and 2 deletions

View File

@ -178,6 +178,28 @@ class AccompanyingCourseWorkController extends AbstractController
]); ]);
} }
/**
* @Route(
* "{_locale}/person/accompanying-period/work/{id}/show",
* name="chill_person_accompanying_period_work_show",
* methods={"GET"}
* )
*/
public function showWork(AccompanyingPeriodWork $work): Response
{
if (null === $work) {
throw $this->createNotFoundException('Unable to find Work entity.');
}
$this->denyAccessUnlessGranted(AccompanyingPeriodWorkVoter::SEE, $work);
return $this->render('@ChillPerson/AccompanyingCourseWork/show.html.twig', [
'accompanyingCourse' => $work->getAccompanyingPeriod(),
'work' => $work,
]);
}
private function createDeleteForm(int $id): Form private function createDeleteForm(int $id): Form
{ {
$params = []; $params = [];

View File

@ -128,6 +128,11 @@
'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork',
w.id, [], suppEvaluations) }} w.id, [], suppEvaluations) }}
</li> </li>
<li>
<a class="btn btn-show" title="{{ 'Show'|trans }}"
href="{{ chill_path_add_return_path('chill_person_accompanying_period_work_show', {'id': w.id }) }}"
></a>
</li>
{% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', w) %} {% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', w) %}
<li> <li>
<a class="btn btn-edit" title="{{ 'Edit'|trans }}" <a class="btn btn-edit" title="{{ 'Edit'|trans }}"

View File

@ -9,7 +9,7 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="accompanying_course_work-edit"> <div class="accompanying_course_work">
<h1>{{ block('title') }}</h1> <h1>{{ block('title') }}</h1>
<div id="accompanying_course_work_edit"></div> <div id="accompanying_course_work_edit"></div>
</div> </div>

View File

@ -0,0 +1,23 @@
{% extends '@ChillPerson/AccompanyingCourse/layout.html.twig' %}
{% block title 'accompanying_course_work.Show accompanying course work'|trans %}
{% block css %}
{{ parent() }}
{% endblock %}
{% block content %}
<div class="accompanying_course_work">
<h1>{{ block('title') }}</h1>
{{ dump() }}
</div>
{% endblock %}
{% block block_post_menu %}
<div class="post-menu pt-4"></div>
{% endblock %}
{% block js %}
{{ parent() }}
{% endblock %}

View File

@ -886,6 +886,7 @@ accompanying_course_work:
create: Créer une action create: Créer une action
Create accompanying course work: Créer une action d'accompagnement Create accompanying course work: Créer une action d'accompagnement
Edit accompanying course work: Modifier une action d'accompagnement Edit accompanying course work: Modifier une action d'accompagnement
Show accompanying course work: Action d'accompagnement
List accompanying course work: Liste des actions d'accompagnement List accompanying course work: Liste des actions d'accompagnement
action: Action action: Action
create_date: Date de création create_date: Date de création