rework tfe.php layout: row1 author above title, row2 meta+synopsis 2-col grid, row3 flex files

This commit is contained in:
Pontoporeia
2026-06-08 12:40:17 +02:00
parent e0d706c677
commit a1a9a316ca
3 changed files with 82 additions and 61 deletions

View File

@@ -4,3 +4,4 @@
- [x] Remove border-radius from aria-current nav links, drop a:focus-visible ring in header, consolidate border-bottom/padding in shared header.css - [x] Remove border-radius from aria-current nav links, drop a:focus-visible ring in header, consolidate border-bottom/padding in shared header.css
- [x] Admin nav-logo: use grid layout with SVG + text horizontally aligned and vertically centered - [x] Admin nav-logo: use grid layout with SVG + text horizontally aligned and vertically centered
- [x] repertoire.css: .rep-entry → step-1, years col → step-3, col h2 → step-1 - [x] repertoire.css: .rep-entry → step-1, years col → step-3, col h2 → step-1
- [x] Rework tfe.php layout: row1 author above title, row2 meta+synopsis 2-col grid, row3 flex files

View File

@@ -10,23 +10,77 @@
padding: var(--space-l) var(--space-m) var(--space-xl); padding: var(--space-l) var(--space-m) var(--space-xl);
} }
/* Two-column article layout */ /* Stacked article layout */
.tfe-layout { .tfe-layout {
display: grid; display: flex;
grid-template-columns: 1fr 1.4fr; flex-direction: column;
gap: var(--space-xl); gap: var(--space-xl);
width: 100%; width: 100%;
}
/* Row 1: Author above Title */
.tfe-header-row {
display: flex;
flex-direction: column;
gap: var(--space-3xs);
}
/* Row 2: Two columns — meta left, synopsis right */
.tfe-content-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-xl);
align-items: start; align-items: start;
} }
/* Left column — article header */ /* Row 3: Files flex container */
.tfe-left { .tfe-files {
display: flex; display: flex;
flex-direction: column; flex-wrap: wrap;
gap: var(--space-m); gap: var(--space-m);
} }
/* Author (p) — above title */ .tfe-file-item {
flex: 1 1 300px;
min-width: 0;
overflow: hidden;
border-radius: var(--radius);
}
.tfe-file-item img {
width: 100%;
height: auto;
display: block;
border-radius: var(--radius);
}
.tfe-file-item embed,
.tfe-file-item video {
width: 100%;
display: block;
border: none;
}
.tfe-file-item video {
max-height: 500px;
}
.tfe-file-item embed {
height: clamp(300px, 80vh, 700px);
}
.tfe-file-item figcaption {
font-size: var(--step--2);
color: var(--text-secondary);
margin: var(--space-3xs) 0 0;
font-style: italic;
}
.tfe-synopsis-empty {
/* placeholder to maintain grid column */
}
/* Author (p) — inline with title */
.tfe-author { .tfe-author {
font-family: var(--font-display); font-family: var(--font-display);
font-size: var(--step-1); font-size: var(--step-1);
@@ -88,50 +142,6 @@
margin: 0; margin: 0;
} }
/* Right column — aside (supplementary media) */
.tfe-right {
display: flex;
flex-direction: column;
gap: var(--space-m);
}
/* Each file display unit — target <figure> directly inside <aside> */
aside figure {
overflow: hidden;
margin: 0;
border-radius: var(--radius);
}
aside figure img {
width: 100%;
height: auto;
display: block;
border-radius: var(--radius);
}
aside figure embed,
aside figure video {
width: 100%;
display: block;
border: none;
}
aside figure video {
max-height: 500px;
}
aside figure embed {
height: clamp(300px, 80vh, 700px);
}
/* figcaption under media — target <figcaption> inside <aside> */
aside figcaption {
font-size: var(--step--2);
color: var(--text-secondary);
margin: var(--space-3xs) 0 0;
font-style: italic;
}
/* PDF fallback download link */ /* PDF fallback download link */
.tfe-pdf-fallback { .tfe-pdf-fallback {
font-size: var(--step--1); font-size: var(--step--1);
@@ -294,11 +304,15 @@ aside figcaption {
/* Responsive */ /* Responsive */
@media (max-width: 900px) { @media (max-width: 900px) {
.tfe-layout { .tfe-content-row {
grid-template-columns: 1fr; grid-template-columns: 1fr;
gap: var(--space-l); gap: var(--space-l);
} }
.tfe-file-item {
flex: 1 1 100%;
}
.tfe-title { .tfe-title {
font-size: var(--step-2); font-size: var(--step-2);
} }

View File

@@ -1,9 +1,8 @@
<main class="tfe-main" id="main-content"> <main class="tfe-main" id="main-content">
<article class="tfe-layout"> <article class="tfe-layout">
<!-- LEFT: info article header --> <!-- ROW 1: Author above Title -->
<section class="tfe-left"> <div class="tfe-header-row">
<!-- Author above title -->
<p class="tfe-author"><?= htmlspecialchars( <p class="tfe-author"><?= htmlspecialchars(
$data["authors"] ?? "Auteur inconnu", $data["authors"] ?? "Auteur inconnu",
) ?></p> ) ?></p>
@@ -14,7 +13,10 @@
<?= htmlspecialchars($data["subtitle"]) ?> <?= htmlspecialchars($data["subtitle"]) ?>
<?php endif; ?> <?php endif; ?>
</h1> </h1>
</div>
<!-- ROW 2: Two columns — meta left, synopsis right -->
<div class="tfe-content-row">
<div class="tfe-meta"> <div class="tfe-meta">
<?php if (!empty($data["orientation"])): ?> <?php if (!empty($data["orientation"])): ?>
<p class="tfe-meta-item"> <p class="tfe-meta-item">
@@ -230,14 +232,16 @@
</div> </div>
<?php if (!empty($data["synopsis"])): ?> <?php if (!empty($data["synopsis"])): ?>
<p class="tfe-synopsis-text"> <div class="tfe-synopsis-text">
<?= nl2br(htmlspecialchars($data["synopsis"])) ?> <?= nl2br(htmlspecialchars($data["synopsis"])) ?>
</p> </div>
<?php else: ?>
<div class="tfe-synopsis-text tfe-synopsis-empty"></div>
<?php endif; ?> <?php endif; ?>
</section> </div>
<!-- RIGHT: media — supplementary aside --> <!-- ROW 3: All files — flex container -->
<section class="tfe-right"> <div class="tfe-files">
<?php $_videoIndex = 0; ?> <?php $_videoIndex = 0; ?>
<?php if ($isInterdit): ?> <?php if ($isInterdit): ?>
<p class="tfe-restricted"> <p class="tfe-restricted">
@@ -336,6 +340,7 @@
$mediaUrl = $isPeerTube ? '' : ($isExternalUrl ? htmlspecialchars($filePath) : ('/media?path=' . urlencode($filePath))); $mediaUrl = $isPeerTube ? '' : ($isExternalUrl ? htmlspecialchars($filePath) : ('/media?path=' . urlencode($filePath)));
$fileName = htmlspecialchars($file["file_name"] ?? basename($filePath)); $fileName = htmlspecialchars($file["file_name"] ?? basename($filePath));
?> ?>
<div class="tfe-file-item">
<?php if ($isPdf): ?> <?php if ($isPdf): ?>
<iframe src="<?= $mediaUrl ?>" <iframe src="<?= $mediaUrl ?>"
width="100%" height="700px" width="100%" height="700px"
@@ -415,11 +420,12 @@
<?php if ($caption !== '' && !$isOther): ?> <?php if ($caption !== '' && !$isOther): ?>
<figcaption><?= htmlspecialchars($caption) ?></figcaption> <figcaption><?= htmlspecialchars($caption) ?></figcaption>
<?php endif; ?> <?php endif; ?>
</div>
<?php endforeach; ?> <?php endforeach; ?>
<?php else: ?> <?php else: ?>
<p class="tfe-no-files">Aucun fichier disponible pour ce TFE.</p> <p class="tfe-no-files">Aucun fichier disponible pour ce TFE.</p>
<?php endif; ?> <?php endif; ?>
</section> </div>
</article> </article>
</main> </main>