Revert "Display the latest announcement (if any) on the landing page"

This reverts commit a5ba5844f8.

Commit was intended for the `read-only` branch and was pushed to `main` in error.
This commit is contained in:
sudokoko 2024-03-28 13:42:05 -04:00
parent a5ba5844f8
commit 975fcab100
No known key found for this signature in database
GPG key ID: 248D68C664937395
2 changed files with 1 additions and 35 deletions

View file

@ -60,34 +60,7 @@
}
}
@if (Model.LatestAnnouncement != null)
{
<div class="ui blue segment" style="position: relative;">
<div>
<h3>@Model.LatestAnnouncement.Title</h3>
<div style="padding-bottom: 2em;">
<span style="white-space: pre-line">
@(Model.LatestAnnouncement.Content.Length > 250
? Model.LatestAnnouncement.Content[..250] + $"... [read more]({ServerConfiguration.Instance.ExternalUrl}/notifications)"
: Model.LatestAnnouncement.Content)
</span>
</div>
@if (Model.LatestAnnouncement.Publisher != null)
{
<div class="ui tiny bottom left attached label">
Posted by
<a style="color: black" href="~/user/@Model.LatestAnnouncement.Publisher.UserId">
@Model.LatestAnnouncement.Publisher.Username
</a>
</div>
}
</div>
</div>
}
else
{
<br /><br />
}
<br><br>
<div class="@(isMobile ? "" : "ui center aligned grid")">
<div class="eight wide column">

View file

@ -5,7 +5,6 @@ using LBPUnion.ProjectLighthouse.Helpers;
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<UserEntity> PlayersOnline = new();
public WebsiteAnnouncementEntity? LatestAnnouncement;
public LandingPage(DatabaseContext database) : base(database)
{ }
@ -57,10 +54,6 @@ public class LandingPage : BaseLayout
.Include(s => s.Creator)
.ToListAsync();
this.LatestAnnouncement = await this.Database.WebsiteAnnouncements.Include(a => a.Publisher)
.OrderByDescending(a => a.AnnouncementId)
.FirstOrDefaultAsync();
return this.Page();
}
}