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]
|
[Required]
|
||||||
public string Password { get; set; }
|
public string Password { get; set; }
|
||||||
|
|
||||||
[Required]
|
|
||||||
public int PermissionInteger { get; set; }
|
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public string Role { get; set; }
|
public string Role { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
Email = Email,
|
Email = Email,
|
||||||
Password = BCrypt.Net.BCrypt.HashPassword(Password),
|
Password = BCrypt.Net.BCrypt.HashPassword(Password),
|
||||||
Role = "User",
|
Role = "User",
|
||||||
PermissionInteger = 1,
|
|
||||||
TimeBanned = -1
|
TimeBanned = -1
|
||||||
};
|
};
|
||||||
if (await UsersRepository.getUserByEmailAsync(Email) != null)
|
if (await UsersRepository.getUserByEmailAsync(Email) != null)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
@page "/e/"
|
@page "/au/"
|
||||||
|
|
||||||
<Board board="@m"/>
|
<Board board="@m"/>
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
{
|
{
|
||||||
BoardID = 0,
|
BoardID = 0,
|
||||||
maxThreads = 10,
|
maxThreads = 10,
|
||||||
Tag = "e",
|
Tag = "au",
|
||||||
Topic = "Everything"
|
Topic = "Autism"
|
||||||
};
|
};
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
@page "/au/"
|
@page "/e/"
|
||||||
|
|
||||||
<Board board="@m"/>
|
<Board board="@m"/>
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
{
|
{
|
||||||
BoardID = 0,
|
BoardID = 0,
|
||||||
maxThreads = 10,
|
maxThreads = 10,
|
||||||
Tag = "au",
|
Tag = "e",
|
||||||
Topic = "Autism"
|
Topic = "Everything"
|
||||||
};
|
};
|
||||||
}
|
}
|
|
@ -107,7 +107,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasImage = selectedFile != null;
|
bool hasImage = selectedFile != null;
|
||||||
|
if (postUsername == null || postUsername == "")
|
||||||
|
{
|
||||||
|
postUsername = "Anonymous";
|
||||||
|
}
|
||||||
|
|
||||||
CommentData commentToCreate;
|
CommentData commentToCreate;
|
||||||
if (hasImage)
|
if (hasImage)
|
||||||
{
|
{
|
||||||
|
|
|
@ -137,6 +137,10 @@
|
||||||
ImageLocation = $"/img/dynamic/op/{@board.Tag}/{@file}"
|
ImageLocation = $"/img/dynamic/op/{@board.Tag}/{@file}"
|
||||||
};
|
};
|
||||||
int imageID = await ImagesRepository.createImageAsync(imageToUpload);
|
int imageID = await ImagesRepository.createImageAsync(imageToUpload);
|
||||||
|
if (postUsername == null || postUsername == "")
|
||||||
|
{
|
||||||
|
postUsername = "Anonymous";
|
||||||
|
}
|
||||||
var postToPost = new PostData
|
var postToPost = new PostData
|
||||||
{
|
{
|
||||||
UserID = userID,
|
UserID = userID,
|
||||||
|
|
|
@ -71,12 +71,26 @@
|
||||||
</div>
|
</div>
|
||||||
<AuthorizeView Roles="Admin, Mod">
|
<AuthorizeView Roles="Admin, Mod">
|
||||||
<Authorized>
|
<Authorized>
|
||||||
<span>[</span>
|
<span>[ </span>
|
||||||
<a onclick="@stickyMe()" href="javascript:void(0)">Sticky</a>
|
@if (post.IsSticky)
|
||||||
<span>]</span>
|
{
|
||||||
<span>[</span>
|
<a onclick="@stickyMe" href="javascript:void(0)">Unsticky</a>
|
||||||
<a onclick="@lockMe()" href="javascript:void(0)">Lock</a>
|
}
|
||||||
<span>]</span>
|
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>
|
</Authorized>
|
||||||
</AuthorizeView>
|
</AuthorizeView>
|
||||||
|
|
||||||
|
@ -85,7 +99,7 @@
|
||||||
<span>]</span>
|
<span>]</span>
|
||||||
<span>[</span>
|
<span>[</span>
|
||||||
<a class="report" href="/sys/report/op/@post.Board/@post.PostID" target="_blank">Report</a>
|
<a class="report" href="/sys/report/op/@post.Board/@post.PostID" target="_blank">Report</a>
|
||||||
<span>]</span>
|
<span>] </span>
|
||||||
@if (showOpenThread)
|
@if (showOpenThread)
|
||||||
{
|
{
|
||||||
<span>[</span>
|
<span>[</span>
|
||||||
|
@ -105,13 +119,13 @@
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
private async Task lockMe()
|
private async void lockMe()
|
||||||
{
|
{
|
||||||
post.IsLocked = !post.IsLocked;
|
post.IsLocked = !post.IsLocked;
|
||||||
await PostsRepository.updatePostAsync(post);
|
await PostsRepository.updatePostAsync(post);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task stickyMe()
|
private async void stickyMe()
|
||||||
{
|
{
|
||||||
post.IsSticky = !post.IsSticky;
|
post.IsSticky = !post.IsSticky;
|
||||||
await PostsRepository.updatePostAsync(post);
|
await PostsRepository.updatePostAsync(post);
|
||||||
|
|
|
@ -18,26 +18,26 @@
|
||||||
<span>Explaination: @report.ReportExlaination</span>
|
<span>Explaination: @report.ReportExlaination</span>
|
||||||
<br/>
|
<br/>
|
||||||
<span>Ban User: </span>
|
<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>
|
<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>
|
<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>
|
<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>
|
<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/>
|
<br/>
|
||||||
<span>Ban Reporter: </span>
|
<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>
|
<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>
|
<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>
|
<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>
|
<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/>
|
<br/>
|
||||||
<a @onclick="@removeReport" href="javascript:void(0)" >Done</a>
|
<a @onclick="@removeReport" href="javascript:void(0)" >Done</a>
|
||||||
<br/>
|
<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)
|
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)
|
public static async Task<List<PostData>> getPostList(string boardTag)
|
|
@ -17,4 +17,4 @@
|
||||||
@using ImageBoardServerApp.Shared
|
@using ImageBoardServerApp.Shared
|
||||||
@using ImageBoardServerApp.Shared.Components
|
@using ImageBoardServerApp.Shared.Components
|
||||||
@using ImageBoardServerApp.Shared.Components.Forms
|
@using ImageBoardServerApp.Shared.Components.Forms
|
||||||
@using ImageBoardServerApp.Data
|
@using ImageBoardServerApp.Data
|
Loading…
Reference in a new issue