Skip to content

Commit

Permalink
Revert "Display the latest announcement (if any) on the landing page"
Browse files Browse the repository at this point in the history
This reverts commit a5ba584.

Commit was intended for the `read-only` branch and was pushed to `main` in error.
  • Loading branch information
sudokoko committed Mar 28, 2024
1 parent a5ba584 commit 975fcab
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 35 deletions.
29 changes: 1 addition & 28 deletions ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
7 changes: 0 additions & 7 deletions ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
{ }

Expand Down Expand Up @@ -57,10 +54,6 @@ public async Task<IActionResult> OnGet()
.Include(s => s.Creator)
.ToListAsync();

this.LatestAnnouncement = await this.Database.WebsiteAnnouncements.Include(a => a.Publisher)
.OrderByDescending(a => a.AnnouncementId)
.FirstOrDefaultAsync();

return this.Page();
}
}

0 comments on commit 975fcab

Please sign in to comment.