From 4933edaa94b000867e9ef76e47ad33227fa1399e Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Sun, 22 Aug 2021 20:13:42 +0200 Subject: [PATCH] share accompanying_course_work-list on resume page --- .../AccompanyingCourseWorkController.php | 4 +-- .../views/AccompanyingCourse/index.html.twig | 21 +------------- .../AccompanyingCourseWork/index.html.twig | 22 +++++++++++++++ .../list_by_accompanying_period.html.twig | 28 ++++--------------- 4 files changed, 30 insertions(+), 45 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php index 077fa15d7..739b14e2b 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php @@ -31,7 +31,7 @@ class AccompanyingCourseWorkController extends AbstractController $this->workRepository = $workRepository; $this->paginator = $paginator; } - + /** * @Route( * "{_locale}/person/accompanying-period/{id}/work/new", @@ -100,7 +100,7 @@ class AccompanyingCourseWorkController extends AbstractController $paginator->getCurrentPageFirstItemNumber() ); - return $this->render('@ChillPerson/AccompanyingCourseWork/list_by_accompanying_period.html.twig', [ + return $this->render('@ChillPerson/AccompanyingCourseWork/index.html.twig', [ 'accompanyingCourse' => $period, 'works' => $works, 'paginator' => $paginator diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig index e28de8b0e..1a51e5190 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig @@ -131,26 +131,7 @@

{{ 'Social actions'|trans }}

- {% for w in works %} -
-
-

{{ 'accompanying_course_work.action'|trans }}

-

- {{ w.socialAction|chill_entity_render_box({ 'no-badge': false }) }} -

-
-
- -
-
- {% else %} -

{{ 'accompanying_course_work.Any work'|trans }}

- {% endfor %} + {% include 'ChillPersonBundle:AccompanyingCourseWork:list_by_accompanying_period.html.twig' %}
{% block contentActivity %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig new file mode 100644 index 000000000..92b1919af --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig @@ -0,0 +1,22 @@ +{% extends '@ChillPerson/AccompanyingCourse/layout.html.twig' %} + +{% block title 'accompanying_course_work.List accompanying course work'|trans %} + +{% block content %} +
+ +

{{ block('title') }}

+ + {% include 'ChillPersonBundle:AccompanyingCourseWork:list_by_accompanying_period.html.twig' %} + + + +
+{% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_by_accompanying_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_by_accompanying_period.html.twig index 1f7b3716b..17c53abc7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_by_accompanying_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_by_accompanying_period.html.twig @@ -1,17 +1,11 @@ -{% extends '@ChillPerson/AccompanyingCourse/layout.html.twig' %} - -{% block title 'accompanying_course_work.List accompanying course work'|trans %} - -{% block content %} -
- -

{{ block('title') }}

- {% if works|length == 0 %} -

{{ 'accompanying_course_work.Any work'|trans }}

+

{{ 'accompanying_course_work.Any work'|trans }} + {# TODO link #} +

{% endif %} -
+
{% for w in works %}
@@ -119,16 +113,4 @@ {% endfor %}
- - -
-{% endblock %} -