diff options
Diffstat (limited to 'app/models/form')
-rw-r--r-- | app/models/form/admin_settings.rb | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb index 2d3aa726d..0fcbd0605 100644 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@ -17,7 +17,8 @@ class Form::AdminSettings timeline_preview show_staff_badge bootstrap_timeline_accounts - theme + flavour + skin min_invite_role activity_api_enabled peers_api_enabled @@ -25,6 +26,8 @@ class Form::AdminSettings preview_sensitive_media custom_css profile_directory + hide_followers_count + flavour_and_skin ).freeze BOOLEAN_KEYS = %i( @@ -36,6 +39,7 @@ class Form::AdminSettings show_known_fediverse_at_about_page preview_sensitive_media profile_directory + hide_followers_count ).freeze UPLOAD_KEYS = %i( @@ -44,6 +48,10 @@ class Form::AdminSettings mascot ).freeze + PSEUDO_KEYS = %i( + flavour_and_skin + ).freeze + attr_accessor(*KEYS) validates :site_short_description, :site_description, :site_extended_description, :site_terms, :closed_registrations_message, html: true @@ -62,6 +70,7 @@ class Form::AdminSettings return false unless valid? KEYS.each do |key| + next if PSEUDO_KEYS.include?(key) value = instance_variable_get("@#{key}") if UPLOAD_KEYS.include?(key) @@ -74,10 +83,19 @@ class Form::AdminSettings end end + def flavour_and_skin + "#{Setting.flavour}/#{Setting.skin}" + end + + def flavour_and_skin=(value) + @flavour, @skin = value.split('/', 2) + end + private def initialize_attributes KEYS.each do |key| + next if PSEUDO_KEYS.include?(key) instance_variable_set("@#{key}", Setting.public_send(key)) if instance_variable_get("@#{key}").nil? end end |