From 48a4202ba13b8b7d96371eabfad86f3172cd1c85 Mon Sep 17 00:00:00 2001 From: Slendy Date: Mon, 30 Oct 2023 15:53:51 -0500 Subject: [PATCH] Revert slug hotfix and change comment links to use relative urls --- .../Controllers/SlotPageController.cs | 2 +- .../Controllers/UserPageController.cs | 2 +- .../Pages/Partials/CommentsPartial.cshtml | 9 +++------ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/ProjectLighthouse.Servers.Website/Controllers/SlotPageController.cs b/ProjectLighthouse.Servers.Website/Controllers/SlotPageController.cs index ce4cabee..66eafbc0 100644 --- a/ProjectLighthouse.Servers.Website/Controllers/SlotPageController.cs +++ b/ProjectLighthouse.Servers.Website/Controllers/SlotPageController.cs @@ -18,7 +18,7 @@ using Microsoft.EntityFrameworkCore; namespace LBPUnion.ProjectLighthouse.Servers.Website.Controllers; [ApiController] -[Route("slot/{id:int}/{slug?}")] +[Route("slot/{id:int}")] public class SlotPageController : ControllerBase { private readonly DatabaseContext database; diff --git a/ProjectLighthouse.Servers.Website/Controllers/UserPageController.cs b/ProjectLighthouse.Servers.Website/Controllers/UserPageController.cs index 189c42a5..161bb1a8 100644 --- a/ProjectLighthouse.Servers.Website/Controllers/UserPageController.cs +++ b/ProjectLighthouse.Servers.Website/Controllers/UserPageController.cs @@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore; namespace LBPUnion.ProjectLighthouse.Servers.Website.Controllers; [ApiController] -[Route("user/{id:int}/{slug?}")] +[Route("user/{id:int}")] public class UserPageController : ControllerBase { private readonly DatabaseContext database; diff --git a/ProjectLighthouse.Servers.Website/Pages/Partials/CommentsPartial.cshtml b/ProjectLighthouse.Servers.Website/Pages/Partials/CommentsPartial.cshtml index aa986c03..4a2a9869 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Partials/CommentsPartial.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/Partials/CommentsPartial.cshtml @@ -31,7 +31,7 @@ @if (Model.CommentsEnabled && Model.User != null) {
-
+
@@ -52,9 +52,6 @@ DateTimeOffset timestamp = DateTimeOffset.FromUnixTimeSeconds(comment.Timestamp / 1000).ToLocalTime(); string decodedMessage = HttpUtility.HtmlDecode(comment.GetCommentMessage(Database)); - - string? url = Url.RouteUrl(ViewContext.RouteData.Values); - if (url == null) continue; int rating = comment.ThumbsUp - comment.ThumbsDown; @@ -67,11 +64,11 @@ } }
- + @(rating) - +