From 2d773ed7bfcf030c56ff21bf03ea0ad449efe914 Mon Sep 17 00:00:00 2001 From: jvyden Date: Sat, 12 Mar 2022 23:17:40 -0500 Subject: [PATCH] Add filter debug page --- .../Pages/Debug/FilterTestPage.cshtml | 22 +++++++++++++++ .../Pages/Debug/FilterTestPage.cshtml.cs | 28 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 ProjectLighthouse/Pages/Debug/FilterTestPage.cshtml create mode 100644 ProjectLighthouse/Pages/Debug/FilterTestPage.cshtml.cs diff --git a/ProjectLighthouse/Pages/Debug/FilterTestPage.cshtml b/ProjectLighthouse/Pages/Debug/FilterTestPage.cshtml new file mode 100644 index 00000000..d648c178 --- /dev/null +++ b/ProjectLighthouse/Pages/Debug/FilterTestPage.cshtml @@ -0,0 +1,22 @@ +@page "/debug/filter" +@model LBPUnion.ProjectLighthouse.Pages.Debug.FilterTestPage + +@{ + Layout = "Layouts/BaseLayout"; + Model.Title = "Debug - Filter Test"; +} + +@if (Model.FilteredText != null) +{ +

@Model.FilteredText

+} + +
+
+ + +
+
\ No newline at end of file diff --git a/ProjectLighthouse/Pages/Debug/FilterTestPage.cshtml.cs b/ProjectLighthouse/Pages/Debug/FilterTestPage.cshtml.cs new file mode 100644 index 00000000..804cf19b --- /dev/null +++ b/ProjectLighthouse/Pages/Debug/FilterTestPage.cshtml.cs @@ -0,0 +1,28 @@ +#nullable enable +using System.Threading.Tasks; +using LBPUnion.ProjectLighthouse.Helpers; +using LBPUnion.ProjectLighthouse.Pages.Layouts; +using Microsoft.AspNetCore.Mvc; + +namespace LBPUnion.ProjectLighthouse.Pages.Debug; + +public class FilterTestPage : BaseLayout +{ + public FilterTestPage(Database database) : base(database) + {} + + public string? FilteredText = null; + public string? Text = null; + + public async Task OnGet(string? text = null) + { + #if !DEBUG + return this.NotFound(); + #endif + + if (text != null) this.FilteredText = CensorHelper.ScanMessage(text); + this.Text = text; + + return this.Page(); + } +} \ No newline at end of file