@page @model DysonNetwork.Zone.Pages.PostsModel @{ Layout = "_LayoutContained"; const string defaultAvatar = "https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mp"; }

Posts

@if (Model.Posts.Any()) {
@foreach (var post in Model.Posts) {
@if (!string.IsNullOrWhiteSpace(post.Title) || !string.IsNullOrWhiteSpace(post.Description)) {
@if (!string.IsNullOrWhiteSpace(post.Title)) {

@post.Title

} @if (!string.IsNullOrWhiteSpace(post.Description)) {

@post.Description

}
}

@post.Content

@if (post.Attachments.Any()) {
@foreach (var attachment in 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 (post.Categories.Any() || post.Tags.Any()) {
@foreach (var category in post.Categories) { @(!string.IsNullOrEmpty(category.Name) ? category.Name : category.Slug) } @foreach (var tag in post.Tags) { @(!string.IsNullOrEmpty(tag.Name) ? tag.Name : tag.Slug) }
}
Posted on @post.CreatedAt.ToDateTimeOffset().ToString("yyyy-MM-dd")
}
} else {

No posts found.

} @if (Model.TotalPages > 1) {
@for (var idx = 1; idx <= Model.TotalPages; idx++) { var pageIdx = idx; @pageIdx }
}
@if (Model.Publisher != null) {
@if (Model.Publisher!.Background != null) {
Background
}
Avatar

@Model.Publisher.Nick @@@Model.Publisher.Name

@if (!string.IsNullOrWhiteSpace(Model.Publisher.Bio)) {

@Model.Publisher.Bio

}
}