@page "/p/{slug}" @model DysonNetwork.Zone.Pages.Posts.DetailsModel @{ Layout = "_LayoutContained"; }
@if (Model.Post != null) {

@(Model.Post.Title ?? "Post Details")

@if (!string.IsNullOrWhiteSpace(Model.Post.Description)) {

@Model.Post.Description

}
Posted on @Model.Post.CreatedAt.ToDateTimeOffset().ToString("yyyy-MM-dd HH:mm")
@if (Model.Post.EditedAt.HasValue) {
Updated on @Model.Post.EditedAt.Value.ToDateTimeOffset().ToString("yyyy-MM-dd HH:mm")
}
@if (!string.IsNullOrWhiteSpace(Model.Post.Description)) {

@Model.Post.Description

} @Html.Raw(Model.Post.Content)
@if (Model.Post.Attachments.Any()) {
@foreach (var attachment in Model.Post.Attachments) {
@if (attachment.MimeType!.StartsWith("image")) {
@attachment.Name
} else if (attachment.MimeType!.StartsWith("video")) { } else if (attachment.MimeType!.StartsWith("audio")) { } else { @attachment.Name }
}
} @if (Model.Post.Categories.Any() || (Model.Post.Tags.Any())) {
@foreach (var category in Model.Post.Categories) { @(!string.IsNullOrEmpty(category.Name) ? category.Name : category.Slug) } @foreach (var tag in Model.Post.Tags) { @(!string.IsNullOrEmpty(tag.Name) ? tag.Name : tag.Slug) }
}
} else {

Post not found.

}