UX: Reorder post admin actions for greater consistency.

This commit is contained in:
Dan Ungureanu 2019-04-22 10:57:14 +03:00
parent caeb035b61
commit f112f279ae
No known key found for this signature in database
GPG Key ID: 0AA2A00D6ACC8B84
2 changed files with 31 additions and 31 deletions

View File

@ -37,24 +37,33 @@ export function buildManageButtons(attrs, currentUser, siteSettings) {
contents.push(buttonAtts); contents.push(buttonAtts);
} }
if (attrs.canManage) { if (currentUser.staff) {
contents.push({ if (attrs.noticeType) {
icon: "cog",
label: "post.controls.rebake",
action: "rebakePost",
className: "btn-default rebuild-html"
});
if (attrs.hidden) {
contents.push({ contents.push({
icon: "far-eye", icon: "asterisk",
label: "post.controls.unhide", label: "post.controls.remove_post_notice",
action: "unhidePost", action: "removeNotice",
className: "btn-default unhide-post" className: "btn-default remove-notice"
});
} else {
contents.push({
icon: "asterisk",
label: "post.controls.add_post_notice",
action: "addNotice",
className: "btn-default add-notice"
}); });
} }
} }
if (attrs.canManage && attrs.hidden) {
contents.push({
icon: "far-eye",
label: "post.controls.unhide",
action: "unhidePost",
className: "btn-default unhide-post"
});
}
if (currentUser.admin) { if (currentUser.admin) {
contents.push({ contents.push({
icon: "user", icon: "user",
@ -111,22 +120,13 @@ export function buildManageButtons(attrs, currentUser, siteSettings) {
} }
} }
if (currentUser.staff) { if (attrs.canManage) {
if (attrs.noticeType) { contents.push({
contents.push({ icon: "cog",
icon: "asterisk", label: "post.controls.rebake",
label: "post.controls.remove_post_notice", action: "rebakePost",
action: "removeNotice", className: "btn-default rebuild-html"
className: "btn-default remove-notice" });
});
} else {
contents.push({
icon: "asterisk",
label: "post.controls.add_post_notice",
action: "addNotice",
className: "btn-default add-notice"
});
}
} }
return contents; return contents;

View File

@ -2358,8 +2358,8 @@ en:
delete_topic_disallowed_modal: "You don't have permission to delete this topic. If you really want it to be deleted, submit a flag for moderator attention together with reasoning." delete_topic_disallowed_modal: "You don't have permission to delete this topic. If you really want it to be deleted, submit a flag for moderator attention together with reasoning."
delete_topic_disallowed: "you don't have permission to delete this topic" delete_topic_disallowed: "you don't have permission to delete this topic"
delete_topic: "delete topic" delete_topic: "delete topic"
add_post_notice: "Add post notice" add_post_notice: "Add Staff Notice"
remove_post_notice: "Remove post notice" remove_post_notice: "Remove Staff Notice"
actions: actions:
flag: "Flag" flag: "Flag"