Add news post type with list and detail routes

This commit is contained in:
tleininger committed 2026-09-21 15:47:12 +02:00
1 parent bed2db5972
commit 908a03a1f6
10 files changed
+295 -31

No files matched your search

@@ -0,0 +1,31 @@
@page "/beitraege"
@using System.Globalization
@using Elternbeirat.Web.Services
@inject PostService PostService
<PageTitle>Beiträge</PageTitle>
<h1>Beiträge</h1>
@if (PostService.All.Count == 0)
{
<p>Zurzeit gibt es keine Beiträge.</p>
}
else
{
<ul class="post-list">
@foreach (var post in PostService.All)
{
<li>
<a href="@($"/beitraege/{post.Slug}")">@post.Title</a>
<time datetime="@post.Date.ToString("yyyy-MM-dd")">
@post.Date.ToString("d. MMMM yyyy", _german)
</time>
</li>
}
</ul>
}
@code {
private static readonly CultureInfo _german = CultureInfo.GetCultureInfo("de-DE");
}