feat: changed the language of the ReportEntrys to English, started to work on Board Locks, !removed PermissionInteger; as it was not needed anymore!

fix: minor bugfixes while posting & commenting, changed Au.razor and E.razor around
This commit is contained in:
limited_dev 2023-02-27 14:34:41 +01:00
parent 6881a5d009
commit 8ebc78b754
11 changed files with 59 additions and 32 deletions

View file

@ -28,9 +28,6 @@ public class UserData
[Required]
public string Password { get; set; }
[Required]
public int PermissionInteger { get; set; }
[Required]
public string Role { get; set; }

View file

@ -34,7 +34,6 @@
Email = Email,
Password = BCrypt.Net.BCrypt.HashPassword(Password),
Role = "User",
PermissionInteger = 1,
TimeBanned = -1
};
if (await UsersRepository.getUserByEmailAsync(Email) != null)

View file

@ -1,4 +1,4 @@
@page "/e/"
@page "/au/"
<Board board="@m"/>
@ -8,7 +8,7 @@
{
BoardID = 0,
maxThreads = 10,
Tag = "e",
Topic = "Everything"
Tag = "au",
Topic = "Autism"
};
}

View file

@ -1,4 +1,4 @@
@page "/au/"
@page "/e/"
<Board board="@m"/>
@ -8,7 +8,7 @@
{
BoardID = 0,
maxThreads = 10,
Tag = "au",
Topic = "Autism"
Tag = "e",
Topic = "Everything"
};
}

View file

@ -107,7 +107,11 @@
}
bool hasImage = selectedFile != null;
if (postUsername == null || postUsername == "")
{
postUsername = "Anonymous";
}
CommentData commentToCreate;
if (hasImage)
{

View file

@ -137,6 +137,10 @@
ImageLocation = $"/img/dynamic/op/{@board.Tag}/{@file}"
};
int imageID = await ImagesRepository.createImageAsync(imageToUpload);
if (postUsername == null || postUsername == "")
{
postUsername = "Anonymous";
}
var postToPost = new PostData
{
UserID = userID,

View file

@ -71,12 +71,26 @@
</div>
<AuthorizeView Roles="Admin, Mod">
<Authorized>
<span>[</span>
<a onclick="@stickyMe()" href="javascript:void(0)">Sticky</a>
<span>]</span>
<span>[</span>
<a onclick="@lockMe()" href="javascript:void(0)">Lock</a>
<span>]</span>
<span>[ </span>
@if (post.IsSticky)
{
<a onclick="@stickyMe" href="javascript:void(0)">Unsticky</a>
}
else
{
<a onclick="@stickyMe" href="javascript:void(0)">Sticky</a>
}
<span> ]</span>
<span>[ </span>
@if (post.IsLocked)
{
<a onclick="@lockMe" href="javascript:void(0)">Unlock</a>
}
else
{
<a onclick="@lockMe" href="javascript:void(0)">Lock</a>
}
<span> ]</span>
</Authorized>
</AuthorizeView>
@ -85,7 +99,7 @@
<span>]</span>
<span>[</span>
<a class="report" href="/sys/report/op/@post.Board/@post.PostID" target="_blank">Report</a>
<span>]</span>
<span>] </span>
@if (showOpenThread)
{
<span>[</span>
@ -105,13 +119,13 @@
@code {
private async Task lockMe()
private async void lockMe()
{
post.IsLocked = !post.IsLocked;
await PostsRepository.updatePostAsync(post);
}
private async Task stickyMe()
private async void stickyMe()
{
post.IsSticky = !post.IsSticky;
await PostsRepository.updatePostAsync(post);

View file

@ -18,26 +18,26 @@
<span>Explaination: @report.ReportExlaination</span>
<br/>
<span>Ban User: </span>
<a @onclick="() => banTarget(1)" href="javascript:void(0)">1 Tag</a>
<a @onclick="() => banTarget(1)" href="javascript:void(0)">1d</a>
<span> </span>
<a @onclick="() => banTarget(7)" href="javascript:void(0)">7 Tage</a>
<a @onclick="() => banTarget(7)" href="javascript:void(0)">1w</a>
<span> </span>
<a @onclick="() => banTarget(31)" href="javascript:void(0)">31 Tage</a>
<a @onclick="() => banTarget(31)" href="javascript:void(0)">1m</a>
<span> </span>
<a @onclick="() => banTarget(365)" href="javascript:void(0)">365 Tage</a>
<a @onclick="() => banTarget(365)" href="javascript:void(0)">1yr</a>
<span> </span>
<a @onclick="() => banTarget(99999999)" href="javascript:void(0)">99M Tage</a>
<a @onclick="() => banTarget(99999999)" href="javascript:void(0)">273,972.6 yrs</a>
<br/>
<span>Ban Reporter: </span>
<a @onclick="() => banReporter(1)" href="javascript:void(0)">1 Tag</a>
<a @onclick="() => banReporter(1)" href="javascript:void(0)">1d</a>
<span> </span>
<a @onclick="() => banReporter(7)" href="javascript:void(0)">7 Tage</a>
<a @onclick="() => banReporter(7)" href="javascript:void(0)">1w</a>
<span> </span>
<a @onclick="() => banReporter(31)" href="javascript:void(0)">31 Tage</a>
<a @onclick="() => banReporter(31)" href="javascript:void(0)">1m</a>
<span> </span>
<a @onclick="() => banReporter(365)" href="javascript:void(0)">365 Tage</a>
<a @onclick="() => banReporter(365)" href="javascript:void(0)">1yr</a>
<span> </span>
<a @onclick="() => banReporter(99999999)" href="javascript:void(0)">99M Tage</a>
<a @onclick="() => banReporter(99999999)" href="javascript:void(0)">273,972.6 yrs</a>
<br/>
<a @onclick="@removeReport" href="javascript:void(0)" >Done</a>
<br/>

View file

@ -0,0 +1,9 @@
namespace ImageBoardServerApp.Data;
public class Boards
{
private List<PostData> posts = new List<PostData>()
{
};
}

View file

@ -22,7 +22,7 @@ public class TheManager
public static long getBumpValue(PostData post)
{
return 10 * 60000 - getDiff(post) + ( 60000 * (post.Comments.Count + 1));
return (post.IsSticky ? 999999999999999999 : 10 * 60000 - getDiff(post) + ( 60000 * (post.Comments.Count + 1))) ;
}
public static async Task<List<PostData>> getPostList(string boardTag)

View file

@ -17,4 +17,4 @@
@using ImageBoardServerApp.Shared
@using ImageBoardServerApp.Shared.Components
@using ImageBoardServerApp.Shared.Components.Forms
@using ImageBoardServerApp.Data
@using ImageBoardServerApp.Data