Add post and event cards, shared calendar sheet and per-event ICS; rework past events and next-event card
This commit is contained in:
1 parent
d328adac5c
commit
b2dc033de1
33 files changed
+1150
-206
No files matched your search
@@ -0,0 +1,46 @@
|
||||
using Elternbeirat.Contracts;
|
||||
using Elternbeirat.Web.Shared;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace Elternbeirat.Web.Features.Posts;
|
||||
|
||||
/// <summary>
|
||||
/// Renders one post as a card linking to the post, with date, title and teaser.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Shared by the posts page and the home-page posts embed, so both show posts the
|
||||
/// same way. The teaser comes from the body (<see cref="Markdown.Teaser"/>): posts
|
||||
/// have no summary field of their own.
|
||||
/// </remarks>
|
||||
/// <seealso cref="PostDate"/>
|
||||
public partial class PostCard
|
||||
{
|
||||
/// <summary>
|
||||
/// The post to show.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
[EditorRequired]
|
||||
public Post Value { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// <see langword="true"/> for the large card that opens the posts page (the
|
||||
/// newest post); <see langword="false"/> for a regular card.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public bool Featured { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The card's classes; the featured card adds its modifier.
|
||||
/// </summary>
|
||||
private string CssClass => Featured ? "post-card post-card-featured" : "post-card";
|
||||
|
||||
/// <summary>
|
||||
/// The address of the post.
|
||||
/// </summary>
|
||||
private string Href => $"/posts/{Value.Slug}";
|
||||
|
||||
/// <summary>
|
||||
/// The teaser text; empty if the body has no paragraph text.
|
||||
/// </summary>
|
||||
private string Teaser => Markdown.Teaser(Value.Body);
|
||||
}
|
||||
Reference in new issue
Block a user