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:
parent
6881a5d009
commit
8ebc78b754
11 changed files with 59 additions and 32 deletions
|
@ -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; }
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
Email = Email,
|
||||
Password = BCrypt.Net.BCrypt.HashPassword(Password),
|
||||
Role = "User",
|
||||
PermissionInteger = 1,
|
||||
TimeBanned = -1
|
||||
};
|
||||
if (await UsersRepository.getUserByEmailAsync(Email) != null)
|
||||
|
|
|
@ -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"
|
||||
};
|
||||
}
|
|
@ -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"
|
||||
};
|
||||
}
|
|
@ -107,7 +107,11 @@
|
|||
}
|
||||
|
||||
bool hasImage = selectedFile != null;
|
||||
|
||||
if (postUsername == null || postUsername == "")
|
||||
{
|
||||
postUsername = "Anonymous";
|
||||
}
|
||||
|
||||
CommentData commentToCreate;
|
||||
if (hasImage)
|
||||
{
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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/>
|
||||
|
|
9
ImageBoardServerApp/Util/Boards.cs
Normal file
9
ImageBoardServerApp/Util/Boards.cs
Normal file
|
@ -0,0 +1,9 @@
|
|||
namespace ImageBoardServerApp.Data;
|
||||
|
||||
public class Boards
|
||||
{
|
||||
private List<PostData> posts = new List<PostData>()
|
||||
{
|
||||
|
||||
};
|
||||
}
|
|
@ -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)
|
|
@ -17,4 +17,4 @@
|
|||
@using ImageBoardServerApp.Shared
|
||||
@using ImageBoardServerApp.Shared.Components
|
||||
@using ImageBoardServerApp.Shared.Components.Forms
|
||||
@using ImageBoardServerApp.Data
|
||||
@using ImageBoardServerApp.Data
|
Loading…
Reference in a new issue