From e29ca6cdcb314c08d8eed1d29a97bf40214518f4 Mon Sep 17 00:00:00 2001 From: sudokoko Date: Wed, 10 Jan 2024 19:32:47 -0500 Subject: [PATCH] Show rootlevel hash to moderators on slot page (#964) --- .../Pages/SlotPage.cshtml | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/ProjectLighthouse.Servers.Website/Pages/SlotPage.cshtml b/ProjectLighthouse.Servers.Website/Pages/SlotPage.cshtml index d42517e6a..12910436b 100644 --- a/ProjectLighthouse.Servers.Website/Pages/SlotPage.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/SlotPage.cshtml @@ -72,7 +72,9 @@ else

Description

-

@HttpUtility.HtmlDecode(string.IsNullOrEmpty(Model.Slot?.Description) ? "This level has no description." : Model.Slot.Description)

+

+ @HttpUtility.HtmlDecode(string.IsNullOrEmpty(Model.Slot?.Description) ? "This level has no description." : Model.Slot.Description) +

@if (isMobile) @@ -80,6 +82,18 @@ else
}
+ @if (Model.User != null && Model.User.IsModerator) + { +
+
+ Level Hash: + + @HttpUtility.HtmlDecode(string.IsNullOrWhiteSpace(Model.Slot?.RootLevel) ? "No root level." : Model.Slot.RootLevel) + +
+ You can see this because you are a moderator. +
+ }

Tags

@{ @@ -92,6 +106,7 @@ else { authorLabels = Model.Slot?.AuthorLabels.Split(",", StringSplitOptions.RemoveEmptyEntries) ?? Array.Empty(); } + if (authorLabels.Length == 0) {

This level has no tags.

@@ -227,7 +242,7 @@ else Delete
- + @if (!Model.Slot!.Hidden) { @@ -237,7 +252,7 @@ else
} - + @if (!Model.Slot!.InitiallyLocked && !Model.Slot!.LockedByModerator) { @@ -247,7 +262,7 @@ else } - + @if (Model.Slot!.CommentsEnabled) { @@ -284,7 +299,7 @@ function setVisible(e){ } // unhide content eTarget.style.display = ""; - + e.classList.add("active"); } @@ -303,7 +318,7 @@ if (selectedElement != null) { while (selectedElement != null && !selectedElement.classList.contains("lh-content")){ selectedElement = selectedElement.parentElement; } - + let sidebarEle = document.querySelector("[target=" + selectedElement.id + "]") setVisible(sidebarEle); }