mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 03:49:16 +02:00
Fix #879: Admins can now add custom CSS from their pod settings
This commit is contained in:
parent
78ab153734
commit
7897c8ac7f
5 changed files with 84 additions and 1 deletions
|
@ -4,6 +4,7 @@ from dynamic_preferences.registries import global_preferences_registry
|
|||
|
||||
raven = types.Section("raven")
|
||||
instance = types.Section("instance")
|
||||
ui = types.Section("ui")
|
||||
|
||||
|
||||
@global_preferences_registry.register
|
||||
|
@ -98,3 +99,19 @@ class InstanceNodeinfoStatsEnabled(types.BooleanPreference):
|
|||
"Disable this if you don't want to share usage and library statistics "
|
||||
"in the nodeinfo endpoint but don't want to disable it completely."
|
||||
)
|
||||
|
||||
|
||||
@global_preferences_registry.register
|
||||
class CustomCSS(types.StringPreference):
|
||||
show_in_api = True
|
||||
section = ui
|
||||
name = "custom_css"
|
||||
verbose_name = "Custom CSS code"
|
||||
default = ""
|
||||
help_text = (
|
||||
"Custom CSS code, to be included in a <style> tag on all pages. "
|
||||
"Loading third-party resources such as fonts or images can affect the performance "
|
||||
"of the app and the privacy of your users."
|
||||
)
|
||||
widget = widgets.Textarea
|
||||
field_kwargs = {"required": False}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue