about summary refs log tree commit diff
path: root/app/models/form
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/form')
-rw-r--r--app/models/form/admin_settings.rb29
1 files changed, 27 insertions, 2 deletions
diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb
index 431d33bcd..b53a82db2 100644
--- a/app/models/form/admin_settings.rb
+++ b/app/models/form/admin_settings.rb
@@ -14,20 +14,28 @@ class Form::AdminSettings
     closed_registrations_message
     timeline_preview
     bootstrap_timeline_accounts
-    theme
+    flavour
+    skin
     activity_api_enabled
     peers_api_enabled
     preview_sensitive_media
     custom_css
     profile_directory
+    hide_followers_count
+    flavour_and_skin
     thumbnail
     mascot
+    show_reblogs_in_public_timelines
+    show_replies_in_public_timelines
     trends
     trendable_by_default
+    trending_status_cw
     show_domain_blocks
     show_domain_blocks_rationale
     noindex
+    outgoing_spoilers
     require_invite_text
+    captcha_enabled
     media_cache_retention_period
     content_cache_retention_period
     backups_retention_period
@@ -45,10 +53,15 @@ class Form::AdminSettings
     peers_api_enabled
     preview_sensitive_media
     profile_directory
+    hide_followers_count
+    show_reblogs_in_public_timelines
+    show_replies_in_public_timelines
     trends
     trendable_by_default
+    trending_status_cw
     noindex
     require_invite_text
+    captcha_enabled
   ).freeze
 
   UPLOAD_KEYS = %i(
@@ -56,6 +69,10 @@ class Form::AdminSettings
     mascot
   ).freeze
 
+  PSEUDO_KEYS = %i(
+    flavour_and_skin
+  ).freeze
+
   attr_accessor(*KEYS)
 
   validates :registrations_mode, inclusion: { in: %w(open approved none) }, if: -> { defined?(@registrations_mode) }
@@ -94,7 +111,7 @@ class Form::AdminSettings
     return false unless valid?
 
     KEYS.each do |key|
-      next unless instance_variable_defined?("@#{key}")
+      next if PSEUDO_KEYS.include?(key) || !instance_variable_defined?("@#{key}")
 
       if UPLOAD_KEYS.include?(key)
         public_send(key).save
@@ -105,6 +122,14 @@ 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 typecast_value(key, value)