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;
|
namespace Chill\PersonBundle\Menu;
|
||||||
|
|
||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
@ -32,24 +33,31 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
||||||
{
|
{
|
||||||
|
$period = $parameters['accompanyingCourse'];
|
||||||
|
|
||||||
$menu->addChild($this->translator->trans('Resume Accompanying Course'), [
|
$menu->addChild($this->translator->trans('Resume Accompanying Course'), [
|
||||||
'route' => 'chill_person_accompanying_course_index',
|
'route' => 'chill_person_accompanying_course_index',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
'accompanying_period_id' => $parameters['accompanyingCourse']->getId()
|
'accompanying_period_id' => $period->getId()
|
||||||
]])
|
]])
|
||||||
->setExtras(['order' => 10]);
|
->setExtras(['order' => 10]);
|
||||||
|
|
||||||
$menu->addChild($this->translator->trans('Edit Accompanying Course'), [
|
$menu->addChild($this->translator->trans('Edit Accompanying Course'), [
|
||||||
'route' => 'chill_person_accompanying_course_show',
|
'route' => 'chill_person_accompanying_course_show',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
'accompanying_period_id' => $parameters['accompanyingCourse']->getId()
|
'accompanying_period_id' => $period->getId()
|
||||||
]])
|
]])
|
||||||
->setExtras(['order' => 20]);
|
->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'), [
|
$menu->addChild($this->translator->trans('Accompanying Course Details'), [
|
||||||
'route' => 'chill_person_accompanying_course_history',
|
'route' => 'chill_person_accompanying_course_history',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
'accompanying_period_id' => $parameters['accompanyingCourse']->getId()
|
'accompanying_period_id' => $period->getId()
|
||||||
]])
|
]])
|
||||||
->setExtras(['order' => 30]);
|
->setExtras(['order' => 30]);
|
||||||
}
|
}
|
||||||
|
@ -12,19 +12,17 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="grid-4">
|
<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>
|
||||||
|
|
||||||
<div class="grid-3">
|
<div class="grid-3">
|
||||||
<p style="text-align: right;">
|
<p style="text-align: right;">
|
||||||
<i>{{ 'Started on %date%'|trans({'%date%': accompanyingCourse.openingDate|format_date('short') } ) }}</i><br>
|
{% if 'DRAFT' == accompanyingCourse.getStep() %}
|
||||||
{% if accompanyingCourse.user is not null %}
|
Brouillon
|
||||||
par <b>{{ accompanyingCourse.user.usernameCanonical }}</b>
|
{% 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 %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
{% extends 'ChillPersonBundle:AccompanyingCourse:layout.html.twig' %}
|
{% extends 'ChillPersonBundle:AccompanyingCourse:layout.html.twig' %}
|
||||||
|
|
||||||
|
{% set title = 'DRAFT' == accompanyingCourse.step ? 'New accompanying course' : 'Edit accompanying course' %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
{{ 'Edit Accompanying Course'|trans }}
|
{{ title|trans }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% 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
|
Any accompanying periods are open: Aucune période d'accompagnement ouverte
|
||||||
An accompanying period is open: Une période d'accompagnement est ouverte
|
An accompanying period is open: Une période d'accompagnement est ouverte
|
||||||
Accompanying period list: Périodes d'accompagnement
|
Accompanying period list: Périodes d'accompagnement
|
||||||
|
New accompanying course: Nouveau parcours d'accompagnement
|
||||||
Choose a motive: Motif de fermeture
|
Choose a motive: Motif de fermeture
|
||||||
Re-open accompanying period: Ré-ouvrir
|
Re-open accompanying period: Ré-ouvrir
|
||||||
Re-Open a period: Ré-ouvrir
|
Re-Open a period: Ré-ouvrir
|
||||||
|
Loading…
x
Reference in New Issue
Block a user