From 0279df06fac4b8bfd5a1a5ba23006f7d1ce8a0e4 Mon Sep 17 00:00:00 2001 From: limited_dev Date: Sun, 12 Feb 2023 17:01:46 +0100 Subject: [PATCH] feat: added /sys/ to all system pages, edited 404 page, added deadlink, moar changes --- ImageBoardServerApp/App.razor | 8 +++++-- .../Pages/Accounts/Banned.razor | 2 +- .../Pages/Accounts/Login.razor | 2 +- .../Pages/Accounts/Register.razor | 2 +- .../Pages/Accounts/UserPage.razor | 6 +++++ .../Pages/Basic/DeadLink.razor | 10 ++++++++ .../Pages/Basic/DeadLink.razor.css | 7 ++++++ ImageBoardServerApp/Pages/Basic/FAQ.razor | 2 +- ImageBoardServerApp/Pages/Basic/Rules.razor | 2 +- .../Pages/Components/ReportPage.razor | 2 +- .../Pages/Moderation/ModMenu.razor | 11 ++++----- .../Pages/Moderation/ReportsPage.razor | 22 ++++++++++++------ .../Pages/Moderation/UsersPage.razor | 13 ++++++++--- .../Pages/Status/SuccessfulPost.razor | 2 +- .../Pages/Status/UnSuccessfulPost.razor | 2 +- .../Shared/Components/Board.razor | 18 ++++++++++---- .../Shared/Components/Comment.razor | 2 +- .../Shared/Components/Forms/CommentForm.razor | 4 ++-- .../Shared/Components/Forms/FormInfo.razor | 4 ++-- .../Shared/Components/Forms/PostForm.razor | 2 +- .../Shared/Components/Post.razor | 2 +- ImageBoardServerApp/Shared/MainLayout.razor | 4 ++-- ImageBoardServerApp/Shared/NavMenu.razor | 2 +- .../wwwroot/img/static/deadlink/1.png | Bin 0 -> 198210 bytes 24 files changed, 90 insertions(+), 41 deletions(-) create mode 100644 ImageBoardServerApp/Pages/Accounts/UserPage.razor create mode 100644 ImageBoardServerApp/Pages/Basic/DeadLink.razor create mode 100644 ImageBoardServerApp/Pages/Basic/DeadLink.razor.css create mode 100644 ImageBoardServerApp/wwwroot/img/static/deadlink/1.png diff --git a/ImageBoardServerApp/App.razor b/ImageBoardServerApp/App.razor index 81642f6..95375bd 100644 --- a/ImageBoardServerApp/App.razor +++ b/ImageBoardServerApp/App.razor @@ -9,8 +9,12 @@

404

- noimageFound -

Sorry, nothing found. Please go back to the main page. Or watch the tree and find the hidden Cat..

+ noimageFound +

Sorry, nothing found.

+
+ Please go back to the main page. +
+

Or watch the tree and find the hidden Cat..

diff --git a/ImageBoardServerApp/Pages/Accounts/Banned.razor b/ImageBoardServerApp/Pages/Accounts/Banned.razor index 563a027..8f405a0 100644 --- a/ImageBoardServerApp/Pages/Accounts/Banned.razor +++ b/ImageBoardServerApp/Pages/Accounts/Banned.razor @@ -1,4 +1,4 @@ -@page "/banned" +@page "/sys/banned"

Banned

diff --git a/ImageBoardServerApp/Pages/Accounts/Login.razor b/ImageBoardServerApp/Pages/Accounts/Login.razor index 801eec0..28bc4cb 100644 --- a/ImageBoardServerApp/Pages/Accounts/Login.razor +++ b/ImageBoardServerApp/Pages/Accounts/Login.razor @@ -1,4 +1,4 @@ -@page "/login" +@page "/sys/login" @using ImageBoardServerApp.Data.Repository @using ImageBoardServerApp.Auth @inject IJSRuntime js diff --git a/ImageBoardServerApp/Pages/Accounts/Register.razor b/ImageBoardServerApp/Pages/Accounts/Register.razor index a874fc1..b84c7a5 100644 --- a/ImageBoardServerApp/Pages/Accounts/Register.razor +++ b/ImageBoardServerApp/Pages/Accounts/Register.razor @@ -1,4 +1,4 @@ -@page "/register" +@page "/sys/register" @using ImageBoardServerApp.Data.Repository @using ImageBoardServerApp.Auth @inject IJSRuntime js diff --git a/ImageBoardServerApp/Pages/Accounts/UserPage.razor b/ImageBoardServerApp/Pages/Accounts/UserPage.razor new file mode 100644 index 0000000..289c167 --- /dev/null +++ b/ImageBoardServerApp/Pages/Accounts/UserPage.razor @@ -0,0 +1,6 @@ +@page "/sys/you" +

UserPage

+ +@code { + +} \ No newline at end of file diff --git a/ImageBoardServerApp/Pages/Basic/DeadLink.razor b/ImageBoardServerApp/Pages/Basic/DeadLink.razor new file mode 100644 index 0000000..5338455 --- /dev/null +++ b/ImageBoardServerApp/Pages/Basic/DeadLink.razor @@ -0,0 +1,10 @@ +@page "/sys/dead" +

