feat : historique des révisions dans la sidebar article (v1.6.23)

- post_view.php : section Historique dans la sidebar pour les connectés
  liste les 10 dernières révisions avec date + commentaire → lien diff (#82)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-16 11:21:54 +02:00
parent e2d218f364
commit 430b7ddd6f
3 changed files with 26 additions and 1 deletions
+7
View File
@@ -5,6 +5,13 @@ Format : [Keep a Changelog](https://keepachangelog.com/fr/1.0.0/) — versionnag
---
## [1.6.23] - 2026-05-16
### Ajouté
- Section « Historique » dans la sidebar des articles (connectés) : liste des révisions avec lien vers le diff (#82)
---
## [1.6.22] - 2026-05-16
### Ajouté
+1 -1
View File
@@ -1 +1 @@
1.6.22
1.6.23
+18
View File
@@ -440,6 +440,24 @@ $_shareTitle = $article['title'] ?? '';
</div>
<?php endif; ?>
<?php
$_revisions = array_reverse($article['revisions'] ?? []);
if (!empty($_revisions) && isLoggedIn()):
?>
<h6 class="related-sidebar-title mt-3">Historique</h6>
<ul class="toc-list small">
<?php foreach (array_slice($_revisions, 0, 10) as $_rev): ?>
<li>
<a href="/diff/<?= rawurlencode($article['uuid']) ?>/<?= (int)$_rev['n'] ?>">
<?= htmlspecialchars(substr($_rev['date'] ?? '', 0, 10)) ?>
<?php if (($_rev['comment'] ?? '') !== ''): ?>
— <span class="text-muted"><?= htmlspecialchars(mb_strimwidth($_rev['comment'], 0, 40, '…')) ?></span>
<?php endif; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</aside>
</div>