Add ability to hide comments on levels and profiles

This commit is contained in:
jvyden 2022-08-06 14:23:37 -04:00
commit 8fe9bd4c57
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
12 changed files with 123 additions and 16 deletions

View file

@ -17,7 +17,7 @@ public class SlotPage : BaseLayout
public List<Review> Reviews = new();
public List<Photo> Photos = new();
public readonly bool CommentsEnabled = ServerConfiguration.Instance.UserGeneratedContentLimits.LevelCommentsEnabled;
public bool CommentsEnabled;
public readonly bool ReviewsEnabled = ServerConfiguration.Instance.UserGeneratedContentLimits.LevelReviewsEnabled;
public Slot? Slot;
@ -58,6 +58,7 @@ public class SlotPage : BaseLayout
this.Slot = slot;
this.CommentsEnabled = ServerConfiguration.Instance.UserGeneratedContentLimits.LevelCommentsEnabled && this.Slot.CommentsEnabled;
if (this.CommentsEnabled)
{
this.Comments = await this.Database.Comments.Include(p => p.Poster)