about summary refs log tree commit diff
path: root/app/models/form/admin_settings.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/form/admin_settings.rb')
-rw-r--r--app/models/form/admin_settings.rb26
1 files changed, 25 insertions, 1 deletions
diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb
index 390836f28..84a656864 100644
--- a/app/models/form/admin_settings.rb
+++ b/app/models/form/admin_settings.rb
@@ -18,7 +18,8 @@ class Form::AdminSettings
     show_staff_badge
     enable_bootstrap_timeline_accounts
     bootstrap_timeline_accounts
-    theme
+    flavour
+    skin
     min_invite_role
     activity_api_enabled
     peers_api_enabled
@@ -26,9 +27,14 @@ class Form::AdminSettings
     preview_sensitive_media
     custom_css
     profile_directory
+    hide_followers_count
+    enable_keybase
+    flavour_and_skin
     thumbnail
     hero
     mascot
+    show_reblogs_in_public_timelines
+    show_replies_in_public_timelines
     spam_check_enabled
     trends
     trendable_by_default
@@ -47,6 +53,10 @@ class Form::AdminSettings
     show_known_fediverse_at_about_page
     preview_sensitive_media
     profile_directory
+    hide_followers_count
+    enable_keybase
+    show_reblogs_in_public_timelines
+    show_replies_in_public_timelines
     spam_check_enabled
     trends
     trendable_by_default
@@ -59,6 +69,10 @@ class Form::AdminSettings
     mascot
   ).freeze
 
+  PSEUDO_KEYS = %i(
+    flavour_and_skin
+  ).freeze
+
   attr_accessor(*KEYS)
 
   validates :site_short_description, :site_description, html: { wrap_with: :p }
@@ -80,6 +94,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) && !value.nil?
@@ -92,10 +107,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