bulletboards/ImageBoardServerApp/Shared/Components/ReportEntry.razor
limited_dev dcc7634f5e feat: The posts are now sorted
fix: modmenu now checks for the permission, you now have to be 18yo to access the boards, images now get deleted when deleting threads / posts, fixed grammar error in the register page, other fixed which i forget
2023-02-13 18:45:14 +01:00

70 lines
No EOL
2.2 KiB
Text

@using System.ComponentModel.DataAnnotations
@using ImageBoardServerApp.Data.Repository
<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>
<a @onclick="() => banTarget(1)" href="javascript:void(0)">1 Tag</a>
<span> </span>
<a @onclick="() => banTarget(7)" href="javascript:void(0)">7 Tage</a>
<span> </span>
<a @onclick="() => banTarget(31)" href="javascript:void(0)">31 Tage</a>
<span> </span>
<a @onclick="() => banTarget(365)" href="javascript:void(0)">365 Tage</a>
<span> </span>
<a @onclick="() => banTarget(99999999)" href="javascript:void(0)">99M Tage</a>
<br/>
<span>Ban Reporter: </span>
<a @onclick="() => banReporter(1)" href="javascript:void(0)">1 Tag</a>
<span> </span>
<a @onclick="() => banReporter(7)" href="javascript:void(0)">7 Tage</a>
<span> </span>
<a @onclick="() => banReporter(31)" href="javascript:void(0)">31 Tage</a>
<span> </span>
<a @onclick="() => banReporter(365)" href="javascript:void(0)">365 Tage</a>
<span> </span>
<a @onclick="() => banReporter(99999999)" href="javascript:void(0)">99M Tage</a>
<br/>
@if (report.Type == "op")
{
<Post post="report.ReportedPost" showOpenThread="true"></Post>
}
else
{
<Comment comment="report.ReportedComment"></Comment>
}
</div>
@code {
[Parameter]
[Required]
public ReportData report { get; set; }
private async Task banTarget(int days)
{
UserData user = report.UserReported;
user.TimeBanned = DateTimeOffset.Now.AddDays(days).ToUnixTimeMilliseconds();
await UsersRepository.updateUserAsync(user);
}
private async Task banReporter(int days)
{
UserData user = report.UserReporter;
user.TimeBanned = DateTimeOffset.Now.AddDays(days).ToUnixTimeMilliseconds();
await UsersRepository.updateUserAsync(user);
}
}