diff --git a/ProjectLighthouse/Pages/LandingPage.cshtml b/ProjectLighthouse/Pages/LandingPage.cshtml index f320a553..312f9d1d 100644 --- a/ProjectLighthouse/Pages/LandingPage.cshtml +++ b/ProjectLighthouse/Pages/LandingPage.cshtml @@ -1,4 +1,5 @@ @page "/" +@using LBPUnion.ProjectLighthouse.Types @model LBPUnion.ProjectLighthouse.Pages.LandingPage @{ @@ -11,15 +12,23 @@
You are currently logged in as @Model.User.Username.
} -@if (Model.PlayersOnline == 1) +@if (Model.PlayersOnlineCount == 1) { -There is 1 user currently online.
+There is 1 user currently online:
+ @foreach (User user in Model.PlayersOnline) + { + @user.Username + } } -else if (Model.PlayersOnline == 0) +else if (Model.PlayersOnlineCount == 0) {There are no users online. Why not hop on?
} else { -There are currently @Model.PlayersOnline users online.
+There are currently @Model.PlayersOnlineCount users online:
+ @foreach (User user in Model.PlayersOnline) + { + @user.Username + } } \ No newline at end of file diff --git a/ProjectLighthouse/Pages/LandingPage.cshtml.cs b/ProjectLighthouse/Pages/LandingPage.cshtml.cs index 1edb223a..a9b452b5 100644 --- a/ProjectLighthouse/Pages/LandingPage.cshtml.cs +++ b/ProjectLighthouse/Pages/LandingPage.cshtml.cs @@ -1,9 +1,13 @@ #nullable enable +using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using JetBrains.Annotations; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Pages.Layouts; +using LBPUnion.ProjectLighthouse.Types; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; namespace LBPUnion.ProjectLighthouse.Pages { @@ -12,12 +16,17 @@ namespace LBPUnion.ProjectLighthouse.Pages public LandingPage(Database database) : base(database) {} - public int PlayersOnline; + public int PlayersOnlineCount; + public List