Add proper ban page when logging in (#773)

* Add proper ban page upon logging in

* Remove two extra line break tags that don't need to be there

* Fix timestamp formatting

* Properly display timestamps in correct timezone

* Fix formatting issues with ban page

* Remove extra parenthesis which would be rendered on-page

* Add to redirect middleware to prevent navigating to other pages

* Small nitpick, renaming UserBannedPage to BannedUserPage

* Resolve nitpicks from reviewers

* Remove un-necessary log message in LoginForm

* Fix ban reason translatable string argument

* Word choice nitpick ("Ban Created" -> "Ban Issued")

* Final adjustments and nitpicks, visual and grammatical

* Resolve requested changes from reviewers
This commit is contained in:
koko 2023-05-30 15:25:31 -04:00 committed by GitHub
commit 21dbdff20a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 203 additions and 23 deletions

View file

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="suspension_heading" xml:space="preserve">
<value>Account Suspended</value>
</data>
<data name="suspension_explanation" xml:space="preserve">
<value>Your {0} account has been suspended due to code of conduct violations.</value>
</data>
<data name="suspension_expiration" xml:space="preserve">
<value>During this suspension, the following features will be limited until {0}:</value>
</data>
<data name="suspension_reason" xml:space="preserve">
<value>Reason for suspension: "{0}"</value>
</data>
<data name="suspension_circumvent_warning" xml:space="preserve">
<value>Attempts to circumvent this suspension will result in an extended suspension period.</value>
</data>
<data name="lbp_online_multiplayer" xml:space="preserve">
<value>LittleBigPlanet™ Online multiplayer</value>
</data>
<data name="does_not_expire" xml:space="preserve">
<value>Does not expire</value>
</data>
<data name="profile_visibility" xml:space="preserve">
<value>Profile visibility</value>
</data>
<data name="website_interactions" xml:space="preserve">
<value>Browsing levels, photos, and profiles</value>
</data>
<data name="account_profile_management" xml:space="preserve">
<value>Account and profile management</value>
</data>
</root>

View file

@ -44,6 +44,10 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>TwoFactor.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Moderation.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Moderation.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>

View file

@ -0,0 +1,22 @@
namespace LBPUnion.ProjectLighthouse.Localization.StringLists;
public static class ModerationStrings
{
// Main page strings
public static readonly TranslatableString SuspensionHeading = create("suspension_heading");
public static readonly TranslatableString SuspensionExplanation = create("suspension_explanation");
public static readonly TranslatableString SuspensionExpiration = create("suspension_expiration");
public static readonly TranslatableString SuspensionReason = create("suspension_reason");
public static readonly TranslatableString SuspensionCircumventWarning = create("suspension_circumvent_warning");
// Translatable string in case a ban doesn't expire
public static readonly TranslatableString DoesNotExpire = create("does_not_expire");
// Restricted features strings
public static readonly TranslatableString LbpOnlineMultiplayer = create("lbp_online_multiplayer");
public static readonly TranslatableString WebsiteInteractions = create("website_interactions");
public static readonly TranslatableString ProfileVisibility = create("profile_visibility");
public static readonly TranslatableString AccountProfileManagement = create("account_profile_management");
private static TranslatableString create(string key) => new(TranslationAreas.Moderation, key);
}

View file

@ -12,4 +12,5 @@ public enum TranslationAreas
Profile,
ModPanel,
TwoFactor,
Moderation,
}