67 lines
2.5 KiB
Plaintext
67 lines
2.5 KiB
Plaintext
@using Wave.Data
|
|
@using Humanizer
|
|
|
|
@inject IStringLocalizer<Pages.ArticleView> Localizer
|
|
|
|
<article class="mb-6">
|
|
<header class="bg-secondary text-secondary-content border-b-2 border-current mt-[-2rem] mx-[-3rem] py-6 px-12 mb-6">
|
|
<h1 class="text-3xl lg:text-5xl font-light">
|
|
@Article.Title
|
|
</h1>
|
|
<p>
|
|
<small class="text-sm">
|
|
<time datetime="@Article.PublishDate.ToString("u")"
|
|
title="@Article.PublishDate.ToString("g")">
|
|
@Article.PublishDate.Humanize()
|
|
</time>
|
|
@if (Article.LastModified is not null && Article.LastModified > Article.PublishDate) {
|
|
<time datetime="@Article.LastModified.Value.ToString("u")"
|
|
title="@Article.LastModified.Value.ToString("g")">
|
|
 (@Localizer["ModifiedOn"] @Article.LastModified.Humanize())
|
|
</time>
|
|
}
|
|
@if (Article.Status < ArticleStatus.Published) {
|
|
<span class="badge badge-sm badge-outline badge-warning ml-2">
|
|
@Article.Status.Humanize()
|
|
</span>
|
|
}
|
|
</small>
|
|
</p>
|
|
</header>
|
|
<div class="prose prose-neutral max-w-none hyphens-auto text-justify">
|
|
@Content
|
|
</div>
|
|
</article>
|
|
|
|
@if (!string.IsNullOrWhiteSpace(Article.Author.AboutTheAuthor)) {
|
|
<section class="mb-2">
|
|
<div class="card sm:card-side card-compact bg-secondary text-secondary-content rounded shadow">
|
|
<figure class="sm:max-w-40">
|
|
<img src="/api/user/pfp/@Article.Author.Id" alt="" width="800">
|
|
</figure>
|
|
<div class="card-body">
|
|
<h2 class="card-title">About The Author</h2>
|
|
<h3><strong>@Article.Author.Name</strong></h3>
|
|
<p>
|
|
@Article.Author.AboutTheAuthor
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
}
|
|
|
|
<div class="flex gap-2 flex-wrap">
|
|
@if (string.IsNullOrWhiteSpace(Article.Author.AboutTheAuthor)) {
|
|
<ProfilePill Profile="Article.Author" RoleTag="@Localizer["Author"]"/>
|
|
}
|
|
@if (Article.Reviewer is not null && Article.Reviewer.Id != Article.Author.Id) {
|
|
<ProfilePill Profile="Article.Reviewer" RoleTag="@Localizer["Reviewer"]"/>
|
|
}
|
|
</div>
|
|
|
|
@code {
|
|
[Parameter]
|
|
public required Article Article { get; set; }
|
|
private MarkupString Content => new(Article.BodyHtml);
|
|
}
|