2024-01-18 20:57:53 +00:00
|
|
|
@using Wave.Data
|
|
|
|
@using Humanizer
|
2024-01-26 13:15:28 +00:00
|
|
|
@using Wave.Utilities
|
2024-01-18 20:57:53 +00:00
|
|
|
|
2024-01-19 22:23:29 +00:00
|
|
|
@inject IStringLocalizer<Pages.ArticleView> Localizer
|
2024-01-18 20:57:53 +00:00
|
|
|
|
2024-01-25 10:46:48 +00:00
|
|
|
<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>
|
2024-01-26 13:15:28 +00:00
|
|
|
<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>
|
2024-01-25 10:46:48 +00:00
|
|
|
</p>
|
2024-01-26 13:15:28 +00:00
|
|
|
@if (Article.Categories.Count > 0) {
|
|
|
|
<p class="flex flex-wrap gap-2 my-3">
|
2024-01-26 14:16:11 +00:00
|
|
|
@foreach (var category in Article.Categories.OrderBy(c => c.Color)) {
|
2024-02-03 11:56:10 +00:00
|
|
|
<CategoryBadgeComponent Category="category" />
|
2024-01-26 13:15:28 +00:00
|
|
|
}
|
|
|
|
</p>
|
|
|
|
}
|
2024-01-25 10:46:48 +00:00
|
|
|
</header>
|
|
|
|
<div class="prose prose-neutral max-w-none hyphens-auto text-justify">
|
|
|
|
@Content
|
|
|
|
</div>
|
2024-01-18 20:57:53 +00:00
|
|
|
</article>
|
|
|
|
|
|
|
|
@if (!string.IsNullOrWhiteSpace(Article.Author.AboutTheAuthor)) {
|
|
|
|
<section class="mb-2">
|
2024-01-21 22:27:56 +00:00
|
|
|
<div class="card sm:card-side card-compact bg-secondary text-secondary-content rounded shadow">
|
2024-01-25 10:46:48 +00:00
|
|
|
<figure class="sm:max-w-40">
|
2024-01-18 20:57:53 +00:00
|
|
|
<img src="/api/user/pfp/@Article.Author.Id" alt="" width="800">
|
|
|
|
</figure>
|
|
|
|
<div class="card-body">
|
2024-01-25 10:46:48 +00:00
|
|
|
<h2 class="card-title">About The Author</h2>
|
|
|
|
<h3><strong>@Article.Author.Name</strong></h3>
|
2024-01-18 20:57:53 +00:00
|
|
|
<p>
|
|
|
|
@Article.Author.AboutTheAuthor
|
|
|
|
</p>
|
2024-02-03 01:09:26 +00:00
|
|
|
<div class="card-actions flex gap-2 flex-wrap">
|
|
|
|
@foreach (var link in Article.Author.Links) {
|
|
|
|
<UserLinkComponent Link="link" class="badge hover:badge-outline flex gap-2 p-4" />
|
|
|
|
}
|
|
|
|
</div>
|
2024-01-18 20:57:53 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
}
|
|
|
|
|
2024-01-19 22:11:08 +00:00
|
|
|
<div class="flex gap-2 flex-wrap">
|
2024-01-18 20:57:53 +00:00
|
|
|
@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);
|
|
|
|
}
|