mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-01 09:48:37 +00:00
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
commit
0471b02472
44 changed files with 631 additions and 505 deletions
|
@ -13,7 +13,7 @@ public class CasePage : BaseLayout
|
|||
public CasePage(Database database) : base(database)
|
||||
{}
|
||||
|
||||
public List<ModerationCase> Cases;
|
||||
public List<ModerationCase> Cases = new();
|
||||
public int CaseCount;
|
||||
public int DismissedCaseCount;
|
||||
|
||||
|
|
|
@ -12,16 +12,13 @@ public class FilterTestPage : BaseLayout
|
|||
|
||||
public string? FilteredText;
|
||||
public string? Text;
|
||||
|
||||
#if DEBUG
|
||||
public IActionResult OnGet(string? text = null)
|
||||
{
|
||||
#if !DEBUG
|
||||
return this.NotFound();
|
||||
#endif
|
||||
|
||||
if (text != null) this.FilteredText = CensorHelper.ScanMessage(text);
|
||||
this.Text = text;
|
||||
|
||||
return this.Page();
|
||||
}
|
||||
#endif
|
||||
}
|
|
@ -42,14 +42,14 @@ public class LandingPage : BaseLayout
|
|||
|
||||
const int maxShownLevels = 5;
|
||||
|
||||
this.LatestTeamPicks = await this.Database.Slots.Where(s => s.Type == SlotType.User && s.Type == SlotType.User)
|
||||
this.LatestTeamPicks = await this.Database.Slots.Where(s => s.Type == SlotType.User && !s.SubLevel)
|
||||
.Where(s => s.TeamPick)
|
||||
.OrderByDescending(s => s.FirstUploaded)
|
||||
.Take(maxShownLevels)
|
||||
.Include(s => s.Creator)
|
||||
.ToListAsync();
|
||||
|
||||
this.NewestLevels = await this.Database.Slots.Where(s => s.Type == SlotType.User && s.Type == SlotType.User)
|
||||
this.NewestLevels = await this.Database.Slots.Where(s => s.Type == SlotType.User && !s.SubLevel)
|
||||
.OrderByDescending(s => s.FirstUploaded)
|
||||
.Take(maxShownLevels)
|
||||
.Include(s => s.Creator)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
@using System.Globalization
|
||||
@using System.Web
|
||||
@using LBPUnion.ProjectLighthouse.Levels
|
||||
@using LBPUnion.ProjectLighthouse.PlayerData
|
||||
@model LBPUnion.ProjectLighthouse.PlayerData.Photo
|
||||
|
@ -25,7 +26,7 @@
|
|||
{
|
||||
case SlotType.User:
|
||||
<span>
|
||||
in level <b><a href="/slot/@Model.SlotId">@Model.Slot.Name</a></b>
|
||||
in level <b><a href="/slot/@Model.SlotId">@HttpUtility.HtmlDecode(Model.Slot.Name)</a></b>
|
||||
</span>
|
||||
break;
|
||||
case SlotType.Developer:
|
||||
|
|
|
@ -11,7 +11,7 @@ public class PirateSignupPage : BaseLayout
|
|||
public PirateSignupPage(Database database) : base(database)
|
||||
{}
|
||||
|
||||
public async Task<IActionResult> OnGet()
|
||||
public IActionResult OnGet()
|
||||
{
|
||||
User? user = this.Database.UserFromWebRequest(this.Request);
|
||||
if (user == null) return this.RedirectToPage("/login");
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
bool isMobile = this.Request.IsMobile();
|
||||
}
|
||||
|
||||
@if (Model.Slot.Hidden)
|
||||
@if (Model.Slot!.Hidden)
|
||||
{
|
||||
<div class="ui inverted red segment">
|
||||
<h2>This level is currently hidden.</h2>
|
||||
|
|
|
@ -54,7 +54,8 @@ public class SlotPage : BaseLayout
|
|||
}
|
||||
}
|
||||
|
||||
if (slot.Hidden && (this.User != slot.Creator && !(bool)this.User?.IsModerator)) return this.NotFound();
|
||||
if (slot.Hidden || slot.SubLevel && this.User == null && this.User != slot.Creator || !this.User!.IsModerator)
|
||||
return this.NotFound();
|
||||
|
||||
this.Slot = slot;
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ using LBPUnion.ProjectLighthouse.Levels;
|
|||
using LBPUnion.ProjectLighthouse.PlayerData;
|
||||
using LBPUnion.ProjectLighthouse.PlayerData.Profiles;
|
||||
using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts;
|
||||
using LBPUnion.ProjectLighthouse.Types;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
|
@ -49,7 +48,7 @@ public class SlotsPage : BaseLayout
|
|||
}
|
||||
else
|
||||
{
|
||||
finalSearch.Append(part);
|
||||
finalSearch.Append(part).Append(' ');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,6 +58,7 @@ public class SlotsPage : BaseLayout
|
|||
.Where(p => p.Type == SlotType.User && !p.Hidden)
|
||||
.Where(p => p.Name.Contains(finalSearch.ToString()))
|
||||
.Where(p => p.Creator != null && (targetAuthor == null || string.Equals(p.Creator.Username.ToLower(), targetAuthor.ToLower())))
|
||||
.Where(p => p.Creator != null && (!p.SubLevel || p.Creator == this.User))
|
||||
.Where(p => targetGame == null || p.GameVersion == targetGame)
|
||||
.CountAsync();
|
||||
|
||||
|
@ -71,6 +71,7 @@ public class SlotsPage : BaseLayout
|
|||
.Where(p => p.Type == SlotType.User && !p.Hidden)
|
||||
.Where(p => p.Name.Contains(finalSearch.ToString()))
|
||||
.Where(p => p.Creator != null && (targetAuthor == null || string.Equals(p.Creator.Username.ToLower(), targetAuthor.ToLower())))
|
||||
.Where(p => p.Creator != null && (!p.SubLevel || p.Creator == this.User))
|
||||
.Where(p => p.Creator!.LevelVisibility == PrivacyType.All) // TODO: change check for when user is logged in
|
||||
.Where(p => targetGame == null || p.GameVersion == targetGame)
|
||||
.OrderByDescending(p => p.FirstUploaded)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue