Merge branch 'kb_development' into kb_migration
This commit is contained in:
commit
936bbb2712
5 changed files with 19 additions and 10 deletions
|
@ -12,7 +12,7 @@ module Admin
|
|||
private
|
||||
|
||||
def filtered_attachments
|
||||
MediaAttachment.local_attached.order(created_at: :desc)
|
||||
MediaAttachment.local_attached.reverse_order
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -33,7 +33,7 @@ module Admin
|
|||
authorize [:admin, @status], :show?
|
||||
UpdateStatusService.new.call(
|
||||
@status,
|
||||
@account.id,
|
||||
edit_status_account_id,
|
||||
no_history: true
|
||||
)
|
||||
log_action(:remove_history, @status)
|
||||
|
@ -44,7 +44,7 @@ module Admin
|
|||
authorize [:admin, @status], :show?
|
||||
UpdateStatusService.new.call(
|
||||
@status,
|
||||
@account.id,
|
||||
edit_status_account_id,
|
||||
media_ids: [],
|
||||
media_attributes: []
|
||||
)
|
||||
|
@ -56,7 +56,7 @@ module Admin
|
|||
authorize [:admin, @status], :show?
|
||||
UpdateStatusService.new.call(
|
||||
@status,
|
||||
@account.id,
|
||||
edit_status_account_id,
|
||||
sensitive: true
|
||||
)
|
||||
log_action(:force_sensitive, @status)
|
||||
|
@ -67,7 +67,7 @@ module Admin
|
|||
authorize [:admin, @status], :show?
|
||||
UpdateStatusService.new.call(
|
||||
@status,
|
||||
@account.id,
|
||||
edit_status_account_id,
|
||||
spoiler_text: 'CW'
|
||||
)
|
||||
log_action(:force_cw, @status)
|
||||
|
@ -112,6 +112,13 @@ module Admin
|
|||
@statuses = Admin::StatusFilter.new(@account, filter_params).results.preload(:application, :preloadable_poll, :media_attachments, active_mentions: :account, reblog: [:account, :application, :preloadable_poll, :media_attachments, active_mentions: :account]).page(params[:page]).per(PER_PAGE)
|
||||
end
|
||||
|
||||
def edit_status_account_id
|
||||
return @edit_account_id || @account.id if @edit_account_checked
|
||||
|
||||
@edit_account_checked = true
|
||||
@edit_account_id = Account.local.find_by(username: 'official')&.id || @account.id
|
||||
end
|
||||
|
||||
def filter_params
|
||||
params.slice(*Admin::StatusFilter::KEYS).permit(*Admin::StatusFilter::KEYS)
|
||||
end
|
||||
|
|
|
@ -48,15 +48,15 @@
|
|||
%div.action-buttons
|
||||
%div
|
||||
- if @account.local?
|
||||
= link_to t('admin.statuses.remove_history'), remove_history_admin_account_status_path(@account.id), method: :post, class: 'button' if can?(:warn, @account)
|
||||
= link_to t('admin.statuses.remove_history'), remove_history_admin_account_status_path(@account.id), data: { confirm: t('admin.statuses.are_you_sure') }, method: :post, class: 'button' if can?(:warn, @account)
|
||||
- if @account.local? && @status.with_media?
|
||||
= link_to t('admin.statuses.remove_media'), remove_media_admin_account_status_path(@account.id), method: :post, class: 'button' if can?(:warn, @account)
|
||||
= link_to t('admin.statuses.remove_media'), remove_media_admin_account_status_path(@account.id), data: { confirm: t('admin.statuses.are_you_sure') }, method: :post, class: 'button' if can?(:warn, @account)
|
||||
- if @account.local? && !@status.sensitive && @status.with_media?
|
||||
= link_to t('admin.statuses.force_nsfw'), force_sensitive_admin_account_status_path(@account.id), method: :post, class: 'button' if can?(:warn, @account)
|
||||
= link_to t('admin.statuses.force_nsfw'), force_sensitive_admin_account_status_path(@account.id), data: { confirm: t('admin.statuses.are_you_sure') }, method: :post, class: 'button' if can?(:warn, @account)
|
||||
- if @account.local? && !@status.spoiler_text.present?
|
||||
= link_to t('admin.statuses.force_cw'), force_cw_admin_account_status_path(@account.id), method: :post, class: 'button' if can?(:warn, @account)
|
||||
= link_to t('admin.statuses.force_cw'), force_cw_admin_account_status_path(@account.id), data: { confirm: t('admin.statuses.are_you_sure') }, method: :post, class: 'button' if can?(:warn, @account)
|
||||
- if @account.local?
|
||||
= link_to t('admin.statuses.remove'), remove_status_admin_account_status_path(@account.id), method: :post, class: 'button' if can?(:warn, @account)
|
||||
= link_to t('admin.statuses.remove'), remove_status_admin_account_status_path(@account.id), data: { confirm: t('admin.statuses.are_you_sure') }, method: :post, class: 'button' if can?(:warn, @account)
|
||||
|
||||
%hr.spacer/
|
||||
|
||||
|
|
|
@ -772,6 +772,7 @@ en:
|
|||
statuses:
|
||||
account: Author
|
||||
application: Application
|
||||
are_you_sure: Are you sure?
|
||||
back_to_account: Back to account page
|
||||
back_to_report: Back to report page
|
||||
batch:
|
||||
|
|
|
@ -758,6 +758,7 @@ ja:
|
|||
statuses:
|
||||
account: 作成者
|
||||
application: アプリ
|
||||
are_you_sure: 本当に実行しますか?
|
||||
back_to_account: アカウントページに戻る
|
||||
back_to_report: 通報ページに戻る
|
||||
batch:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue