mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-16 10:11:28 +00:00
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:
parent
a5ba5844f8
commit
975fcab100
2 changed files with 1 additions and 35 deletions
|
@ -60,34 +60,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (Model.LatestAnnouncement != null)
|
<br><br>
|
||||||
{
|
|
||||||
<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 />
|
|
||||||
}
|
|
||||||
|
|
||||||
<div class="@(isMobile ? "" : "ui center aligned grid")">
|
<div class="@(isMobile ? "" : "ui center aligned grid")">
|
||||||
<div class="eight wide column">
|
<div class="eight wide column">
|
||||||
|
|
|
@ -5,7 +5,6 @@ using LBPUnion.ProjectLighthouse.Helpers;
|
||||||
using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts;
|
using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts;
|
||||||
using LBPUnion.ProjectLighthouse.Types.Entities.Level;
|
using LBPUnion.ProjectLighthouse.Types.Entities.Level;
|
||||||
using LBPUnion.ProjectLighthouse.Types.Entities.Profile;
|
using LBPUnion.ProjectLighthouse.Types.Entities.Profile;
|
||||||
using LBPUnion.ProjectLighthouse.Types.Entities.Website;
|
|
||||||
using LBPUnion.ProjectLighthouse.Types.Levels;
|
using LBPUnion.ProjectLighthouse.Types.Levels;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
@ -20,8 +19,6 @@ public class LandingPage : BaseLayout
|
||||||
public int PendingAuthAttempts;
|
public int PendingAuthAttempts;
|
||||||
public List<UserEntity> PlayersOnline = new();
|
public List<UserEntity> PlayersOnline = new();
|
||||||
|
|
||||||
public WebsiteAnnouncementEntity? LatestAnnouncement;
|
|
||||||
|
|
||||||
public LandingPage(DatabaseContext database) : base(database)
|
public LandingPage(DatabaseContext database) : base(database)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
@ -57,10 +54,6 @@ public class LandingPage : BaseLayout
|
||||||
.Include(s => s.Creator)
|
.Include(s => s.Creator)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
this.LatestAnnouncement = await this.Database.WebsiteAnnouncements.Include(a => a.Publisher)
|
|
||||||
.OrderByDescending(a => a.AnnouncementId)
|
|
||||||
.FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
return this.Page();
|
return this.Page();
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue