about summary refs log tree commit diff
path: root/app/controllers/admin
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-10-08 15:00:27 +0200
committerThibG <thib@sitedethib.com>2018-10-12 19:06:35 +0200
commit3d5d899094ecf389ce6cf31a6f33dcf1894e662d (patch)
tree14b450da3a3c60646fa771496fea6e94f8b68181 /app/controllers/admin
parentfac529975b2b97e4c57393560d3359a98f7b1953 (diff)
Allow selecting both default flavour and theme
Fixes #672
Diffstat (limited to 'app/controllers/admin')
-rw-r--r--app/controllers/admin/settings_controller.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/admin/settings_controller.rb b/app/controllers/admin/settings_controller.rb
index 46e9b2c07..fe2720c48 100644
--- a/app/controllers/admin/settings_controller.rb
+++ b/app/controllers/admin/settings_controller.rb
@@ -18,6 +18,7 @@ module Admin
       bootstrap_timeline_accounts
       flavour
       skin
+      flavour_and_skin
       thumbnail
       hero
       mascot
@@ -54,7 +55,13 @@ module Admin
     def update
       authorize :settings, :update?
 
-      settings_params.each do |key, value|
+      settings = settings_params
+      flavours_and_skin = settings.delete('flavour_and_skin')
+      if flavours_and_skin
+        settings['flavour'], settings['skin'] = flavours_and_skin.split('/', 2)
+      end
+
+      settings.each do |key, value|
         if UPLOAD_SETTINGS.include?(key)
           upload = SiteUpload.where(var: key).first_or_initialize(var: key)
           upload.update(file: value)