mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-30 23:33:42 +01:00
75580360cd
Conflicts: - `.rubocop_todo.yml`: Upstream fixed a bunch lint issues, and changed the `Max` parameter of the `Metrics/AbcSize` cop. Glitch-soc has different code and slightly higher `AbcSize` complexity, modified the `.rubocop_todo.yml` file accordingly. - `app/policies/status_policy.rb`: Upstream changed `account.suspended?` to `account.unavailable?` to prepare for delete flags. Glitch-soc has additional local-only conditions. Ported upstream's refactor while keeping glitch-soc's additional condition. - `app/serializers/initial_state_serializer.rb`: Upstream refactored a bunch of stuff while glitch-soc has more settings. Refactored as upstream did while keeping glitch-soc's settings.
28 lines
533 B
Ruby
28 lines
533 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Settings::BaseController < ApplicationController
|
|
before_action :set_pack
|
|
layout 'admin'
|
|
|
|
before_action :authenticate_user!
|
|
before_action :set_body_classes
|
|
before_action :set_cache_headers
|
|
|
|
private
|
|
|
|
def set_pack
|
|
use_pack 'settings'
|
|
end
|
|
|
|
def set_body_classes
|
|
@body_classes = 'admin'
|
|
end
|
|
|
|
def set_cache_headers
|
|
response.cache_control.replace(private: true, no_store: true)
|
|
end
|
|
|
|
def require_not_suspended!
|
|
forbidden if current_account.unavailable?
|
|
end
|
|
end
|