Fix text wrap and symbols not being decoded (#324)

This commit is contained in:
Josh 2022-06-14 01:43:28 -05:00 committed by GitHub
commit 7c13d51024
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 9 deletions

View file

@ -1,3 +1,4 @@
@using System.Web
@using LBPUnion.ProjectLighthouse @using LBPUnion.ProjectLighthouse
@using LBPUnion.ProjectLighthouse.Configuration @using LBPUnion.ProjectLighthouse.Configuration
@using LBPUnion.ProjectLighthouse.PlayerData @using LBPUnion.ProjectLighthouse.PlayerData
@ -10,7 +11,7 @@
await using Database database = new(); 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 isMobile = (bool?)ViewData["IsMobile"] ?? false;
bool mini = (bool?)ViewData["IsMini"] ?? false; bool mini = (bool?)ViewData["IsMini"] ?? false;

View file

@ -4,15 +4,14 @@
@using LBPUnion.ProjectLighthouse.Configuration @using LBPUnion.ProjectLighthouse.Configuration
@using LBPUnion.ProjectLighthouse.Extensions @using LBPUnion.ProjectLighthouse.Extensions
@using LBPUnion.ProjectLighthouse.PlayerData.Reviews @using LBPUnion.ProjectLighthouse.PlayerData.Reviews
@using LBPUnion.ProjectLighthouse.Types
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.SlotPage @model LBPUnion.ProjectLighthouse.Servers.Website.Pages.SlotPage
@{ @{
Layout = "Layouts/BaseLayout"; Layout = "Layouts/BaseLayout";
Model.ShowTitleInPage = false; Model.ShowTitleInPage = false;
Model.Title = Model.Slot?.Name ?? ""; Model.Title = HttpUtility.HtmlDecode(Model.Slot?.Name ?? "");
Model.Description = Model.Slot?.Description ?? ""; Model.Description = HttpUtility.HtmlDecode(Model.Slot?.Description ?? "");
bool isMobile = this.Request.IsMobile(); bool isMobile = this.Request.IsMobile();
} }
@ -38,15 +37,14 @@
<div class="eight wide column"> <div class="eight wide column">
<div class="ui blue segment"> <div class="ui blue segment">
<h2>Description</h2> <h2>Description</h2>
<p>@HttpUtility.HtmlDecode(string.IsNullOrEmpty(Model.Slot?.Description) ? "This level has no description." : Model.Slot.Description)</p> <p style="overflow-wrap: anywhere">@HttpUtility.HtmlDecode(string.IsNullOrEmpty(Model.Slot?.Description) ? "This level has no description." : Model.Slot.Description)</p>
</div> </div>
</div> </div>
<div class="eight wide column"> <div class="eight wide column">
<div class="ui red segment"> <div class="ui red segment">
<h2>Tags</h2> <h2>Tags</h2>
@{ @{
string[] authorLabels = Model.Slot?.AuthorLabels.Split(",") ?? new string[] string[] authorLabels = Model.Slot?.AuthorLabels.Split(",") ?? new string[]{};
{};
if (authorLabels.Length == 1) // ..?? ok c# if (authorLabels.Length == 1) // ..?? ok c#
{ {
<p>This level has no tags.</p> <p>This level has no tags.</p>

View file

@ -143,8 +143,10 @@ public class User
[JsonIgnore] [JsonIgnore]
public string BannedReason { get; set; } public string BannedReason { get; set; }
#nullable enable
[JsonIgnore] [JsonIgnore]
public string? ApprovedIPAddress { get; set; } public string? ApprovedIPAddress { get; set; }
#nullable disable
public string Serialize(GameVersion gameVersion = GameVersion.LittleBigPlanet1) public string Serialize(GameVersion gameVersion = GameVersion.LittleBigPlanet1)
{ {

View file

@ -27,6 +27,7 @@ canvas.hide-subjects {
.card { .card {
display: flex; display: flex;
overflow-wrap: anywhere;
width: 100%; width: 100%;
} }