mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
mes parcours brouillon added to usermenu
This commit is contained in:
parent
1e81256404
commit
a2a0f6af44
@ -48,4 +48,24 @@ class UserAccompanyingPeriodController extends AbstractController
|
||||
'pagination' => $pagination,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/accompanying-periods/drafts", name="chill_person_accompanying_period_draft_user")
|
||||
*/
|
||||
public function listDraftsAction(Request $request)
|
||||
{
|
||||
$total = $this->accompanyingPeriodRepository->countBy(['user' => $this->getUser(), 'step' => 'DRAFT']);
|
||||
$pagination = $this->paginatorFactory->create($total);
|
||||
$accompanyingPeriods = $this->accompanyingPeriodRepository->findBy(
|
||||
['user' => $this->getUser(), 'step' => 'DRAFT'],
|
||||
['id' => 'DESC'],
|
||||
$pagination->getItemsPerPage(),
|
||||
$pagination->getCurrentPageFirstItemNumber()
|
||||
);
|
||||
|
||||
return $this->render('@ChillPerson/AccompanyingPeriod/user_draft_periods_list.html.twig', [
|
||||
'accompanyingPeriods' => $accompanyingPeriods,
|
||||
'pagination' => $pagination,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -44,6 +44,13 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||
'order' => 20,
|
||||
'icon' => 'tasks',
|
||||
]);
|
||||
$menu->addChild('My accompanying periods in draft', [
|
||||
'route' => 'chill_person_accompanying_period_draft_user',
|
||||
])
|
||||
->setExtras([
|
||||
'order' => 30,
|
||||
'icon' => 'tasks'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,30 @@
|
||||
{% extends "@ChillMain/layout.html.twig" %}
|
||||
|
||||
{% set activeRouteKey = 'chill_person_accompanying_period_user_list' %}
|
||||
|
||||
{% block title %}{{ 'My accompanying periods in draft'|trans }}{% endblock title %}
|
||||
|
||||
{% macro recordAction(period) %}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': period.id }) }}"
|
||||
class="btn btn-show" title="{{ 'See accompanying period'|trans }}"></a>
|
||||
</li>
|
||||
{% endmacro %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="col-md-10">
|
||||
<h1>{{ 'My accompanying periods in draft'|trans }}</h1>
|
||||
|
||||
<div class="flex-table accompanyingcourse-list">
|
||||
{% for period in accompanyingPeriods %}
|
||||
{% include '@ChillPerson/AccompanyingPeriod/_list_item.html.twig' with {'period': period, 'recordAction': _self.recordAction(period)} %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{{ chill_pagination(pagination) }}
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
@ -566,3 +566,4 @@ Linked evaluations: Évaluations associées
|
||||
|
||||
# Accompanying period per user
|
||||
My accompanying periods: Mes parcours
|
||||
My accompanying periods in draft: Mes parcours brouillon
|
Loading…
x
Reference in New Issue
Block a user