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,55 @@
|
||||
using Elternbeirat.Contracts;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace Elternbeirat.Web.Features.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Renders one event as a card with a calendar sheet, time, place and note.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Shared by the events page and the home-page events embed, so both show events
|
||||
/// the same way. They differ only in what the card leads to:
|
||||
/// <list type="bullet">
|
||||
/// <item>
|
||||
/// <description>
|
||||
/// In the embed the whole card links to the events page
|
||||
/// (<see cref="Href"/> set).
|
||||
/// </description>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <description>
|
||||
/// On the events page itself a link back to the same page would lead
|
||||
/// nowhere, so the card is no link (<see cref="Href"/> is
|
||||
/// <see langword="null"/>) and offers "In Kalender übernehmen" instead.
|
||||
/// </description>
|
||||
/// </item>
|
||||
/// </list>
|
||||
/// </remarks>
|
||||
/// <seealso cref="CalendarSheet"/>
|
||||
/// <seealso cref="IcsCalendar"/>
|
||||
public partial class EventCard
|
||||
{
|
||||
/// <summary>
|
||||
/// The event to show.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
[EditorRequired]
|
||||
public Event Value { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Where the card links to, or <see langword="null"/> for a card that is no link
|
||||
/// and offers the event as a calendar file instead.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string? Href { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The time line beside the sheet; empty for a single all-day event.
|
||||
/// </summary>
|
||||
private string Span => EventDateFormat.Span(Value);
|
||||
|
||||
/// <summary>
|
||||
/// The address of this one event as a calendar file.
|
||||
/// </summary>
|
||||
private string IcsHref => $"/events/{Uri.EscapeDataString(Value.Id)}.ics";
|
||||
}
|
||||
Reference in new issue
Block a user