mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
page 'create a course' for draft accompanying course
This commit is contained in:
parent
faad3f5f47
commit
9b7a52064a
@ -3,6 +3,7 @@
|
||||
namespace Chill\PersonBundle\Menu;
|
||||
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
@ -32,24 +33,31 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
||||
{
|
||||
$period = $parameters['accompanyingCourse'];
|
||||
|
||||
$menu->addChild($this->translator->trans('Resume Accompanying Course'), [
|
||||
'route' => 'chill_person_accompanying_course_index',
|
||||
'routeParameters' => [
|
||||
'accompanying_period_id' => $parameters['accompanyingCourse']->getId()
|
||||
'accompanying_period_id' => $period->getId()
|
||||
]])
|
||||
->setExtras(['order' => 10]);
|
||||
|
||||
$menu->addChild($this->translator->trans('Edit Accompanying Course'), [
|
||||
'route' => 'chill_person_accompanying_course_show',
|
||||
'routeParameters' => [
|
||||
'accompanying_period_id' => $parameters['accompanyingCourse']->getId()
|
||||
'accompanying_period_id' => $period->getId()
|
||||
]])
|
||||
->setExtras(['order' => 20]);
|
||||
|
||||
if (AccompanyingPeriod::STEP_DRAFT === $period->getStep()) {
|
||||
// no more menu items if the period is draft
|
||||
return;
|
||||
}
|
||||
|
||||
$menu->addChild($this->translator->trans('Accompanying Course Details'), [
|
||||
'route' => 'chill_person_accompanying_course_history',
|
||||
'routeParameters' => [
|
||||
'accompanying_period_id' => $parameters['accompanyingCourse']->getId()
|
||||
'accompanying_period_id' => $period->getId()
|
||||
]])
|
||||
->setExtras(['order' => 30]);
|
||||
}
|
||||
|
@ -12,19 +12,17 @@
|
||||
</div>
|
||||
|
||||
<div class="grid-4">
|
||||
<ul class="record_actions">
|
||||
<li>ponctuel <i class="fa fa-toggle-on fa-fw"></i> régulier</li>
|
||||
<li>ouvert</li>
|
||||
<li>en file active</li>
|
||||
<li>urgent</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="grid-3">
|
||||
<p style="text-align: right;">
|
||||
<i>{{ 'Started on %date%'|trans({'%date%': accompanyingCourse.openingDate|format_date('short') } ) }}</i><br>
|
||||
{% if accompanyingCourse.user is not null %}
|
||||
par <b>{{ accompanyingCourse.user.usernameCanonical }}</b>
|
||||
{% if 'DRAFT' == accompanyingCourse.getStep() %}
|
||||
Brouillon
|
||||
{% else %}
|
||||
<i>{{ 'Started on %date%'|trans({'%date%': accompanyingCourse.openingDate|format_date('short') } ) }}</i><br>
|
||||
{% if accompanyingCourse.user is not null %}
|
||||
par <b>{{ accompanyingCourse.user.username }}</b>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
|
@ -1,7 +1,9 @@
|
||||
{% extends 'ChillPersonBundle:AccompanyingCourse:layout.html.twig' %}
|
||||
|
||||
{% set title = 'DRAFT' == accompanyingCourse.step ? 'New accompanying course' : 'Edit accompanying course' %}
|
||||
|
||||
{% block title %}
|
||||
{{ 'Edit Accompanying Course'|trans }}
|
||||
{{ title|trans }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
@ -153,6 +153,7 @@ Update accompanying period: Mettre à jour une période d'accompagnement
|
||||
Any accompanying periods are open: Aucune période d'accompagnement ouverte
|
||||
An accompanying period is open: Une période d'accompagnement est ouverte
|
||||
Accompanying period list: Périodes d'accompagnement
|
||||
New accompanying course: Nouveau parcours d'accompagnement
|
||||
Choose a motive: Motif de fermeture
|
||||
Re-open accompanying period: Ré-ouvrir
|
||||
Re-Open a period: Ré-ouvrir
|
||||
|
Loading…
x
Reference in New Issue
Block a user