From 33292c554a3ba453e4aaa11ccae521d38037bdf4 Mon Sep 17 00:00:00 2001 From: mckmonster Date: Thu, 4 Jul 2024 18:40:03 +0200 Subject: [PATCH] [Absence] Move eleve_absences in a specific twig --- actions/AbsencesAction.php | 3 +-- templates/{absences.twig => edu_absences.twig} | 11 +---------- templates/eleve_absences.twig | 10 ++++++++++ 3 files changed, 12 insertions(+), 12 deletions(-) rename templates/{absences.twig => edu_absences.twig} (61%) create mode 100644 templates/eleve_absences.twig diff --git a/actions/AbsencesAction.php b/actions/AbsencesAction.php index 60126a1..803d279 100644 --- a/actions/AbsencesAction.php +++ b/actions/AbsencesAction.php @@ -15,7 +15,6 @@ class AbsencesAction extends YesWikiAction $entryManager = $this->getService(EntryManager::class); $entries = $entryManager->search(['formsIds' => '6']); - $grouped_entries = []; foreach ($entries as $entry) { $identifier = $entry['listefiche5bf_eleve']; @@ -29,7 +28,7 @@ class AbsencesAction extends YesWikiAction $grouped_entries[$identifier]['entries'][] = $entry; } - return $this->render('@meeo/absences.twig', [ + return $this->render('@meeo/edu_absences.twig', [ "groups" => $grouped_entries, ]); } diff --git a/templates/absences.twig b/templates/edu_absences.twig similarity index 61% rename from templates/absences.twig rename to templates/edu_absences.twig index 0ee6d00..27d42c3 100644 --- a/templates/absences.twig +++ b/templates/edu_absences.twig @@ -5,16 +5,7 @@

{{ group['nom'] }}

{% endfor %} diff --git a/templates/eleve_absences.twig b/templates/eleve_absences.twig new file mode 100644 index 0000000..2d5e581 --- /dev/null +++ b/templates/eleve_absences.twig @@ -0,0 +1,10 @@ +
+ {% for entry in group['entries'] %} +
+
{{ entry['bf_date_debut_evenement'] }}
+ {% if entry['bf_commentaire']|default %} +

{{ entry['bf_commentaire'] }}

+ {% endif %} +
+ {% endfor %} +