mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 06:04:11 +08:00
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:
parent
aaf0b0f1cc
commit
4b52269827
|
@ -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"}}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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|
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user