DEV: Move option to delete user under reviewable reject menu (#23257)

Follow-up to #23199 in which we moved the "delete user" options under the relevant action menu for flagged post. This change does the same, but to queued posts.
This commit is contained in:
Ted Johansson 2023-08-27 10:05:05 +08:00 committed by GitHub
parent aaf0b0f1cc
commit 4b52269827
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 15 deletions

View File

@ -1,6 +1,10 @@
{{#if this.multiple}}
<DropdownSelectBox
@class="reviewable-action-dropdown btn-icon-text"
@class={{concat-class
"reviewable-action-dropdown btn-icon-text"
(dasherize this.first.id)
this.first.button_class
}}
@nameProperty="label"
@content={{this.bundle.actions}}
@onChange={{action "performById"}}

View File

@ -273,15 +273,17 @@
button {
white-space: nowrap;
}
&.approve-post {
background-color: var(--success);
color: var(--secondary);
}
&.reject-post {
background-color: var(--danger);
color: var(--secondary);
}
.approve-post,
.approve-post > summary {
background-color: var(--success);
color: var(--secondary);
}
.reject-post,
.reject-post > summary {
background-color: var(--danger);
color: var(--secondary);
}
.reviewable-action,

View File

@ -668,7 +668,6 @@ class Reviewable < ActiveRecord::Base
a.icon = "user-times"
a.label = "reviewables.actions.reject_user.delete.title"
a.require_reject_reason = require_reject_reason
a.description = "reviewables.actions.reject_user.delete.description"
end
actions.add(:delete_user_block, bundle: bundle) do |a|

View File

@ -41,14 +41,24 @@ class ReviewableQueuedPost < Reviewable
end
if pending?
actions.add(:reject_post) do |a|
a.icon = "times"
a.label = "reviewables.actions.reject_post.title"
if guardian.can_delete_user?(target_created_by)
reject_bundle =
actions.add_bundle("#{id}-reject", label: "reviewables.actions.reject_post.title")
actions.add(:reject_post, bundle: reject_bundle) do |a|
a.icon = "times"
a.label = "reviewables.actions.discard_post.title"
a.button_class = "reject-post"
end
delete_user_actions(actions, reject_bundle)
else
actions.add(:reject_post) do |a|
a.icon = "times"
a.label = "reviewables.actions.reject_post.title"
end
end
end
delete_user_actions(actions) if pending? && guardian.can_delete_user?(target_created_by)
actions.add(:delete) if guardian.can_delete?(self)
end

View File

@ -5206,6 +5206,8 @@ en:
description: "Restore the post so that all users can see it."
disagree:
title: "No"
discard_post:
title: "Discard Post"
ignore:
title: "Ignore"
ignore_and_do_nothing: