Fix navigation switching to user “Account” category when viewing appeal for moderation interface (#39476)

This commit is contained in:
Claire
2026-06-18 11:01:57 +02:00
committed by GitHub
parent b5b9cb7043
commit 83f559ee9f
5 changed files with 9 additions and 3 deletions

View File

@@ -0,0 +1,4 @@
# frozen_string_literal: true
class Admin::Disputes::StrikesController < Disputes::StrikesController
end

View File

@@ -8,7 +8,7 @@ class Disputes::AppealsController < Disputes::BaseController
@appeal = AppealService.new.call(@strike, appeal_params[:text])
redirect_to disputes_strike_path(@strike), notice: I18n.t('disputes.strikes.appealed_msg')
redirect_to admin_disputes_strike_path(@strike), notice: I18n.t('disputes.strikes.appealed_msg')
rescue ActiveRecord::RecordInvalid => e
@appeal = e.record
render 'disputes/strikes/show'

View File

@@ -1,4 +1,4 @@
= link_to disputes_strike_path(appeal.strike), class: ['log-entry', appeal.approved? && 'log-entry--inactive'] do
= link_to admin_disputes_strike_path(appeal.strike), class: ['log-entry', appeal.approved? && 'log-entry--inactive'] do
.log-entry__header
.log-entry__avatar
= image_tag appeal.account.avatar.url(:original), alt: '', width: 40, height: 40, class: 'avatar'

View File

@@ -53,7 +53,7 @@ SimpleNavigation::Configuration.run do |navigation|
n.item :moderation, safe_join([material_symbol('gavel'), t('moderation.title')]), nil, if: -> { current_user.can?(:manage_reports, :view_audit_log, :manage_users, :manage_invites, :manage_taxonomies, :manage_federation, :manage_blocks) && !self_destruct } do |s|
s.item :reports, safe_join([material_symbol('flag'), t('admin.reports.title')]), admin_reports_path, highlights_on: %r{/admin/reports|admin/report_notes}, if: -> { current_user.can?(:manage_reports) }
s.item :appeals, safe_join([material_symbol('feedback'), t('admin.disputes.appeals.title')]), admin_disputes_appeals_path, highlights_on: %r{/admin/disputes/appeals}, if: -> { current_user.can?(:manage_appeals) }
s.item :appeals, safe_join([material_symbol('feedback'), t('admin.disputes.appeals.title')]), admin_disputes_appeals_path, highlights_on: %r{/admin/disputes/}, if: -> { current_user.can?(:manage_appeals) }
s.item :accounts, safe_join([material_symbol('groups'), t('admin.accounts.title')]), admin_accounts_path(origin: 'local'), highlights_on: %r{/admin/accounts|admin/account_moderation_notes|/admin/pending_accounts|/admin/users}, if: -> { current_user.can?(:manage_users) }
s.item :tags, safe_join([material_symbol('tag'), t('admin.tags.title')]), admin_tags_path, highlights_on: %r{/admin/tags}, if: -> { current_user.can?(:manage_taxonomies) }
s.item :invites, safe_join([material_symbol('person_add'), t('admin.invites.title')]), admin_invites_path, if: -> { current_user.can?(:manage_invites) }

View File

@@ -205,6 +205,8 @@ namespace :admin do
end
namespace :disputes do
resources :strikes, only: [:show, :index]
resources :appeals, only: [:index] do
member do
post :approve