Restructure into feature folders with code-behind and scoped CSS
This commit is contained in:
1 parent
5ba523d34d
commit
9d1f8fe0d4
25 files changed
+250
-203
No files matched your search
@@ -0,0 +1,35 @@
|
||||
@page "/"
|
||||
@inject PostService PostService
|
||||
|
||||
<PageTitle>Elternbeirat der IGMH</PageTitle>
|
||||
|
||||
<h1>Elternbeirat der IGMH</h1>
|
||||
|
||||
<p class="intro">
|
||||
Willkommen beim Elternbeirat der IGMH. Hier finden Sie aktuelle Informationen,
|
||||
Antworten auf häufige Fragen und Unterlagen rund um die Elternarbeit.
|
||||
</p>
|
||||
|
||||
<section class="home-news">
|
||||
<h2>Aktuelle Beiträge</h2>
|
||||
|
||||
@if (_latest.Count == 0)
|
||||
{
|
||||
<p>Zurzeit gibt es keine Beiträge.</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<ul class="post-list">
|
||||
@foreach (var post in _latest)
|
||||
{
|
||||
<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>
|
||||
<p><a href="/beitraege">Alle Beiträge →</a></p>
|
||||
}
|
||||
</section>
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Globalization;
|
||||
using Elternbeirat.Web.Services;
|
||||
|
||||
namespace Elternbeirat.Web.Features.Home;
|
||||
|
||||
public partial class Home
|
||||
{
|
||||
private static readonly CultureInfo German = CultureInfo.GetCultureInfo("de-DE");
|
||||
|
||||
private IReadOnlyList<Post> _latest = [];
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
// Show the three most recent posts as a teaser on the home page.
|
||||
_latest = [.. PostService.All.Take(3)];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
.intro {
|
||||
font-size: 1.1rem;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
.home-news {
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
.post-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.post-list li {
|
||||
padding: 0.75rem 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.post-list a {
|
||||
font-size: 1.1rem;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.post-list time {
|
||||
display: block;
|
||||
color: #777;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
Reference in new issue
Block a user