Add ability to hide levels

This commit is contained in:
jvyden 2022-08-05 21:34:43 -04:00
parent 0d7d8c25f3
commit ef6acbb210
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
11 changed files with 106 additions and 32 deletions

View file

@ -26,8 +26,7 @@ public class SlotPage : BaseLayout
public async Task<IActionResult> OnGet([FromRoute] int id)
{
Slot? slot = await this.Database.Slots.Include
(s => s.Creator)
Slot? slot = await this.Database.Slots.Include(s => s.Creator)
.Where(s => s.Type == SlotType.User)
.FirstOrDefaultAsync(s => s.SlotId == id);
if (slot == null) return this.NotFound();
@ -55,6 +54,8 @@ public class SlotPage : BaseLayout
}
}
if (slot.Hidden && (this.User != slot.Creator && !(bool)this.User?.IsModerator)) return this.NotFound();
this.Slot = slot;
if (this.CommentsEnabled)