style: liste éditoriale, navbar avec tagline, footer 2 colonnes
This commit is contained in:
+18
-3
@@ -34,7 +34,10 @@
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-lg navbar-light mb-0" role="navigation" aria-label="Navigation principale">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="route.php">📝 varlog</a>
|
||||
<a class="navbar-brand d-flex flex-column lh-1" href="route.php">
|
||||
<span>varlog</span>
|
||||
<small class="navbar-tagline">journal de Cédrix · informatique, hack & loisirs</small>
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent" aria-controls="navbarContent" aria-expanded="false" aria-label="Basculer la navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
@@ -51,8 +54,20 @@
|
||||
<?= $content ?>
|
||||
</main>
|
||||
|
||||
<footer class="text-center text-muted py-4 mt-5 small" role="contentinfo">
|
||||
© <?= date('Y') ?> — <strong>varlog</strong> est un journal personnel développé par Cédrix
|
||||
<footer class="py-5 mt-5" role="contentinfo">
|
||||
<div class="container">
|
||||
<div class="footer-inner">
|
||||
<div class="footer-about">
|
||||
<strong>varlog</strong>
|
||||
<p>Journal personnel de Cédrix.<br>Informatique, hack et loisirs techniques.</p>
|
||||
<small>© <?= date('Y') ?> — <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank" rel="noopener">CC BY 4.0</a></small>
|
||||
</div>
|
||||
<nav class="footer-nav" aria-label="Liens du site">
|
||||
<a href="route.php?action=about">À propos</a>
|
||||
<a href="route.php?action=legal">Mentions légales</a>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- JS -->
|
||||
|
||||
+20
-30
@@ -5,42 +5,32 @@ $Parsedown = new Parsedown();
|
||||
ob_start();
|
||||
?>
|
||||
|
||||
<h1 class="mb-4 text-center">📝 Tous les posts</h1>
|
||||
|
||||
<div class="row row-cols-1 row-cols-md-2 g-4">
|
||||
<div class="posts-list">
|
||||
<?php foreach ($posts as $post): ?>
|
||||
<div class="col">
|
||||
<div class="card shadow-sm h-100 border-<?php echo $post['is_published'] ? 'primary' : 'warning'; ?>">
|
||||
<div class="card-body d-flex flex-column">
|
||||
<h5 class="card-title text-primary">
|
||||
<?= htmlspecialchars($post['title']) ?>
|
||||
<?php if (!$post['is_published']): ?>
|
||||
<span class="badge bg-warning text-dark ms-2">⏳ Brouillon</span>
|
||||
<?php endif; ?>
|
||||
</h5>
|
||||
|
||||
<div class="card-text text-body">
|
||||
<?php
|
||||
$html = $Parsedown->text($post['content']);
|
||||
$preview = mb_strimwidth(strip_tags($html), 0, 300, '…');
|
||||
echo '<p>' . $preview . '</p>';
|
||||
<?php
|
||||
$html = $Parsedown->text($post['content']);
|
||||
$preview = mb_strimwidth(strip_tags($html), 0, 240, '…');
|
||||
?>
|
||||
</div>
|
||||
|
||||
<p class="text-muted small mt-auto mb-2">📅 Publié le <?= date('d/m/Y', strtotime($post['created_at'])) ?></p>
|
||||
|
||||
<div class="d-flex justify-content-end gap-2">
|
||||
<a href="route.php?action=view&id=<?= $post['id'] ?>" class="btn btn-sm btn-outline-primary">🔍 Voir</a>
|
||||
<a href="route.php?action=edit&id=<?= $post['id'] ?>" class="btn btn-sm btn-outline-secondary">✏️ Modifier</a>
|
||||
</div>
|
||||
<a href="route.php?action=view&id=<?= $post['id'] ?>" class="stretched-link"></a>
|
||||
</div>
|
||||
<article class="post-entry">
|
||||
<h2 class="post-entry-title">
|
||||
<a href="route.php?action=view&id=<?= $post['id'] ?>">
|
||||
<?= htmlspecialchars($post['title']) ?>
|
||||
</a>
|
||||
<?php if (!$post['is_published']): ?>
|
||||
<span class="badge bg-warning ms-2">Brouillon</span>
|
||||
<?php endif; ?>
|
||||
</h2>
|
||||
<p class="post-entry-excerpt"><?= htmlspecialchars($preview) ?></p>
|
||||
<div class="post-entry-meta">
|
||||
<span><?= date('d/m/Y', strtotime($post['created_at'])) ?></span>
|
||||
<a href="route.php?action=edit&id=<?= $post['id'] ?>" class="post-entry-edit">modifier</a>
|
||||
<a href="route.php?action=view&id=<?= $post['id'] ?>" class="post-entry-read">→ lire</a>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
$title = 'Liste des posts';
|
||||
$title = 'varlog';
|
||||
include __DIR__ . '/layout.php';
|
||||
|
||||
Reference in New Issue
Block a user