From 975fcab100e6e66994ff9bf0a46a48604cb268ba Mon Sep 17 00:00:00 2001 From: sudokoko Date: Thu, 28 Mar 2024 13:42:05 -0400 Subject: [PATCH] Revert "Display the latest announcement (if any) on the landing page" This reverts commit a5ba5844f86babb7f7d5d0fa480bdfe40c9a6411. Commit was intended for the `read-only` branch and was pushed to `main` in error. --- .../Pages/LandingPage.cshtml | 29 +------------------ .../Pages/LandingPage.cshtml.cs | 7 ----- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml index 95c749163..903dbf0cb 100644 --- a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml @@ -60,34 +60,7 @@ } } -@if (Model.LatestAnnouncement != null) -{ -
-
-

@Model.LatestAnnouncement.Title

-
- - @(Model.LatestAnnouncement.Content.Length > 250 - ? Model.LatestAnnouncement.Content[..250] + $"... [read more]({ServerConfiguration.Instance.ExternalUrl}/notifications)" - : Model.LatestAnnouncement.Content) - -
- @if (Model.LatestAnnouncement.Publisher != null) - { - - } -
-
-} -else -{ -

-} +

diff --git a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs index 37edf44bd..f866557b3 100644 --- a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs +++ b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs @@ -5,7 +5,6 @@ using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types.Entities.Level; using LBPUnion.ProjectLighthouse.Types.Entities.Profile; -using LBPUnion.ProjectLighthouse.Types.Entities.Website; using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; @@ -20,8 +19,6 @@ public class LandingPage : BaseLayout public int PendingAuthAttempts; public List PlayersOnline = new(); - public WebsiteAnnouncementEntity? LatestAnnouncement; - public LandingPage(DatabaseContext database) : base(database) { } @@ -57,10 +54,6 @@ public async Task OnGet() .Include(s => s.Creator) .ToListAsync(); - this.LatestAnnouncement = await this.Database.WebsiteAnnouncements.Include(a => a.Publisher) - .OrderByDescending(a => a.AnnouncementId) - .FirstOrDefaultAsync(); - return this.Page(); } } \ No newline at end of file