2023-02-13 17:45:14 +00:00
|
|
|
@using System.ComponentModel.DataAnnotations
|
|
|
|
@using ImageBoardServerApp.Data.Repository
|
2023-02-17 21:54:13 +00:00
|
|
|
@inject NavigationManager navigationManager
|
2023-02-13 17:45:14 +00:00
|
|
|
<div>
|
|
|
|
@if (report.Type == "op")
|
|
|
|
{
|
|
|
|
<span> /@report.ReportedPost.Board/ </span>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<span> /@report.ReportedComment.Board/ </span>
|
|
|
|
}
|
|
|
|
<span>#@report.ReportID</span>
|
|
|
|
<span>@report.Type</span>
|
|
|
|
<br/>
|
|
|
|
<span>Reason: @report.ReportReason</span>
|
|
|
|
<br/>
|
|
|
|
<span>Explaination: @report.ReportExlaination</span>
|
|
|
|
<br/>
|
|
|
|
<span>Ban User: </span>
|
2023-06-13 21:34:16 +00:00
|
|
|
<a @onclick="() => banTarget(1)" href="javascript:void(0)">1h</a>
|
2023-02-13 17:45:14 +00:00
|
|
|
<span> </span>
|
2023-06-13 21:34:16 +00:00
|
|
|
<a @onclick="() => banTarget(2)" href="javascript:void(0)">2h</a>
|
2023-02-13 17:45:14 +00:00
|
|
|
<span> </span>
|
2023-06-13 21:34:16 +00:00
|
|
|
<a @onclick="() => banTarget(1 * 24)" href="javascript:void(0)">1d</a>
|
2023-02-13 17:45:14 +00:00
|
|
|
<span> </span>
|
2023-06-13 21:34:16 +00:00
|
|
|
<a @onclick="() => banTarget(7 * 24)" href="javascript:void(0)">1w</a>
|
|
|
|
<span> </span>
|
|
|
|
<a @onclick="() => banTarget(31 * 24)" href="javascript:void(0)">1m</a>
|
|
|
|
<span> </span>
|
|
|
|
<a @onclick="() => banTarget(365 * 24)" href="javascript:void(0)">1yr</a>
|
2023-02-13 17:45:14 +00:00
|
|
|
<span> </span>
|
|
|
|
<br/>
|
|
|
|
<span>Ban Reporter: </span>
|
2023-06-13 21:34:16 +00:00
|
|
|
<a @onclick="() => banReporter(1)" href="javascript:void(0)">1h</a>
|
|
|
|
<span> </span>
|
|
|
|
<a @onclick="() => banReporter(2)" href="javascript:void(0)">2h</a>
|
2023-02-13 17:45:14 +00:00
|
|
|
<span> </span>
|
2023-06-13 21:34:16 +00:00
|
|
|
<a @onclick="() => banReporter(1 * 24)" href="javascript:void(0)">1d</a>
|
2023-02-13 17:45:14 +00:00
|
|
|
<span> </span>
|
2023-06-13 21:34:16 +00:00
|
|
|
<a @onclick="() => banReporter(7 * 24)" href="javascript:void(0)">1w</a>
|
2023-02-13 17:45:14 +00:00
|
|
|
<span> </span>
|
2023-06-13 21:34:16 +00:00
|
|
|
<a @onclick="() => banReporter(31 * 24)" href="javascript:void(0)">1m</a>
|
|
|
|
<span> </span>
|
|
|
|
<a @onclick="() => banReporter(365 * 24)" href="javascript:void(0)">1yr</a>
|
2023-02-13 17:45:14 +00:00
|
|
|
<span> </span>
|
|
|
|
<br/>
|
2023-06-13 21:34:16 +00:00
|
|
|
<a @onclick="@removeReport" href="javascript:void(0)">Done</a>
|
2023-02-17 21:54:13 +00:00
|
|
|
<br/>
|
2023-02-13 17:45:14 +00:00
|
|
|
@if (report.Type == "op")
|
|
|
|
{
|
|
|
|
<Post post="report.ReportedPost" showOpenThread="true"></Post>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<Comment comment="report.ReportedComment"></Comment>
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
@code {
|
2023-06-13 21:34:16 +00:00
|
|
|
|
2023-02-13 17:45:14 +00:00
|
|
|
[Parameter]
|
|
|
|
[Required]
|
|
|
|
public ReportData report { get; set; }
|
2023-06-13 21:34:16 +00:00
|
|
|
|
|
|
|
|
2023-02-13 17:45:14 +00:00
|
|
|
private async Task banTarget(int days)
|
|
|
|
{
|
|
|
|
UserData user = report.UserReported;
|
2023-06-13 21:34:16 +00:00
|
|
|
user.TimeBanned = DateTimeOffset.Now.ToUnixTimeMilliseconds() + (days * 3600000);
|
|
|
|
user.BanReason = report.ReportReason;
|
2023-02-13 17:45:14 +00:00
|
|
|
await UsersRepository.updateUserAsync(user);
|
2023-02-17 21:54:13 +00:00
|
|
|
await removeReport();
|
2023-02-13 17:45:14 +00:00
|
|
|
}
|
2023-06-13 21:34:16 +00:00
|
|
|
|
2023-02-13 17:45:14 +00:00
|
|
|
private async Task banReporter(int days)
|
|
|
|
{
|
|
|
|
UserData user = report.UserReporter;
|
2023-06-13 21:34:16 +00:00
|
|
|
user.TimeBanned = DateTimeOffset.Now.ToUnixTimeMilliseconds() + (days * 3600000);
|
|
|
|
user.BanReason = "misuse of the report system";
|
2023-02-13 17:45:14 +00:00
|
|
|
await UsersRepository.updateUserAsync(user);
|
2023-02-17 21:54:13 +00:00
|
|
|
await removeReport();
|
|
|
|
}
|
|
|
|
|
|
|
|
private async Task removeReport()
|
|
|
|
{
|
|
|
|
await ReportsRepository.deleteReportAsync(report.ReportID);
|
2023-06-13 21:34:16 +00:00
|
|
|
navigationManager.NavigateTo("/sys/click/red/_sys_modmenu_reports", true, true);
|
2023-02-13 17:45:14 +00:00
|
|
|
}
|
2023-06-13 21:34:16 +00:00
|
|
|
|
2023-02-13 17:45:14 +00:00
|
|
|
}
|