DeadLink

+Img is dead as well +This link is dead. +
+Return home + +@code { + +} \ No newline at end of file diff --git a/ImageBoardServerApp/Pages/Basic/DeadLink.razor.css b/ImageBoardServerApp/Pages/Basic/DeadLink.razor.css new file mode 100644 index 0000000..71d18f2 --- /dev/null +++ b/ImageBoardServerApp/Pages/Basic/DeadLink.razor.css @@ -0,0 +1,7 @@ +.deadlink{ + justify-content: center; + display: block; + margin-left: auto; + margin-right: auto; + width: 50%; +} \ No newline at end of file diff --git a/ImageBoardServerApp/Pages/Basic/FAQ.razor b/ImageBoardServerApp/Pages/Basic/FAQ.razor index e889408..abd8401 100644 --- a/ImageBoardServerApp/Pages/Basic/FAQ.razor +++ b/ImageBoardServerApp/Pages/Basic/FAQ.razor @@ -1,4 +1,4 @@ -@page "/faq" +@page "/sys/faq"

FAQ

@code { diff --git a/ImageBoardServerApp/Pages/Basic/Rules.razor b/ImageBoardServerApp/Pages/Basic/Rules.razor index 0312696..21ca8e6 100644 --- a/ImageBoardServerApp/Pages/Basic/Rules.razor +++ b/ImageBoardServerApp/Pages/Basic/Rules.razor @@ -1,4 +1,4 @@ -@page "/rules" +@page "/sys/rules"

Rules

diff --git a/ImageBoardServerApp/Pages/Components/ReportPage.razor b/ImageBoardServerApp/Pages/Components/ReportPage.razor index 2c2ea70..dbb8d43 100644 --- a/ImageBoardServerApp/Pages/Components/ReportPage.razor +++ b/ImageBoardServerApp/Pages/Components/ReportPage.razor @@ -1,4 +1,4 @@ -@page "/report/{type}/{board}/{id}" +@page "/sys/report/{type}/{board}/{id}" @using System.ComponentModel.DataAnnotations @using System.Data @using ImageBoardServerApp.Auth diff --git a/ImageBoardServerApp/Pages/Moderation/ModMenu.razor b/ImageBoardServerApp/Pages/Moderation/ModMenu.razor index ed7579a..ad3edd2 100644 --- a/ImageBoardServerApp/Pages/Moderation/ModMenu.razor +++ b/ImageBoardServerApp/Pages/Moderation/ModMenu.razor @@ -1,20 +1,19 @@ -@page "/modmenu" +@page "/sys/modmenu" @using ImageBoardServerApp.Auth @inject AuthenticationStateProvider authStateProvider @inject NavigationManager navManager - -

ModMenu

+

ModMenu

Welcome @mail to the mod menu
- [Reports] - [Users] + [Reports] + [Users]
- You do not have permission to view this menu. +
@code { diff --git a/ImageBoardServerApp/Pages/Moderation/ReportsPage.razor b/ImageBoardServerApp/Pages/Moderation/ReportsPage.razor index 6fd8ae8..7c68791 100644 --- a/ImageBoardServerApp/Pages/Moderation/ReportsPage.razor +++ b/ImageBoardServerApp/Pages/Moderation/ReportsPage.razor @@ -1,11 +1,19 @@ -@page "/modmenu/reports" +@page "/sys/reports" @using ImageBoardServerApp.Data.Repository -

Reports

-@foreach (var r in reports) -{ - -
-} + + +

Reports

+ @foreach (var r in reports) + { + +
+ } +
+ + + +
+ @code { private List reports; diff --git a/ImageBoardServerApp/Pages/Moderation/UsersPage.razor b/ImageBoardServerApp/Pages/Moderation/UsersPage.razor index 871b4c0..9889cc3 100644 --- a/ImageBoardServerApp/Pages/Moderation/UsersPage.razor +++ b/ImageBoardServerApp/Pages/Moderation/UsersPage.razor @@ -1,6 +1,13 @@ -@page "/modmenu/users" -

UsersPage

- +@page "/sys/users" + + +

Users

+ +
+ + + +
@code { } \ No newline at end of file diff --git a/ImageBoardServerApp/Pages/Status/SuccessfulPost.razor b/ImageBoardServerApp/Pages/Status/SuccessfulPost.razor index 6434c87..76b8fb5 100644 --- a/ImageBoardServerApp/Pages/Status/SuccessfulPost.razor +++ b/ImageBoardServerApp/Pages/Status/SuccessfulPost.razor @@ -1,4 +1,4 @@ -@page "/SuccessfulPost" +@page "/sys/SuccessfulPost"

SuccessfulPost

Post sucessfully crated! diff --git a/ImageBoardServerApp/Pages/Status/UnSuccessfulPost.razor b/ImageBoardServerApp/Pages/Status/UnSuccessfulPost.razor index 0315869..29aa714 100644 --- a/ImageBoardServerApp/Pages/Status/UnSuccessfulPost.razor +++ b/ImageBoardServerApp/Pages/Status/UnSuccessfulPost.razor @@ -1,4 +1,4 @@ -@page "/UnSuccessfulPost" +@page "/sys/UnSuccessfulPost"

UnuccessfulPost

Post was not created! diff --git a/ImageBoardServerApp/Shared/Components/Board.razor b/ImageBoardServerApp/Shared/Components/Board.razor index 86780e8..3da6734 100644 --- a/ImageBoardServerApp/Shared/Components/Board.razor +++ b/ImageBoardServerApp/Shared/Components/Board.razor @@ -16,15 +16,23 @@

Threads


- -@if (posts.Any()) +@if (posts != null) { - @foreach(var post in posts) + @if (posts.Any()) { - -
+ @foreach(var post in posts) + { + +
+ } } } +else +{ +

+ Loading Posts... +

+} @code { diff --git a/ImageBoardServerApp/Shared/Components/Comment.razor b/ImageBoardServerApp/Shared/Components/Comment.razor index 1225ce6..34b85cf 100644 --- a/ImageBoardServerApp/Shared/Components/Comment.razor +++ b/ImageBoardServerApp/Shared/Components/Comment.razor @@ -44,7 +44,7 @@ Delete ] [ - Report + Report ] } diff --git a/ImageBoardServerApp/Shared/Components/Forms/CommentForm.razor b/ImageBoardServerApp/Shared/Components/Forms/CommentForm.razor index 90bf2c6..fd66fbd 100644 --- a/ImageBoardServerApp/Shared/Components/Forms/CommentForm.razor +++ b/ImageBoardServerApp/Shared/Components/Forms/CommentForm.razor @@ -90,7 +90,7 @@ //Maybe redirect to /banned? return; } - foundusr.lastActionTimeStamp = DateTimeOffset.UnixEpoch.ToUnixTimeMilliseconds(); + foundusr.lastActionTimeStamp = DateTimeOffset.Now.ToUnixTimeMilliseconds(); await UsersRepository.updateUserAsync(foundusr); bool hasImage = selectedFile != null; @@ -141,7 +141,7 @@ if (commentId == -1) { //Open comment unsucessfull - navigationManager.NavigateTo("/UnSuccessfulPost"); + navigationManager.NavigateTo("/sys/UnSuccessfulPost"); hasErr = true; postErr = "There was an error and the comment could not be created. Please notify the admin."; Console.WriteLine("Shit sucks and did not work."); diff --git a/ImageBoardServerApp/Shared/Components/Forms/FormInfo.razor b/ImageBoardServerApp/Shared/Components/Forms/FormInfo.razor index 0e4b85e..e1b7279 100644 --- a/ImageBoardServerApp/Shared/Components/Forms/FormInfo.razor +++ b/ImageBoardServerApp/Shared/Components/Forms/FormInfo.razor @@ -5,9 +5,9 @@
Read the - rules + rules and - faq + faq before posting
\ No newline at end of file diff --git a/ImageBoardServerApp/Shared/Components/Forms/PostForm.razor b/ImageBoardServerApp/Shared/Components/Forms/PostForm.razor index cf54db9..a46475c 100644 --- a/ImageBoardServerApp/Shared/Components/Forms/PostForm.razor +++ b/ImageBoardServerApp/Shared/Components/Forms/PostForm.razor @@ -105,7 +105,7 @@ //Maybe redirect to /banned? return; } - foundusr.lastActionTimeStamp = DateTimeOffset.UnixEpoch.ToUnixTimeMilliseconds(); + foundusr.lastActionTimeStamp = DateTimeOffset.Now.ToUnixTimeMilliseconds(); await UsersRepository.updateUserAsync(foundusr); diff --git a/ImageBoardServerApp/Shared/Components/Post.razor b/ImageBoardServerApp/Shared/Components/Post.razor index 2e493a2..cfe73fe 100644 --- a/ImageBoardServerApp/Shared/Components/Post.razor +++ b/ImageBoardServerApp/Shared/Components/Post.razor @@ -52,7 +52,7 @@ Delete ] [ - Report + Report ] @if (showOpenThread) { diff --git a/ImageBoardServerApp/Shared/MainLayout.razor b/ImageBoardServerApp/Shared/MainLayout.razor index 08c1d5a..25cde22 100644 --- a/ImageBoardServerApp/Shared/MainLayout.razor +++ b/ImageBoardServerApp/Shared/MainLayout.razor @@ -13,8 +13,8 @@
diff --git a/ImageBoardServerApp/Shared/NavMenu.razor b/ImageBoardServerApp/Shared/NavMenu.razor index e6442da..e1497d3 100644 --- a/ImageBoardServerApp/Shared/NavMenu.razor +++ b/ImageBoardServerApp/Shared/NavMenu.razor @@ -10,7 +10,7 @@ [Logout] - [Login] + [Login]