Implement read-only mode (#1001)

* Implement read-only mode

* Use localized string under default language for announce text

* Redirect to user page rather than returning blank 400

* Protect call to `ParseBase64Image`

* Add protections to SlotSettingsPage and nitpick format

* Display the latest announcement (if any) on the landing page

* Fix a kokoism

Accidentally tried to use markdown within the landing page... I'm rather smart aren't I

* Prevent possible XSS

* Separate truncated announcement text and link with "..."

* Apply suggestion from code review

* Add read-only check to /postComment in slot page controller

* Fix inconsistent tabbing
This commit is contained in:
sudokoko 2024-03-29 22:51:12 -04:00 committed by GitHub
parent 975fcab100
commit 0ee8970c64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 176 additions and 18 deletions

View file

@ -87,4 +87,10 @@
<data name="license_warn_3" xml:space="preserve">
<value>If not, please publish the source code somewhere accessible to your users.</value>
</data>
<data name="read_only_warn_title" xml:space="preserve">
<value>Read-Only Mode</value>
</data>
<data name="read_only_warn" xml:space="preserve">
<value>This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled.</value>
</data>
</root>

View file

@ -23,5 +23,8 @@ public static class BaseLayoutStrings
public static readonly TranslatableString LicenseWarn2 = create("license_warn_2");
public static readonly TranslatableString LicenseWarn3 = create("license_warn_3");
public static readonly TranslatableString ReadOnlyWarnTitle = create("read_only_warn_title");
public static readonly TranslatableString ReadOnlyWarn = create("read_only_warn");
private static TranslatableString create(string key) => new(TranslationAreas.BaseLayout, key);
}