-
@Model.Post.Content
+
+ 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
{
diff --git a/DysonNetwork.Sphere/Pages/Posts/PostDetail.cshtml.cs b/DysonNetwork.Sphere/Pages/Posts/PostDetail.cshtml.cs
index 825a2e6..15d2ba8 100644
--- a/DysonNetwork.Sphere/Pages/Posts/PostDetail.cshtml.cs
+++ b/DysonNetwork.Sphere/Pages/Posts/PostDetail.cshtml.cs
@@ -29,12 +29,13 @@ public class PostDetailModel(
var userPublishers = currentUser is null ? [] : await pub.GetUserPublishers(currentUser.Id);
Post = await db.Posts
- .Where(e => e.Id == PostId)
- .Include(e => e.Publisher)
- .Include(e => e.Tags)
- .Include(e => e.Categories)
- .FilterWithVisibility(currentUser, userFriends, userPublishers)
- .FirstOrDefaultAsync();
+ .Where(e => e.Id == PostId)
+ .Include(e => e.Publisher)
+ .ThenInclude(p => p.Account)
+ .Include(e => e.Tags)
+ .Include(e => e.Categories)
+ .FilterWithVisibility(currentUser, userFriends, userPublishers)
+ .FirstOrDefaultAsync();
if (Post == null)
return NotFound();
diff --git a/DysonNetwork.Sphere/Pages/Shared/_Layout.cshtml b/DysonNetwork.Sphere/Pages/Shared/_Layout.cshtml
index cb7893f..d229ef9 100644
--- a/DysonNetwork.Sphere/Pages/Shared/_Layout.cshtml
+++ b/DysonNetwork.Sphere/Pages/Shared/_Layout.cshtml
@@ -15,6 +15,8 @@
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"
rel="stylesheet"
/>
+
+ @await RenderSectionAsync("Head", required: false)
diff --git a/DysonNetwork.Sphere/wwwroot/css/styles.css b/DysonNetwork.Sphere/wwwroot/css/styles.css
index bf7dca3..f9a79d1 100644
--- a/DysonNetwork.Sphere/wwwroot/css/styles.css
+++ b/DysonNetwork.Sphere/wwwroot/css/styles.css
@@ -6,6 +6,7 @@
--font-sans: "Nunito", sans-serif;
--font-mono: "Noto Sans Mono", monospace;
--color-blue-400: oklch(70.7% 0.165 254.624);
+ --color-blue-500: oklch(62.3% 0.214 259.815);
--color-blue-600: oklch(54.6% 0.245 262.881);
--color-gray-600: oklch(44.6% 0.03 256.802);
--color-black: #000;
@@ -1957,6 +1958,9 @@
.h-12 {
height: calc(var(--spacing) * 12);
}
+ .h-auto {
+ height: auto;
+ }
.h-full {
height: 100%;
}
@@ -2179,6 +2183,12 @@
.stroke-current {
stroke: currentcolor;
}
+ .object-cover {
+ object-fit: cover;
+ }
+ .p-2 {
+ padding: calc(var(--spacing) * 2);
+ }
.p-4 {
padding: calc(var(--spacing) * 4);
}
@@ -2293,6 +2303,9 @@
color: color-mix(in oklab, var(--color-base-content) 70%, transparent);
}
}
+ .text-blue-500 {
+ color: var(--color-blue-500);
+ }
.text-blue-600 {
color: var(--color-blue-600);
}
@@ -2398,6 +2411,13 @@
--btn-color: var(--color-primary);
--btn-fg: var(--color-primary-content);
}
+ .hover\:underline {
+ &:hover {
+ @media (hover: hover) {
+ text-decoration-line: underline;
+ }
+ }
+ }
.sm\:p-8 {
@media (width >= 40rem) {
padding: calc(var(--spacing) * 8);
@@ -2428,6 +2448,11 @@
width: calc(1/4 * 100%);
}
}
+ .lg\:grid-cols-3 {
+ @media (width >= 64rem) {
+ grid-template-columns: repeat(3, minmax(0, 1fr));
+ }
+ }
.lg\:px-8 {
@media (width >= 64rem) {
padding-inline: calc(var(--spacing) * 8);