added date and author to news in sidebar

This commit is contained in:
2026-04-24 17:08:32 +02:00
parent 5cadc5c1b4
commit 62ae9f18b0
2 changed files with 6 additions and 4 deletions

View File

@@ -217,9 +217,12 @@ $news_items = $stmt->fetchAll();
<?php else: ?> <?php else: ?>
<?php foreach ($news_items as $news): ?> <?php foreach ($news_items as $news): ?>
<div class="news-item"> <div class="news-item">
<span class="news-date"><?= date('d.m.Y', strtotime($news['published_at'])) ?></span>
<h3><?= htmlspecialchars($news['title']) ?></h3> <h3><?= htmlspecialchars($news['title']) ?></h3>
<p><?= nl2br(htmlspecialchars($news['content'])) ?></p> <p><?= nl2br(htmlspecialchars($news['content'])) ?></p>
<span class="news-date">
<?= htmlspecialchars($news['author_name']) ?>
· <?= date('d.m.Y', strtotime($news['published_at'])) ?>
</span>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?> <?php endif; ?>

View File

@@ -368,6 +368,7 @@ html, body {
News Items (Sidebar Tab) News Items (Sidebar Tab)
----------------------------------------------------------------- */ ----------------------------------------------------------------- */
.news-item { .news-item {
font-size: 0.8rem;
padding: var(--space-md); padding: var(--space-md);
margin-bottom: var(--space-sm); margin-bottom: var(--space-sm);
background: var(--color-surface); background: var(--color-surface);
@@ -376,10 +377,8 @@ html, body {
} }
.news-date { .news-date {
font-size: 0.75rem; font-size: 0.8rem;
color: var(--color-text-secondary); color: var(--color-text-secondary);
text-transform: uppercase;
letter-spacing: 0.5px;
} }
.news-item h3 { .news-item h3 {