From 13b6fd95bec1493800143b652896920d801d90eb Mon Sep 17 00:00:00 2001 From: Serreau Jovann Date: Fri, 20 Mar 2026 21:29:58 +0100 Subject: [PATCH] Extract social icons to shared partial _social_icons.html.twig to reduce duplication Co-Authored-By: Claude Opus 4.6 (1M context) --- templates/components/_social_icons.html.twig | 29 +++++++++++++++++++ templates/home/event_detail.html.twig | 30 +------------------- templates/home/organizer_detail.html.twig | 30 +------------------- templates/home/organizers.html.twig | 30 +------------------- 4 files changed, 32 insertions(+), 87 deletions(-) create mode 100644 templates/components/_social_icons.html.twig diff --git a/templates/components/_social_icons.html.twig b/templates/components/_social_icons.html.twig new file mode 100644 index 0000000..fc3a254 --- /dev/null +++ b/templates/components/_social_icons.html.twig @@ -0,0 +1,29 @@ +{% if organizer.website or organizer.facebook or organizer.instagram or organizer.twitter or organizer.tiktok %} +
+ {% if organizer.website %} + + + + {% endif %} + {% if organizer.facebook %} + + + + {% endif %} + {% if organizer.instagram %} + + + + {% endif %} + {% if organizer.twitter %} + + + + {% endif %} + {% if organizer.tiktok %} + + + + {% endif %} +
+{% endif %} diff --git a/templates/home/event_detail.html.twig b/templates/home/event_detail.html.twig index 1605134..90002d3 100644 --- a/templates/home/event_detail.html.twig +++ b/templates/home/event_detail.html.twig @@ -106,35 +106,7 @@ - {% if organizer.website or organizer.facebook or organizer.instagram or organizer.twitter or organizer.tiktok %} -
- {% if organizer.website %} - - - - {% endif %} - {% if organizer.facebook %} - - - - {% endif %} - {% if organizer.instagram %} - - - - {% endif %} - {% if organizer.twitter %} - - - - {% endif %} - {% if organizer.tiktok %} - - - - {% endif %} -
- {% endif %} + {% include 'components/_social_icons.html.twig' with {organizer: organizer, class: 'flex-wrap mb-4'} only %} {% if organizer.email %}

{{ organizer.email }}

diff --git a/templates/home/organizer_detail.html.twig b/templates/home/organizer_detail.html.twig index a5edb76..3237d72 100644 --- a/templates/home/organizer_detail.html.twig +++ b/templates/home/organizer_detail.html.twig @@ -45,35 +45,7 @@

{% endif %} - {% if organizer.website or organizer.facebook or organizer.instagram or organizer.twitter or organizer.tiktok %} -
- {% if organizer.website %} - - - - {% endif %} - {% if organizer.facebook %} - - - - {% endif %} - {% if organizer.instagram %} - - - - {% endif %} - {% if organizer.twitter %} - - - - {% endif %} - {% if organizer.tiktok %} - - - - {% endif %} -
- {% endif %} + {% include 'components/_social_icons.html.twig' with {organizer: organizer, class: 'mt-4 flex-wrap justify-center md:justify-start'} only %} diff --git a/templates/home/organizers.html.twig b/templates/home/organizers.html.twig index eae0d2a..9b44da6 100644 --- a/templates/home/organizers.html.twig +++ b/templates/home/organizers.html.twig @@ -49,35 +49,7 @@

{% endif %} - {% if orga.website or orga.facebook or orga.instagram or orga.twitter or orga.tiktok %} -
- {% if orga.website %} - - - - {% endif %} - {% if orga.facebook %} - - - - {% endif %} - {% if orga.instagram %} - - - - {% endif %} - {% if orga.twitter %} - - - - {% endif %} - {% if orga.tiktok %} - - - - {% endif %} -
- {% endif %} + {% include 'components/_social_icons.html.twig' with {organizer: orga, class: 'mt-4 flex-wrap justify-center'} only %} Voir les evenements