From da2504cf2ff0cb008e756a7c482f98e608eaa51b Mon Sep 17 00:00:00 2001
From: Valentin Le Moign
Date: Mon, 12 Oct 2026 14:19:47 +0200
Subject: [PATCH] Retours client 09-10/2026 : accueil, admin, pages membres,
interligne
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- Accueil : bouton « Toutes les manifestations scientifiques » (au lieu de
« Tous les événements »), titre de la page cible
- Accueil : diaporama Ouvrages et revues trié par date d'événement /
de publication (thalim_event_date_order) et non par date de création
- Admin : bloc « Type d'annonce » de retour dans la colonne de droite —
le groupe Pods s'appelle désormais `categorie`, la metabox est donc
#pods-meta-categorie
- Pages membres : « Mis à jour le » lit la date de dernière modification
du profil (user meta thalim_profile_updated, posée sur profile_update et
à la sauvegarde Pods) au lieu de user_registered (date de migration) ;
ligne masquée tant que le profil n'a pas été réenregistré
- Single : interligne et espacement des corps collés depuis un webmail
( par paragraphe,
vides) — SCSS seulement, CSS à compiler
---
inc/admin-tweaks.php | 13 +++++++++++++
inc/author-helpers.php | 7 ++++++-
index.php | 11 +++++++----
js/admin/admin-base.js | 3 ++-
scss/_single.scss | 12 ++++++++++++
templates/author.twig | 4 ++--
templates/index.twig | 2 +-
7 files changed, 43 insertions(+), 9 deletions(-)
diff --git a/inc/admin-tweaks.php b/inc/admin-tweaks.php
index a7c1c01..b4029ea 100644
--- a/inc/admin-tweaks.php
+++ b/inc/admin-tweaks.php
@@ -26,6 +26,19 @@ function thalim_sync_display_name( int $user_id ): void {
add_action( 'profile_update', 'thalim_sync_display_name' );
}
+// Date de dernière modification du profil, affichée « Mis à jour le » sur la
+// page auteur. WP ne conserve que user_registered, qui vaut la date de migration
+// (03/03/2026) pour la quasi-totalité des comptes.
+add_action( 'profile_update', 'thalim_touch_profile_updated' );
+add_action( 'pods_api_post_save_pod_item_user', function( $pieces ) {
+ $user_id = isset( $pieces['id'] ) ? intval( $pieces['id'] ) : 0;
+ if ( $user_id ) thalim_touch_profile_updated( $user_id );
+} );
+
+function thalim_touch_profile_updated( int $user_id ): void {
+ update_user_meta( $user_id, 'thalim_profile_updated', current_time( 'mysql' ) );
+}
+
// Show Pods user meta fields on the Add New User page (user-new.php).
// Fires the same hook Pods listens to on profile.php / user-edit.php.
add_action('user_new_form', function($operation) {
diff --git a/inc/author-helpers.php b/inc/author-helpers.php
index 4f87eda..bd029fd 100644
--- a/inc/author-helpers.php
+++ b/inc/author-helpers.php
@@ -141,7 +141,12 @@ function thalim_get_author_data($user_id) {
? 'https://hal.science/search/index/?qa[authIdHal_s][]=' . rawurlencode($hal_id) . '&sort=publicationDate_tdate+desc'
: '';
})(),
- 'user_since' => date_i18n('d/m/Y', strtotime($user->user_registered)),
+ // Vide tant que le profil n'a pas été enregistré depuis la mise en place
+ // du suivi (thalim_touch_profile_updated) → ligne « Mis à jour le » masquée.
+ 'updated_at' => (function() use ($user_id) {
+ $raw = get_user_meta($user_id, 'thalim_profile_updated', true);
+ return $raw ? date_i18n('d/m/Y', strtotime($raw)) : '';
+ })(),
];
}
diff --git a/index.php b/index.php
index f81e9f6..737b811 100755
--- a/index.php
+++ b/index.php
@@ -36,11 +36,14 @@ $context['annonces'] = $sort_with_pinned($annonces_raw, 'epingler_dans_le_
$context['annonces_cards'] = thalim_get_cards_data($annonces_raw);
// --- Publications et productions diaporama ---
+// Tri par date d'événement / de publication de l'ouvrage (date_de_debut > datetime
+// > post_date), pas par date de création de l'annonce.
$publications_raw = Timber::get_posts([
- 'post_type' => 'post',
- 'posts_per_page' => 30,
- 'orderby' => 'date',
- 'order' => 'DESC',
+ 'post_type' => 'post',
+ 'posts_per_page' => 30,
+ 'orderby' => 'date',
+ 'order' => 'DESC',
+ 'thalim_event_date_order' => true,
'tax_query' => [
'relation' => 'AND',
[
diff --git a/js/admin/admin-base.js b/js/admin/admin-base.js
index 0af504f..c956b54 100644
--- a/js/admin/admin-base.js
+++ b/js/admin/admin-base.js
@@ -25,7 +25,8 @@
// Metaboxes Pods déplacées / observées
boxes: {
bodyEn: '#pods-meta-body-en',
- typeDannonce: '#pods-meta-type-dannonce',
+ // ID dérivé du *nom* du groupe Pods « Type d'annonce » (categorie)
+ typeDannonce: '#pods-meta-categorie',
affichageAccueil: '#pods-meta-affichage-sur-laccueil',
thematique: '#pods-meta-thematique',
champsContextuels: '#pods-meta-champs-contextuels',
diff --git a/scss/_single.scss b/scss/_single.scss
index b4bdf91..5dcbeee 100644
--- a/scss/_single.scss
+++ b/scss/_single.scss
@@ -295,6 +295,18 @@
}
}
+ // Corps collé depuis un webmail (Zimbra…) : un
par paragraphe,
+ // séparés par des
vides, sans aucun
. Sans ces règles, ces
+ // div héritent du line-height: 1 du reset et les div vides ont une hauteur
+ // nulle (texte serré, paragraphes collés). :not([class]) épargne les div
+ // structurelles des templates, qui ont toutes une classe.
+ div:not([class]) {
+ line-height: 1.4;
+ &:empty {
+ height: 1rem;
+ }
+ }
+
// Le reset applique `font: inherit` à strong/b/em/i : on restaure gras et
// italique pour tout le corps de texte (paragraphes, listes, citations…),
// pas seulement sous
, sinon le formatage disparaît dans les
.
diff --git a/templates/author.twig b/templates/author.twig
index 7a450ad..44f25a2 100644
--- a/templates/author.twig
+++ b/templates/author.twig
@@ -31,7 +31,7 @@
{{ author.role_label|esc_html }}{% if author.role_complement %} {{ author.role_complement|esc_html }}{% if author.affiliation %},{% endif %}{% endif %}{% if author.affiliation %} {{ author.affiliation|esc_html }}{% endif %}
{% endif %}
- {{ current_language == 'en' ? 'Updated on' : 'Mis à jour le' }} {{ author.user_since }}
+ {% if author.updated_at %}{{ current_language == 'en' ? 'Updated on' : 'Mis à jour le' }} {{ author.updated_at }}
{% endif %}
{% endif %}
@@ -69,7 +69,7 @@
{{ author.role_label|esc_html }}{% if author.role_complement %} {{ author.role_complement|esc_html }}{% if author.affiliation %},{% endif %}{% endif %}{% if author.affiliation %} {{ author.affiliation|esc_html }}{% endif %}
{% endif %}
- {{ current_language == 'en' ? 'Updated on' : 'Mis à jour le' }} {{ author.user_since }}
+ {% if author.updated_at %}{{ current_language == 'en' ? 'Updated on' : 'Mis à jour le' }} {{ author.updated_at }}
{% endif %}
{% endif %}
diff --git a/templates/index.twig b/templates/index.twig
index bf703d3..36820f2 100644
--- a/templates/index.twig
+++ b/templates/index.twig
@@ -88,7 +88,7 @@