Set @body_classes to admin layout (#9081)
This commit is contained in:
parent
df3a7e724d
commit
e8ffecbd36
17 changed files with 89 additions and 3 deletions
|
@ -7,6 +7,7 @@ module Settings
|
|||
|
||||
before_action :authenticate_user!
|
||||
before_action :ensure_otp_secret
|
||||
before_action :set_body_classes
|
||||
|
||||
def new
|
||||
prepare_two_factor_form
|
||||
|
@ -43,6 +44,10 @@ module Settings
|
|||
def ensure_otp_secret
|
||||
redirect_to settings_two_factor_authentication_path unless current_user.otp_secret
|
||||
end
|
||||
|
||||
def set_body_classes
|
||||
@body_classes = 'admin'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,6 +6,7 @@ module Settings
|
|||
layout 'admin'
|
||||
|
||||
before_action :authenticate_user!
|
||||
before_action :set_body_classes
|
||||
|
||||
def create
|
||||
@recovery_codes = current_user.generate_otp_backup_codes!
|
||||
|
@ -13,6 +14,12 @@ module Settings
|
|||
flash[:notice] = I18n.t('two_factor_authentication.recovery_codes_regenerated')
|
||||
render :index
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_body_classes
|
||||
@body_classes = 'admin'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue