@inherits LocalizableComponentBase
@* One feed item: a post (a boost shows the original and its booster), a notification, or a conversation's last post.
The card does its own Mastodon actions (favourite, boost, bookmark, reply, mute, block, delete) and tells the page
about replies and deletions. data-post-* attributes tell the globe where the post is (wwwroot/js/globe.js); a
quoted post (Compact) has none, since it is not an item of the feed. A CDN-fronted server's post has no point, only
its CDN's group (data-cdn); data-post-at is when it was written, for the globe's Sun; data-uri is its ActivityPub id,
which the e2e tests (tests/e2e) find it by. The persona's filters apply where the page says the card is (FilterIn): a
hide filter leaves it out, a warn filter folds it behind the filter's title, a blur filter blurs its media. Located posts have no actions: PrivaPub keeps them off the Mastodon API. Nerd stats are on
the time, the author and its server's history, the place or the CDN, the media and the counts. *@
@if (!IsFilteredOut)
{
@if (Author is { } author)
{
@if (Post.GroupAccounts.Count > 1)
{
@foreach (var account in Post.GroupAccounts.Take(4))
{
@* alt="": the names are in the text next to them. *@
}
}
@NotificationText(notification)@notification.CreatedAt.GetPassedTime(Localizer)
}
@if (status.SpoilerText is { Length: > 0 } spoiler)
{
@spoiler
@Body(status)
}
else
{
@Body(status)
}
@* the reactions stand outside the content warning: they are not what it hides *@
@if (status.EmojiReactions.Count > 0)
{
@Localizer["{0} km from you, shown within {1} km", Number(Post.DistanceKm), Number(Post.RangeKm)]
}
@if (status.Privapub?.Approval is "pending" or "rejected")
{
@* its target's author must approve it (GoToSocial's interaction policies): until then it went to that author alone *@
@(status.Privapub.Approval == "pending" ? Localizer["Waiting for its author's approval"] : Localizer["Its author did not approve it"])
@switch (happening.Participation)
{
case "accepted":
@Localizer["You are going"]
break;
case "pending":
@Localizer["Waiting for the organiser"]
break;
case "rejected":
@Localizer["The organiser said no"]
break;
}
@if (happening.Participation is "accepted" or "pending")
{
@Localizer["Leave"]
}
else
{
@Localizer["Join"]
}