diff --git a/ProjectLighthouse/Pages/Partials/CommentsPartial.cshtml b/ProjectLighthouse/Pages/Partials/CommentsPartial.cshtml index c6114822..348db325 100644 --- a/ProjectLighthouse/Pages/Partials/CommentsPartial.cshtml +++ b/ProjectLighthouse/Pages/Partials/CommentsPartial.cshtml @@ -2,20 +2,7 @@ @using System.Web @using LBPUnion.ProjectLighthouse.Types.Profiles
There are no comments.
@@ -26,6 +13,11 @@ Comments are disabled. } + else + { + int count = Model.Comments.Count; +There @(count == 1 ? "is" : "are") @count comment@(count == 1 ? "" : "s").
+ } @if (Model.CommentsEnabled && Model.User != null) { diff --git a/ProjectLighthouse/Pages/SlotPage.cshtml b/ProjectLighthouse/Pages/SlotPage.cshtml index e668bb08..4e0153bd 100644 --- a/ProjectLighthouse/Pages/SlotPage.cshtml +++ b/ProjectLighthouse/Pages/SlotPage.cshtml @@ -1,6 +1,8 @@ @page "/slot/{id:int}" @using System.Web @using LBPUnion.ProjectLighthouse.Helpers.Extensions +@using LBPUnion.ProjectLighthouse.Types.Reviews +@using LBPUnion.ProjectLighthouse.Types.Settings @model LBPUnion.ProjectLighthouse.Pages.SlotPage @{ @@ -9,6 +11,8 @@ Model.Title = Model.Slot.Name; Model.Description = Model.Slot.Description; + + bool isMobile = this.Request.IsMobile(); } @await Html.PartialAsync("Partials/SlotCardPartial", Model.Slot, new ViewDataDictionary(ViewData) @@ -54,14 +58,84 @@ }There are no reviews.
+ } + else if (!Model.ReviewsEnabled) + { + + Reviews are disabled on this level. + + } + else + { + int count = Model.Reviews.Count; +There @(count == 1 ? "is" : "are") @count review@(count == 1 ? "" : "s").
+ } + -@await Html.PartialAsync("Partials/CommentsPartial") + @foreach (Review review in Model.Reviews) + { + string faceHash = review.Thumb switch { + -1 => review.Reviewer.BooHash, + 0 => review.Reviewer.MehHash, + 1 => review.Reviewer.YayHash, + + _ => throw new ArgumentOutOfRangeException(), + }; + + string faceAlt = review.Thumb switch { + -1 => "Boo!", + 0 => "Meh.", + 1 => "Yay!", + + _ => throw new ArgumentOutOfRangeException(), + }; + + int size = isMobile ? 50 : 100; + ++ This review contains no text. +
+ } + else + { +@review.Text
+ } +