about summary refs log tree commit diff
path: root/app/controllers/admin
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/admin')
-rw-r--r--app/controllers/admin/base_controller.rb5
-rw-r--r--app/controllers/admin/settings_controller.rb12
-rw-r--r--app/controllers/admin/statuses_controller.rb9
3 files changed, 24 insertions, 2 deletions
diff --git a/app/controllers/admin/base_controller.rb b/app/controllers/admin/base_controller.rb
index 8593b582a..f2190ddf9 100644
--- a/app/controllers/admin/base_controller.rb
+++ b/app/controllers/admin/base_controller.rb
@@ -8,6 +8,7 @@ module Admin
     layout 'admin'
 
     before_action :require_staff!
+    before_action :set_pack
     before_action :set_body_classes
 
     private
@@ -15,5 +16,9 @@ module Admin
     def set_body_classes
       @body_classes = 'admin'
     end
+
+    def set_pack
+      use_pack 'admin'
+    end
   end
 end
diff --git a/app/controllers/admin/settings_controller.rb b/app/controllers/admin/settings_controller.rb
index d9f261489..fe2720c48 100644
--- a/app/controllers/admin/settings_controller.rb
+++ b/app/controllers/admin/settings_controller.rb
@@ -16,7 +16,9 @@ module Admin
       timeline_preview
       show_staff_badge
       bootstrap_timeline_accounts
-      theme
+      flavour
+      skin
+      flavour_and_skin
       thumbnail
       hero
       mascot
@@ -53,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)
diff --git a/app/controllers/admin/statuses_controller.rb b/app/controllers/admin/statuses_controller.rb
index a69f12084..62f49806c 100644
--- a/app/controllers/admin/statuses_controller.rb
+++ b/app/controllers/admin/statuses_controller.rb
@@ -22,6 +22,15 @@ module Admin
       @form     = Form::StatusBatch.new
     end
 
+    def show
+      authorize :status, :index?
+
+      @statuses = @account.statuses.where(id: params[:id])
+      authorize @statuses[0], :show?
+
+      @form = Form::StatusBatch.new
+    end
+
     def create
       authorize :status, :update?