From 88cc67d945e9cf98f21d6b8fae9538e9195ed7d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9drix?= Date: Fri, 15 May 2026 23:08:14 +0200 Subject: [PATCH] =?UTF-8?q?feat=20:=20image=20de=20couverture=20modifiable?= =?UTF-8?q?=20en=20mode=20=C3=A9dition=20(v1.6.12)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- CHANGELOG.md | 7 +++++++ public/index.php | 16 ++++++++++++++-- public/version.txt | 2 +- templates/wizard/step5.php | 2 +- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a151a6..b3b2ad0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ Format : [Keep a Changelog](https://keepachangelog.com/fr/1.0.0/) — versionnag --- +## [1.6.12] - 2026-05-15 + +### Ajouté +- Wizard édition — étape SEO : sélecteur d'**image de couverture** (og:image) désormais affiché en mode édition (était limité à la création) — sélection parmi les fichiers images existants, appliquée immédiatement via `setCover()` et mémorisée dans le draft overlay + +--- + ## [1.6.11] - 2026-05-15 ### Corrigé diff --git a/public/index.php b/public/index.php index 2e09070..a8c2e5f 100644 --- a/public/index.php +++ b/public/index.php @@ -961,10 +961,17 @@ switch ($action) { case 5: if ($_SERVER['REQUEST_METHOD'] === 'POST') { - $articles->saveDraftOverlay($uuid, [ + $overlayFields = [ 'seo_title' => trim($_POST['seo_title'] ?? ''), 'seo_description' => trim($_POST['seo_description'] ?? ''), - ]); + ]; + $coverFile = trim($_POST['cover_file'] ?? ''); + if ($coverFile !== '' && $coverFile !== ($draft['cover'] ?? '')) { + $articles->setCover($uuid, $coverFile); + $updatedCover = $articles->getByUuid($uuid)['cover'] ?? $coverFile; + $overlayFields['og_image'] = rtrim(APP_URL, '/') . '/file?uuid=' . rawurlencode($uuid) . '&name=' . rawurlencode($updatedCover); + } + $articles->saveDraftOverlay($uuid, $overlayFields); header('Location: /edit/' . rawurlencode($uuid) . '/6'); exit; } @@ -979,6 +986,8 @@ switch ($action) { $published = (bool)($draft['published'] ?? false); $published_at = $draft['published_at'] ?? ''; $category = $draft['category'] ?? ''; + $existingFiles = $articles->getFiles($uuid); + $article = $draft; include BASE_PATH . '/templates/wizard/step5.php'; break; @@ -1014,6 +1023,9 @@ switch ($action) { if ((bool)($draftData['published'] ?? false) !== (bool)($article['published'] ?? false)) { $changes[] = ($draftData['published'] ?? false) ? 'article publié' : 'article dépublié'; } + if (($draftData['og_image'] ?? '') !== ($article['og_image'] ?? '')) { + $changes[] = 'image de couverture modifiée'; + } $autoRevisionComment = !empty($changes) ? ucfirst(implode(', ', $changes)) : ''; $title = $draftData['title'] ?? ''; $seoTitle = $draftData['seo_title'] ?? ''; diff --git a/public/version.txt b/public/version.txt index 99c026b..9e7398a 100644 --- a/public/version.txt +++ b/public/version.txt @@ -1 +1 @@ -1.6.11 +1.6.12 diff --git a/templates/wizard/step5.php b/templates/wizard/step5.php index 9606fdc..e127bea 100644 --- a/templates/wizard/step5.php +++ b/templates/wizard/step5.php @@ -98,7 +98,7 @@ $_catVal = trim($category ?? ''); - + $_f['is_image']); ?>