@foreach (AdminPanelStatistic statistic in Model.Statistics)
{
@await Html.PartialAsync("Partials/AdminPanelStatisticPartial", statistic)
@@ -41,7 +41,7 @@ else
}
}
-
+
View Mod Panel
diff --git a/ProjectLighthouse.Servers.Website/Pages/Errors/NotFoundPage.cshtml b/ProjectLighthouse.Servers.Website/Pages/Errors/NotFoundPage.cshtml
new file mode 100644
index 00000000..ae9af46d
--- /dev/null
+++ b/ProjectLighthouse.Servers.Website/Pages/Errors/NotFoundPage.cshtml
@@ -0,0 +1,11 @@
+@page "/404"
+@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.Errors.NotFoundPage
+
+@{
+ Layout = "Layouts/BaseLayout";
+ Model.Title = "Not Found";
+ Model.Description = "The page was not found.";
+}
+
+
@Model.Description
+
This may be due to a lack of permission such as not being signed in, or maybe the page just isn't there.
diff --git a/ProjectLighthouse.Servers.Website/Pages/Errors/NotFoundPage.cshtml.cs b/ProjectLighthouse.Servers.Website/Pages/Errors/NotFoundPage.cshtml.cs
new file mode 100644
index 00000000..a1d72fc4
--- /dev/null
+++ b/ProjectLighthouse.Servers.Website/Pages/Errors/NotFoundPage.cshtml.cs
@@ -0,0 +1,15 @@
+using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+
+namespace LBPUnion.ProjectLighthouse.Servers.Website.Pages.Errors;
+
+public class NotFoundPage : BaseLayout
+{
+ public NotFoundPage(Database database) : base(database)
+ {}
+
+ public void OnGet()
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml
index 60dbddf0..22f6a763 100644
--- a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml
+++ b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml
@@ -4,14 +4,19 @@
@using LBPUnion.ProjectLighthouse.PlayerData.Profiles
@using LBPUnion.ProjectLighthouse.Levels
@using LBPUnion.ProjectLighthouse.Localization.StringLists
+@using LBPUnion.ProjectLighthouse.Servers.Website.Extensions
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.LandingPage
@{
Layout = "Layouts/BaseLayout";
Model.ShowTitleInPage = false;
+
bool isMobile = this.Request.IsMobile();
+ string language = Model.GetLanguage();
}
-
@Model.Translate(LandingPageStrings.Welcome, ServerConfiguration.Instance.Customization.ServerName)
+
+ @Model.Translate(LandingPageStrings.Welcome, ServerConfiguration.Instance.Customization.ServerName)
+
@if (Model.User != null)
{
@@ -24,25 +29,26 @@
}
}
-@if (Model.PlayersOnlineCount == 1)
+@if (Model.PlayersOnline.Count == 1)
{
@Model.Translate(LandingPageStrings.UsersSingle)
- @foreach (User user in Model.PlayersOnline)
- {
-
@user.Username
- }
}
-else if (Model.PlayersOnlineCount == 0)
+else if (Model.PlayersOnline.Count == 0)
{
@Model.Translate(LandingPageStrings.UsersNone)
}
else
{
-
@Model.Translate(LandingPageStrings.UsersMultiple, Model.PlayersOnlineCount)
- @foreach (User user in Model.PlayersOnline)
+
@Model.Translate(LandingPageStrings.UsersMultiple, Model.PlayersOnline.Count)
+}
+
+@{
+ int i = 0;
+ foreach (User user in Model.PlayersOnline)
{
-
@user.Username
+ i++;
+ @await user.ToLink(Html, ViewData, language)if (i != Model.PlayersOnline.Count){
,} @* whitespace has forced my hand *@
}
}
@@ -50,8 +56,8 @@ else
-
-
@Model.Translate(LandingPageStrings.LatestTeamPicks)
+
+
@Model.Translate(LandingPageStrings.LatestTeamPicks)
@foreach (Slot slot in Model.LatestTeamPicks!) @* Can't reach a point where this is null *@
@@ -67,8 +73,8 @@ else
}
-
-
@Model.Translate(LandingPageStrings.NewestLevels)
+
+
@Model.Translate(LandingPageStrings.NewestLevels)
@foreach (Slot slot in Model.NewestLevels!) @* Can't reach a point where this is null *@
diff --git a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs
index db99fd84..f9ad4b07 100644
--- a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs
+++ b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs
@@ -18,8 +18,6 @@ public class LandingPage : BaseLayout
public int PendingAuthAttempts;
public List
PlayersOnline = new();
- public int PlayersOnlineCount;
-
public List? LatestTeamPicks;
public List? NewestLevels;
@@ -29,8 +27,6 @@ public class LandingPage : BaseLayout
User? user = this.Database.UserFromWebRequest(this.Request);
if (user != null && user.PasswordResetRequired) return this.Redirect("~/passwordResetRequired");
- this.PlayersOnlineCount = await StatisticsHelper.RecentMatches();
-
if (user != null)
this.PendingAuthAttempts = await this.Database.AuthenticationAttempts.Include
(a => a.GameToken)
diff --git a/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml b/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml
index 8cd56d17..cad582bc 100644
--- a/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml
+++ b/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml
@@ -6,7 +6,7 @@
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts.BaseLayout
@{
- if (Model!.User == null)
+ if (Model.User == null)
{
Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderLoginRegister, "/login", "sign in"));
}
@@ -16,30 +16,22 @@
{
Model.NavigationItems.Add(new PageNavigationItem(BaseLayoutStrings.HeaderAuthentication, "/authentication", "key"));
}
- Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderProfile, "/user/" + Model.User.UserId, "user alternate"));
@if (Model.User.IsAdmin)
{
- Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderAdminPanel, "/admin", "cogs"));
+ Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderAdminPanel, "/admin", "wrench", "yellow"));
}
else if (Model.User.IsModerator)
{
- Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderModPanel, "/moderation", "user shield"));
+ Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderModPanel, "/moderation", "user shield", "green"));
}
- Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderLogout, "/logout", "user alternate slash")); // should always be last
}
Model.IsMobile = Model.Request.IsMobile();
- string title;
- if (Model.Title == string.Empty)
- {
- title = ServerConfiguration.Instance.Customization.ServerName;
- }
- else
- {
- title = $"{Model.Title} - {ServerConfiguration.Instance.Customization.ServerName}";
- }
+ string title = Model.Title == string.Empty
+ ? ServerConfiguration.Instance.Customization.ServerName
+ : $"{Model.Title} - {ServerConfiguration.Instance.Customization.ServerName}";
}
@@ -48,7 +40,7 @@
@title
-
+
@* Favicon *@
@@ -85,37 +77,56 @@