Merge remote-tracking branch 'upstream/stable-4.7', removing Mastodon-Modern folder.
This commit is contained in:
commit
8eabb7ea31
959 files changed
+29430
-9565
No files matched your search
@@ -51,7 +51,7 @@ module Admin
|
||||
end
|
||||
|
||||
def set_collection
|
||||
@collection = @account.collections.includes(accepted_collection_items: :account).find(params[:id])
|
||||
@collection = @account.collections.includes(accepted_collection_items: { account: [:account_stat, user: [:ips, :invite_request]] }).find(params[:id])
|
||||
end
|
||||
|
||||
def set_collections
|
||||
|
||||
@@ -14,7 +14,7 @@ class Admin::Disputes::AppealsController < Admin::BaseController
|
||||
authorize @appeal, :approve?
|
||||
log_action :approve, @appeal
|
||||
ApproveAppealService.new.call(@appeal, current_account)
|
||||
redirect_to disputes_strike_path(@appeal.strike)
|
||||
redirect_to admin_disputes_strike_path(@appeal.strike)
|
||||
end
|
||||
|
||||
def reject
|
||||
@@ -22,7 +22,7 @@ class Admin::Disputes::AppealsController < Admin::BaseController
|
||||
log_action :reject, @appeal
|
||||
@appeal.reject!(current_account)
|
||||
UserMailer.appeal_rejected(@appeal.account.user, @appeal).deliver_later
|
||||
redirect_to disputes_strike_path(@appeal.strike)
|
||||
redirect_to admin_disputes_strike_path(@appeal.strike)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Admin::Disputes::StrikesController < Disputes::StrikesController
|
||||
end
|
||||
@@ -59,7 +59,7 @@ module Admin
|
||||
|
||||
def filter_by_domain
|
||||
scope = EmailDomainBlock.parents.includes(:children).order(id: :desc)
|
||||
scope.merge!(EmailDomainBlock.matches_domain(params[:domain])) if params[:domain].present?
|
||||
scope.merge!(EmailDomainBlock.matches_domain(params[:by_domain])) if params[:by_domain].present?
|
||||
scope
|
||||
end
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ module Admin
|
||||
def index
|
||||
authorize :ip_block, :index?
|
||||
|
||||
@ip_blocks = IpBlock.order(ip: :asc).page(params[:page])
|
||||
@ip_blocks = filter_by_ip(IpBlock.order(ip: :asc).page(params[:page]))
|
||||
@form = Form::IpBlockBatch.new
|
||||
end
|
||||
|
||||
@@ -43,6 +43,11 @@ module Admin
|
||||
|
||||
private
|
||||
|
||||
def filter_by_ip(scope)
|
||||
scope.merge!(IpBlock.overlapping_with(params[:ip])) if params[:ip].present?
|
||||
scope
|
||||
end
|
||||
|
||||
def resource_params
|
||||
params
|
||||
.expect(ip_block: [:ip, :severity, :comment, :expires_in])
|
||||
|
||||
@@ -17,12 +17,15 @@ module Admin
|
||||
authorize @tag, :show?
|
||||
|
||||
@time_period = report_range
|
||||
@action_logs = Admin::ActionLogFilter.new(target_tag: @tag.formatted_name).results.limit(5)
|
||||
end
|
||||
|
||||
def update
|
||||
authorize @tag, :update?
|
||||
|
||||
if @tag.update(tag_params.merge(reviewed_at: Time.now.utc))
|
||||
log_action_from_change if @tag.saved_changes?
|
||||
|
||||
redirect_to admin_tag_path(@tag.id), notice: I18n.t('admin.tags.updated_msg')
|
||||
else
|
||||
@time_period = report_range
|
||||
@@ -33,6 +36,13 @@ module Admin
|
||||
|
||||
private
|
||||
|
||||
def log_action_from_change
|
||||
action_log = current_account.action_logs.new(action: 'update', target: @tag)
|
||||
action_log.recorded_changes = @tag.saved_changes.slice('usable', 'trendable', 'listable').transform_values(&:last)
|
||||
action_log.recorded_changes_format = 'tags_format_1.0'
|
||||
action_log.save
|
||||
end
|
||||
|
||||
def set_tag
|
||||
@tag = Tag.find(params[:id])
|
||||
end
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class Users::SignInTokenAuthenticationsController < BaseController
|
||||
before_action :set_target_user
|
||||
|
||||
def create
|
||||
authorize @user, :enable_sign_in_token?
|
||||
@user.enable_sign_in_token!
|
||||
log_action :enable_sign_in_token, @user
|
||||
redirect_to admin_account_path(@user.account_id)
|
||||
end
|
||||
|
||||
def destroy
|
||||
authorize @user, :disable_sign_in_token?
|
||||
@user.disable_sign_in_token!
|
||||
log_action :disable_sign_in_token, @user
|
||||
redirect_to admin_account_path(@user.account_id)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_target_user
|
||||
@user = User.find(params[:user_id])
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user