Improved ArticleView

This commit is contained in:
Mia Rose Winter 2024-01-15 21:43:27 +01:00
parent 18a395cdcf
commit 1af00d1e90
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E
6 changed files with 27 additions and 8 deletions

View file

@ -1,22 +1,37 @@
@page "/article/{id:guid}"
@using Microsoft.EntityFrameworkCore
@using Wave.Data
@using Humanizer
@using System.Globalization
@inject IDbContextFactory<ApplicationDbContext> ContextFactory;
<PageTitle>Wave - @Article.Title</PageTitle>
<h1 class="text-3xl lg:text-5xl font-light mb-6">@Article.Title</h1>
<div class="flex gap-2 mb-6">
<h1 class="text-3xl lg:text-5xl font-light">@Article.Title</h1>
<p class="mb-6">
<small class="text-sm text-neutral-content">
@Article.PublishDate.Humanize()
@if (Article.LastModified is not null) {
<text>&ensp;(Modified @Article.LastModified.Humanize())</text>
}
</small>
</p>
<hr class="my-3" />
<div class="prose mb-6">
@Content
</div>
<div class="flex gap-2">
<ProfilePill Profile="Article.Author" RoleTag="Author" />
@if (Article.Reviewer is not null && Article.Reviewer.Id != Article.Author.Id) {
<ProfilePill Profile="Article.Reviewer" RoleTag="Reviewer" />
}
</div>
<div class="prose">
@Content
</div>
@code {
[Parameter]

View file

@ -10,6 +10,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
<PackageReference Include="Humanizer.Core.de" Version="2.14.1" />
<PackageReference Include="Humanizer.Core.uk" Version="2.14.1" />
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="13.5.0" />
<PackageReference Include="Markdig" Version="0.34.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.0" />

BIN
Wave/package-lock.json generated

Binary file not shown.

View file

@ -7,6 +7,7 @@
"author": "Mia Rose Winter",
"license": "MIT",
"devDependencies": {
"@tailwindcss/typography": "^0.5.10",
"autoprefixer": "^10.4.16",
"cssnano": "^6.0.3",
"daisyui": "^4.6.0",
@ -14,4 +15,4 @@
"postcss-cli": "^11.0.0",
"tailwindcss": "^3.4.1"
}
}
}

View file

@ -6,7 +6,7 @@ module.exports = {
}
},
plugins: [require("daisyui")],
plugins: [require("daisyui"), require('@tailwindcss/typography')],
daisyui: {
logs: false,
themes: [

File diff suppressed because one or more lines are too long