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}" @page "/article/{id:guid}"
@using Microsoft.EntityFrameworkCore @using Microsoft.EntityFrameworkCore
@using Wave.Data @using Wave.Data
@using Humanizer
@using System.Globalization
@inject IDbContextFactory<ApplicationDbContext> ContextFactory; @inject IDbContextFactory<ApplicationDbContext> ContextFactory;
<PageTitle>Wave - @Article.Title</PageTitle> <PageTitle>Wave - @Article.Title</PageTitle>
<h1 class="text-3xl lg:text-5xl font-light mb-6">@Article.Title</h1> <h1 class="text-3xl lg:text-5xl font-light">@Article.Title</h1>
<div class="flex gap-2 mb-6"> <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" /> <ProfilePill Profile="Article.Author" RoleTag="Author" />
@if (Article.Reviewer is not null && Article.Reviewer.Id != Article.Author.Id) { @if (Article.Reviewer is not null && Article.Reviewer.Id != Article.Author.Id) {
<ProfilePill Profile="Article.Reviewer" RoleTag="Reviewer" /> <ProfilePill Profile="Article.Reviewer" RoleTag="Reviewer" />
} }
</div> </div>
<div class="prose">
@Content
</div>
@code { @code {
[Parameter] [Parameter]

View file

@ -10,6 +10,9 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <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="Magick.NET-Q8-AnyCPU" Version="13.5.0" />
<PackageReference Include="Markdig" Version="0.34.0" /> <PackageReference Include="Markdig" Version="0.34.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.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", "author": "Mia Rose Winter",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@tailwindcss/typography": "^0.5.10",
"autoprefixer": "^10.4.16", "autoprefixer": "^10.4.16",
"cssnano": "^6.0.3", "cssnano": "^6.0.3",
"daisyui": "^4.6.0", "daisyui": "^4.6.0",

View file

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

File diff suppressed because one or more lines are too long