2023-01-25 22:45:36 +00:00
|
|
|
@page "/{boardName}/thread/{threadId}"
|
|
|
|
@using System.ComponentModel.DataAnnotations
|
|
|
|
@using ImageBoardServerApp.Data.Repository
|
|
|
|
@inject NavigationManager NavigationManager
|
|
|
|
|
2023-03-07 21:33:36 +00:00
|
|
|
<PageTitle>#@threadId on /@boardName/ - BulletBoard</PageTitle>
|
|
|
|
|
2023-01-25 22:45:36 +00:00
|
|
|
<h3>Thread #@threadId on /@boardName/</h3>
|
|
|
|
<Post post="@post" showOpenThread="false"/>
|
|
|
|
<hr/>
|
|
|
|
|
|
|
|
@foreach (var comment in post.Comments)
|
|
|
|
{
|
|
|
|
<Comment comment="comment"/>
|
|
|
|
<hr/>
|
|
|
|
}
|
2023-02-17 21:54:13 +00:00
|
|
|
<div class="Form">
|
|
|
|
<CommentForm post="post"/>
|
|
|
|
</div>
|
2023-01-25 22:45:36 +00:00
|
|
|
|
|
|
|
@code {
|
|
|
|
[Parameter]
|
|
|
|
[Required]
|
|
|
|
public string boardName { get; set; }
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
[Required]
|
|
|
|
public string threadId { get; set; }
|
|
|
|
|
|
|
|
private PostData post;
|
|
|
|
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
post = await PostsRepository.getPostByIdAsync(int.Parse(threadId));
|
|
|
|
}
|
|
|
|
catch (FormatException fe)
|
|
|
|
{
|
|
|
|
NavigationManager.NavigateTo("/notfound");
|
|
|
|
return;
|
|
|
|
}
|
2023-01-26 08:07:25 +00:00
|
|
|
if(post.Board != boardName)
|
|
|
|
NavigationManager.NavigateTo("/notfound");
|
2023-01-25 22:45:36 +00:00
|
|
|
if(post == null)
|
|
|
|
NavigationManager.NavigateTo("/notfound");
|
|
|
|
}
|
|
|
|
}
|