Finalized theme loading and stuff

This commit is contained in:
kibigo!
2017-11-20 22:13:37 -08:00
parent 321fa41930
commit bdbbd06dad
73 changed files with 573 additions and 378 deletions

View File

@@ -1,9 +1,7 @@
# frozen_string_literal: true
class Settings::ApplicationsController < ApplicationController
layout 'admin'
class Settings::ApplicationsController < Settings::BaseController
before_action :authenticate_user!
before_action :set_application, only: [:show, :update, :destroy, :regenerate]
before_action :prepare_scopes, only: [:create, :update]

View File

@@ -0,0 +1,12 @@
# frozen_string_literal: true
class Settings::BaseController < ApplicationController
layout 'admin'
before_action :authenticate_user!
before_action :set_pack
def set_pack
use_pack 'settings'
end
end

View File

@@ -1,10 +1,8 @@
# frozen_string_literal: true
class Settings::DeletesController < ApplicationController
layout 'admin'
class Settings::DeletesController < Settings::BaseController
before_action :check_enabled_deletion
before_action :authenticate_user!
def show
@confirmation = Form::DeleteConfirmation.new

View File

@@ -1,10 +1,6 @@
# frozen_string_literal: true
class Settings::ExportsController < ApplicationController
layout 'admin'
before_action :authenticate_user!
class Settings::ExportsController < Settings::BaseController
def show
@export = Export.new(current_account)
end

View File

@@ -2,11 +2,7 @@
require 'sidekiq-bulk'
class Settings::FollowerDomainsController < ApplicationController
layout 'admin'
before_action :authenticate_user!
class Settings::FollowerDomainsController < Settings::BaseController
def show
@account = current_account
@domains = current_account.followers.reorder('MIN(follows.id) DESC').group('accounts.domain').select('accounts.domain, count(accounts.id) as accounts_from_domain').page(params[:page]).per(10)

View File

@@ -1,9 +1,6 @@
# frozen_string_literal: true
class Settings::ImportsController < ApplicationController
layout 'admin'
before_action :authenticate_user!
class Settings::ImportsController < Settings::BaseController
before_action :set_account
def show

View File

@@ -1,9 +1,6 @@
# frozen_string_literal: true
class Settings::KeywordMutesController < ApplicationController
layout 'admin'
before_action :authenticate_user!
class Settings::KeywordMutesController < Settings::BaseController
before_action :load_keyword_mute, only: [:edit, :update, :destroy]
def index

View File

@@ -1,10 +1,6 @@
# frozen_string_literal: true
class Settings::NotificationsController < ApplicationController
layout 'admin'
before_action :authenticate_user!
class Settings::NotificationsController < Settings::BaseController
def show; end
def update

View File

@@ -1,10 +1,6 @@
# frozen_string_literal: true
class Settings::PreferencesController < ApplicationController
layout 'admin'
before_action :authenticate_user!
class Settings::PreferencesController < Settings::BaseController
def show; end
def update

View File

@@ -1,11 +1,8 @@
# frozen_string_literal: true
class Settings::ProfilesController < ApplicationController
class Settings::ProfilesController < Settings::BaseController
include ObfuscateFilename
layout 'admin'
before_action :authenticate_user!
before_action :set_account
obfuscate_filename [:account, :avatar]

View File

@@ -1,5 +1,6 @@
# frozen_string_literal: true
# Intentionally does not inherit from BaseController
class Settings::SessionsController < ApplicationController
before_action :set_session, only: :destroy

View File

@@ -1,10 +1,7 @@
# frozen_string_literal: true
module Settings
class TwoFactorAuthenticationsController < ApplicationController
layout 'admin'
before_action :authenticate_user!
class TwoFactorAuthenticationsController < BaseController
before_action :verify_otp_required, only: [:create]
def show