From 7c13d51024c5e2de0d676e799682d7c6ae8dc11d Mon Sep 17 00:00:00 2001 From: Josh Date: Tue, 14 Jun 2022 01:43:28 -0500 Subject: [PATCH] Fix text wrap and symbols not being decoded (#324) --- .../Pages/Partials/SlotCardPartial.cshtml | 5 +++-- .../Pages/SlotPage.cshtml | 10 ++++------ ProjectLighthouse/PlayerData/Profiles/User.cs | 4 +++- ProjectLighthouse/StaticFiles/css/styles.css | 1 + 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ProjectLighthouse.Servers.Website/Pages/Partials/SlotCardPartial.cshtml b/ProjectLighthouse.Servers.Website/Pages/Partials/SlotCardPartial.cshtml index 371d5920..8a1766fb 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Partials/SlotCardPartial.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/Partials/SlotCardPartial.cshtml @@ -1,3 +1,4 @@ +@using System.Web @using LBPUnion.ProjectLighthouse @using LBPUnion.ProjectLighthouse.Configuration @using LBPUnion.ProjectLighthouse.PlayerData @@ -10,8 +11,8 @@ await using Database database = new(); - string slotName = string.IsNullOrEmpty(Model.Name) ? "Unnamed Level" : Model.Name; - + string slotName = HttpUtility.HtmlDecode(string.IsNullOrEmpty(Model!.Name) ? "Unnamed Level" : Model.Name); + bool isMobile = (bool?)ViewData["IsMobile"] ?? false; bool mini = (bool?)ViewData["IsMini"] ?? false; diff --git a/ProjectLighthouse.Servers.Website/Pages/SlotPage.cshtml b/ProjectLighthouse.Servers.Website/Pages/SlotPage.cshtml index 0722a616..55313d80 100644 --- a/ProjectLighthouse.Servers.Website/Pages/SlotPage.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/SlotPage.cshtml @@ -4,15 +4,14 @@ @using LBPUnion.ProjectLighthouse.Configuration @using LBPUnion.ProjectLighthouse.Extensions @using LBPUnion.ProjectLighthouse.PlayerData.Reviews -@using LBPUnion.ProjectLighthouse.Types @model LBPUnion.ProjectLighthouse.Servers.Website.Pages.SlotPage @{ Layout = "Layouts/BaseLayout"; Model.ShowTitleInPage = false; - Model.Title = Model.Slot?.Name ?? ""; - Model.Description = Model.Slot?.Description ?? ""; + Model.Title = HttpUtility.HtmlDecode(Model.Slot?.Name ?? ""); + Model.Description = HttpUtility.HtmlDecode(Model.Slot?.Description ?? ""); bool isMobile = this.Request.IsMobile(); } @@ -38,15 +37,14 @@

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)

Tags

@{ - string[] authorLabels = Model.Slot?.AuthorLabels.Split(",") ?? new string[] - {}; + string[] authorLabels = Model.Slot?.AuthorLabels.Split(",") ?? new string[]{}; if (authorLabels.Length == 1) // ..?? ok c# {

This level has no tags.

diff --git a/ProjectLighthouse/PlayerData/Profiles/User.cs b/ProjectLighthouse/PlayerData/Profiles/User.cs index e9842eeb..f70d1ee0 100644 --- a/ProjectLighthouse/PlayerData/Profiles/User.cs +++ b/ProjectLighthouse/PlayerData/Profiles/User.cs @@ -142,9 +142,11 @@ public class User [JsonIgnore] public string BannedReason { get; set; } - + + #nullable enable [JsonIgnore] public string? ApprovedIPAddress { get; set; } + #nullable disable public string Serialize(GameVersion gameVersion = GameVersion.LittleBigPlanet1) { diff --git a/ProjectLighthouse/StaticFiles/css/styles.css b/ProjectLighthouse/StaticFiles/css/styles.css index a944fcfe..ff7ee80d 100644 --- a/ProjectLighthouse/StaticFiles/css/styles.css +++ b/ProjectLighthouse/StaticFiles/css/styles.css @@ -27,6 +27,7 @@ canvas.hide-subjects { .card { display: flex; + overflow-wrap: anywhere; width: 100%; }