From e7de1e2214a8651265df63bfc6f3e8ceea35ed9e Mon Sep 17 00:00:00 2001 From: Nathan Boiron Date: Tue, 18 Aug 2026 17:03:35 +0200 Subject: [PATCH 1/2] Refonte visuelle de la liste des articles --- assets/icons/fa-solid/angle-double-left.svg | 1 + assets/icons/fa-solid/angle-double-right.svg | 1 + assets/icons/fa-solid/angle-left.svg | 1 + assets/icons/fa-solid/angle-right.svg | 1 + assets/icons/mingcute/arrow-left-fill.svg | 1 + .../Entity/Repository/ArticleRepository.php | 3 +- .../{Form => Card}/Section.html.twig | 0 .../components/Form/FilterList.html.twig | 33 ++++ .../event/sponsorship_file/form.html.twig | 8 +- templates/site/news/list.html.twig | 162 +++++++----------- templates/site/pager.html.twig | 92 ++++++---- 11 files changed, 163 insertions(+), 140 deletions(-) create mode 100644 assets/icons/fa-solid/angle-double-left.svg create mode 100644 assets/icons/fa-solid/angle-double-right.svg create mode 100644 assets/icons/fa-solid/angle-left.svg create mode 100644 assets/icons/fa-solid/angle-right.svg create mode 100644 assets/icons/mingcute/arrow-left-fill.svg rename templates/components/{Form => Card}/Section.html.twig (100%) create mode 100644 templates/components/Form/FilterList.html.twig diff --git a/assets/icons/fa-solid/angle-double-left.svg b/assets/icons/fa-solid/angle-double-left.svg new file mode 100644 index 000000000..0fe1d983d --- /dev/null +++ b/assets/icons/fa-solid/angle-double-left.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/fa-solid/angle-double-right.svg b/assets/icons/fa-solid/angle-double-right.svg new file mode 100644 index 000000000..cf1bd72ff --- /dev/null +++ b/assets/icons/fa-solid/angle-double-right.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/fa-solid/angle-left.svg b/assets/icons/fa-solid/angle-left.svg new file mode 100644 index 000000000..fd3f1a3aa --- /dev/null +++ b/assets/icons/fa-solid/angle-left.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/fa-solid/angle-right.svg b/assets/icons/fa-solid/angle-right.svg new file mode 100644 index 000000000..fd3a66191 --- /dev/null +++ b/assets/icons/fa-solid/angle-right.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/mingcute/arrow-left-fill.svg b/assets/icons/mingcute/arrow-left-fill.svg new file mode 100644 index 000000000..fce0eb27a --- /dev/null +++ b/assets/icons/mingcute/arrow-left-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sources/AppBundle/Site/Entity/Repository/ArticleRepository.php b/sources/AppBundle/Site/Entity/Repository/ArticleRepository.php index dcab69ac1..799b565ea 100644 --- a/sources/AppBundle/Site/Entity/Repository/ArticleRepository.php +++ b/sources/AppBundle/Site/Entity/Repository/ArticleRepository.php @@ -49,7 +49,8 @@ public function getEventsLabelsById(): array ->from('afup_site_article', 'a') ->innerJoin('a', 'afup_forum', 'e', 'a.id_forum = e.id') ->groupBy('e.id') - ->orderBy('e.date_debut', 'DESC') + ->addOrderBy('e.date_debut', 'DESC') + ->addOrderBy('e.titre', 'DESC') ->executeQuery() ->fetchAllAssociative(); diff --git a/templates/components/Form/Section.html.twig b/templates/components/Card/Section.html.twig similarity index 100% rename from templates/components/Form/Section.html.twig rename to templates/components/Card/Section.html.twig diff --git a/templates/components/Form/FilterList.html.twig b/templates/components/Form/FilterList.html.twig new file mode 100644 index 000000000..53a1f0db1 --- /dev/null +++ b/templates/components/Form/FilterList.html.twig @@ -0,0 +1,33 @@ +{# @prop field Le champ de formulaire (choice multiple + expanded) #} +{# @prop title Le titre de la section #} +{# @prop limit Le nombre de choix affichés avant repli #} +{%- props field, title, limit = 5 -%} + +{# les choix cochés remontent, l'ordre d'origine est conservé pour le reste #} +{%- set choices = field|sort((a, b) => (b.vars.checked ? 1 : 0) - (a.vars.checked ? 1 : 0)) -%} +{%- set visible_count = max(limit, choices|filter(choice => choice.vars.checked)|length) -%} +{%- set shown = choices|slice(0, visible_count) -%} +{%- set folded = choices|slice(visible_count) -%} + + +
+ {% for choice in shown %} +
{{ form_widget(choice) }}{{ form_label(choice) }}
+ {% endfor %} +
+ + {% if folded|length %} +
+ + + Voir les {{ folded|length }} autres + + +
+ {% for choice in folded %} +
{{ form_widget(choice) }}{{ form_label(choice) }}
+ {% endfor %} +
+
+ {% endif %} +
diff --git a/templates/event/sponsorship_file/form.html.twig b/templates/event/sponsorship_file/form.html.twig index a3ea3ceb0..b1e87d3b9 100644 --- a/templates/event/sponsorship_file/form.html.twig +++ b/templates/event/sponsorship_file/form.html.twig @@ -22,7 +22,7 @@ {{ form_errors(leadForm) }} - +
{{ form_row(leadForm.firstname) }} {{ form_row(leadForm.lastname) }} @@ -30,15 +30,15 @@ {{ form_row(leadForm.phone) }} {{ form_row(leadForm.language) }}
-
+ - +
{{ form_row(leadForm.company) }} {{ form_row(leadForm.poste) }} {{ form_row(leadForm.website) }}
-
+ {{ form_row(leadForm.recaptcha) }} diff --git a/templates/site/news/list.html.twig b/templates/site/news/list.html.twig index c0782a6de..be0896d4c 100644 --- a/templates/site/news/list.html.twig +++ b/templates/site/news/list.html.twig @@ -1,13 +1,7 @@ -{% extends 'site/base.html.twig' %} +{% extends 'layouts/site.html.twig' %} {% block title %}Les actualités de l'AFUP, page {{ current_page }}{% endblock %} -{% block stylesheets %} - {{ parent() }} - - -{% endblock %} - {% block canonical %} {% if current_page == 1 %} @@ -18,114 +12,74 @@ {% block content %} -
-
-

Actualités

-
-
- - {% if articles|length %} - {% for article in articles %} - - {% endfor %} - {% else %} - Aucun article trouvé. - {% endif %} +
+
+ {% for article in articles %} +
+

{{ article.titre }}

+ + + +

{{ article.resume|raw }}

+ + + Lire plus + +
+ {% else %} +

+ Aucun article trouvé avec ces critères. +

+ + Revenir à la liste + + {% endfor %} + + {{ render(controller( + 'AppBundle\\Controller\\Website\\PagerController::display', + { + 'total_items': total_items, + 'current_page': current_page, + 'extra_parameters': { news_filters: filters }, + 'items_per_page' : articles_per_page, + } + )) }} +
- {{ render(controller( - 'AppBundle\\Controller\\Website\\PagerController::display', - { - 'total_items': total_items, - 'current_page': current_page, - 'extra_parameters': { news_filters: filters }, - 'items_per_page' : articles_per_page, - } - )) }} + + {{ form_widget(form.submit, {attr: {style: "display:none "}}) }} -
+ {{ form_end(form) }}
+
{% endblock %} {% block javascripts %} {{ parent() }} {% endblock %} diff --git a/templates/site/pager.html.twig b/templates/site/pager.html.twig index e774b2b16..54d128dab 100644 --- a/templates/site/pager.html.twig +++ b/templates/site/pager.html.twig @@ -1,31 +1,61 @@ -
- -
+ From 16143fdf0e834983db4a2eacb4913d39f39b8c59 Mon Sep 17 00:00:00 2001 From: Nathan Boiron Date: Tue, 18 Aug 2026 19:59:06 +0200 Subject: [PATCH 2/2] Utilisation de la balise time pour la date --- templates/site/news/display.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/site/news/display.html.twig b/templates/site/news/display.html.twig index 0cba39c98..a0cc6d9b9 100644 --- a/templates/site/news/display.html.twig +++ b/templates/site/news/display.html.twig @@ -34,9 +34,9 @@

{{ article.titre }}

- + +