Remove moderation tool media list page

This commit is contained in:
KMY 2023-09-21 16:20:07 +09:00
parent 3c317659c4
commit e84eb3fc81
6 changed files with 0 additions and 92 deletions

View file

@ -1,18 +0,0 @@
# frozen_string_literal: true
module Admin
class MediaAttachmentsController < BaseController
def index
authorize :account, :index?
@media_attachments = filtered_attachments.page(params[:page])
@form = Form::MediaAttachmentsBatch.new
end
private
def filtered_attachments
MediaAttachment.local_attached.reverse_order
end
end
end

View file

@ -1,12 +0,0 @@
# frozen_string_literal: true
class Form::MediaAttachmentsBatch
include ActiveModel::Model
include Authorization
include AccountableConcern
include Payloadable
attr_accessor :query
def save; end
end

View file

@ -1,30 +0,0 @@
.batch-table__row{ class: ['batch-table__row--attention'] }
.batch-table__row__content.batch-table__row__content--unpadded
%table.media-attachments-table
%tbody
%tr
%td
%img.image{ src: media_attachment.url, alt: '' }
.detailed-status__meta
- if media_attachment.status.application
= media_attachment.status.application.name
·
= link_to ActivityPub::TagManager.instance.url_for(media_attachment.status), class: 'detailed-status__datetime', target: stream_link_target, rel: 'noopener noreferrer' do
%time.formatted{ datetime: media_attachment.status.created_at.iso8601, title: l(media_attachment.status.created_at) }= l(media_attachment.status.created_at)
- if media_attachment.status.edited?
·
= link_to t('statuses.edited_at_html', date: content_tag(:time, l(media_attachment.status.edited_at), datetime: media_attachment.status.edited_at.iso8601, title: l(media_attachment.status.edited_at), class: 'formatted')), admin_account_status_path(media_attachment.status.account_id, media_attachment.status), class: 'detailed-status__datetime'
- if media_attachment.status.discarded?
·
%span.negative-hint= t('admin.statuses.deleted')
·
- if media_attachment.status.reblog?
= fa_icon('retweet fw')
= t('statuses.boosted_from_html', acct_link: admin_account_inline_link_to(media_attachment.status.proper.account))
- else
= fa_visibility_icon(media_attachment.status)
= t("statuses.visibilities.#{media_attachment.status.visibility}")
- if media_attachment.status.proper.sensitive?
·
= fa_icon('eye-slash fw')
= t('stream_entries.sensitive_content')

View file

@ -1,30 +0,0 @@
- content_for :page_title do
= t('admin.media_attachments.title')
- content_for :header_tags do
= javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous'
= form_for(@form, url: admin_media_attachments_path) do |f|
= hidden_field_tag :page, params[:page] || 1
= hidden_field_tag :select_all_matching, '0'
- AccountFilter::KEYS.each do |key|
= hidden_field_tag key, params[key] if params[key].present?
.batch-table
.batch-table__toolbar
- if @media_attachments.total_count > @media_attachments.size
.batch-table__select-all
.not-selected.active
%span= t('generic.all_items_on_page_selected_html', count: @media_attachments.size)
%button{ type: 'button' }= t('generic.select_all_matching_items', count: @media_attachments.total_count)
.selected
%span= t('generic.all_matching_items_selected_html', count: @media_attachments.total_count)
%button{ type: 'button' }= t('generic.deselect')
.batch-table__body
- if @media_attachments.empty?
= nothing_here 'nothing-here--under-tabs'
- else
= render partial: 'media_attachment', collection: @media_attachments, locals: { f: f }
= paginate @media_attachments

View file

@ -47,7 +47,6 @@ SimpleNavigation::Configuration.run do |navigation|
n.item :moderation, safe_join([fa_icon('gavel fw'), t('moderation.title')]), nil, if: -> { current_user.can?(:manage_reports, :view_audit_log, :manage_users, :manage_invites, :manage_taxonomies, :manage_federation, :manage_blocks, :manage_ng_words, :manage_sensitive_words) } do |s|
s.item :reports, safe_join([fa_icon('flag fw'), t('admin.reports.title')]), admin_reports_path, highlights_on: %r{/admin/reports}, if: -> { current_user.can?(:manage_reports) }
s.item :accounts, safe_join([fa_icon('users fw'), t('admin.accounts.title')]), admin_accounts_path(origin: 'local'), highlights_on: %r{/admin/accounts|/admin/pending_accounts|/admin/disputes|/admin/users}, if: -> { current_user.can?(:manage_users) }
s.item :media_attachments, safe_join([fa_icon('picture-o fw'), t('admin.media_attachments.title')]), admin_media_attachments_path, highlights_on: %r{/admin/media_attachments}, if: -> { current_user.can?(:manage_users) }
s.item :ng_words, safe_join([fa_icon('list fw'), t('admin.ng_words.title')]), admin_ng_words_path, highlights_on: %r{/admin/ng_words}, if: -> { current_user.can?(:manage_ng_words) }
s.item :sensitive_words, safe_join([fa_icon('list fw'), t('admin.sensitive_words.title')]), admin_sensitive_words_path, highlights_on: %r{/admin/sensitive_words}, if: -> { current_user.can?(:manage_sensitive_words) }
s.item :invites, safe_join([fa_icon('user-plus fw'), t('admin.invites.title')]), admin_invites_path, if: -> { current_user.can?(:manage_invites) }

View file

@ -32,7 +32,6 @@ namespace :admin do
resources :action_logs, only: [:index]
resources :warning_presets, except: [:new, :show]
resources :media_attachments, only: [:index]
resource :ng_words, only: [:show, :create]
resource :sensitive_words, only: [:show, :create]