@page "/posts/{PostId:guid}"
@model DysonNetwork.Sphere.Pages.Posts.PostDetailModel
@using Markdig
@{
ViewData["Title"] = Model.Post?.Title + " | Solar Network";
var imageUrl = Model.Post?.Attachments?.FirstOrDefault(a => a.MimeType.StartsWith("image/"))?.Id;
}
@section Head {
@if (imageUrl != null)
{
}
}
@if (Model.Post != null)
{
@Model.Post.Title
Created at: @Model.Post.CreatedAt
@if (Model.Post.Publisher?.Account != null)
{
by @@@Model.Post.Publisher.Name
}
@Html.Raw(Markdown.ToHtml(Model.Post.Content ?? string.Empty))
@if (Model.Post.Attachments != null && Model.Post.Attachments.Any())
{
Attachments
@foreach (var attachment in Model.Post.Attachments)
{
@if (attachment.MimeType != null && attachment.MimeType.StartsWith("image/"))
{

}
else if (attachment.MimeType != null && attachment.MimeType.StartsWith("video/"))
{
}
@attachment.Name
}
}
}
else
{
Post not found.
}