mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-08-10 07:11:18 +02:00
fix: masquer le bloc "Durée" sur la page TFE quand aucune durée n'est encodée
This commit is contained in:
@@ -44,3 +44,4 @@
|
||||
- [x] Extend admin auth cookie lifetime from session-only to 1 week (604800s)
|
||||
- [x] Close TOC (licence/charte/apropos) and Filtres (search.php) <details> by default on mobile
|
||||
- [x] Wider heading scale (h1/h2/h3) for apropos/licence/charte pages: step-5 / step-3 / step-1
|
||||
- [x] Masquer le bloc "Durée" sur la page TFE quand aucune durée n'est encodée (ni pages ni minutes)
|
||||
|
||||
@@ -46,20 +46,22 @@
|
||||
<?php
|
||||
$_hasPages = isset($data["duration_pages"]) && $data["duration_pages"] !== null && $data["duration_pages"] !== '';
|
||||
$_hasMins = isset($data["duration_minutes"]) && $data["duration_minutes"] !== null && $data["duration_minutes"] !== '';
|
||||
$_parts = [];
|
||||
if ($_hasPages) $_parts[] = $data['duration_pages'] . ' pages';
|
||||
if ($_hasMins) {
|
||||
$_h = (int)floor((int)$data['duration_minutes'] / 60);
|
||||
$_m = (int)$data['duration_minutes'] % 60;
|
||||
$_parts[] = $_h . 'h' . str_pad((string)$_m, 2, '0', STR_PAD_LEFT);
|
||||
}
|
||||
$_duree = $_parts ? htmlspecialchars(implode(', ', $_parts)) : '–';
|
||||
unset($_hasPages, $_hasMins, $_parts, $_h, $_m);
|
||||
if ($_hasPages || $_hasMins):
|
||||
$_parts = [];
|
||||
if ($_hasPages) $_parts[] = $data['duration_pages'] . ' pages';
|
||||
if ($_hasMins) {
|
||||
$_h = (int)floor((int)$data['duration_minutes'] / 60);
|
||||
$_m = (int)$data['duration_minutes'] % 60;
|
||||
$_parts[] = $_h . 'h' . str_pad((string)$_m, 2, '0', STR_PAD_LEFT);
|
||||
}
|
||||
$_duree = htmlspecialchars(implode(', ', $_parts));
|
||||
unset($_h, $_m);
|
||||
?>
|
||||
<p class="tfe-meta-item">
|
||||
<span class="tfe-meta-label">Durée :</span>
|
||||
<?= $_duree ?>
|
||||
</p>
|
||||
<?php endif; unset($_hasPages, $_hasMins, $_parts, $_duree); ?>
|
||||
|
||||
<?php if (!empty($data["languages"])): ?>
|
||||
<p class="tfe-meta-item">
|
||||
|
||||
Reference in New Issue
Block a user