From 4319b0d8045a19dcea7e9e651acc388c99576dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 24 Mar 2023 18:16:44 +0100 Subject: [PATCH] Feature: add timespent on "show" page --- .../translations/messages+intl-icu.fr.yaml | 9 +++++++++ .../_objectifs_results_evaluations.html.twig | 14 +++++++++++++- .../ChillPersonBundle/translations/messages.fr.yml | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml b/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml index 4756ff4f7..263a57049 100644 --- a/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml +++ b/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml @@ -45,3 +45,12 @@ workflow: few {# workflows} other {# workflows} } + +duration: + minute: >- + {m, plural, + =0 {Aucune durée} + one {# minute} + few {# minutes} + other {# minutes} + } diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig index 0dd0cc84a..f4198a5c7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig @@ -118,6 +118,18 @@ {% endif %} {% endif %} + + {% if e.timeSpent is not null and e.timeSpent > 0 %} +
  • + {% set minutes = (e.timeSpent / 60) %} + {{ 'accompanying_course_work.timeSpent'|trans ~ ' : ' }} {{ 'duration.minute'|trans({ '{m}' : minutes }) }} +
  • + {% elseif displayContent is defined and displayContent == 'long' %} +
  • + {{ 'accompanying_course_work.timeSpent'|trans ~ ' : ' }} + {{ 'Not given'|trans }} +
  • + {% endif %} @@ -143,7 +155,7 @@ {% else %} {{ 'No document found'|trans }} {% endif %} - + {% endif %} diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 91347341f..090f35c1c 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -908,6 +908,7 @@ accompanying_course_work: remove: Supprimer une action d'accompagnement social_evaluation: Évaluation private_comment: Commentaire privé + timeSpent: Temps de rédaction #