mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Added tooltips to topic admin menu (#7146)
* UX: Added tooltips to topic admin menu * FIX: Prettyfied code * FIX: Fixed typo * Update config/locales/client.en.yml Co-Authored-By: venarius <tim.lange@online.de>
This commit is contained in:
@@ -16,6 +16,7 @@ createWidget("admin-menu-button", {
|
||||
action: attrs.action,
|
||||
icon: attrs.icon,
|
||||
label: attrs.fullLabel || `topic.${attrs.label}`,
|
||||
title: attrs.title,
|
||||
secondaryAction: "hideAdminMenu"
|
||||
})
|
||||
);
|
||||
@@ -136,7 +137,8 @@ export default createWidget("topic-admin-menu", {
|
||||
buttonClass: "btn-default",
|
||||
action: "toggleMultiSelect",
|
||||
icon: "tasks",
|
||||
label: "actions.multi_select"
|
||||
label: "actions.multi_select",
|
||||
title: "topic.actions.multi_select_tooltip"
|
||||
});
|
||||
|
||||
const topic = attrs.topic;
|
||||
@@ -148,7 +150,8 @@ export default createWidget("topic-admin-menu", {
|
||||
buttonClass: "btn-danger",
|
||||
action: "deleteTopic",
|
||||
icon: "far-trash-alt",
|
||||
label: "actions.delete"
|
||||
label: "actions.delete",
|
||||
title: "topic.actions.delete_tooltip"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -158,7 +161,8 @@ export default createWidget("topic-admin-menu", {
|
||||
buttonClass: "btn-default",
|
||||
action: "recoverTopic",
|
||||
icon: "undo",
|
||||
label: "actions.recover"
|
||||
label: "actions.recover",
|
||||
title: "topic.actions.recover_tooltip"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -168,7 +172,8 @@ export default createWidget("topic-admin-menu", {
|
||||
buttonClass: "btn-default",
|
||||
action: "toggleClosed",
|
||||
icon: "unlock",
|
||||
label: "actions.open"
|
||||
label: "actions.open",
|
||||
title: "topic.actions.open_tooltip"
|
||||
});
|
||||
} else {
|
||||
buttons.push({
|
||||
@@ -176,7 +181,8 @@ export default createWidget("topic-admin-menu", {
|
||||
buttonClass: "btn-default",
|
||||
action: "toggleClosed",
|
||||
icon: "lock",
|
||||
label: "actions.close"
|
||||
label: "actions.close",
|
||||
title: "topic.actions.close_tooltip"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -185,7 +191,8 @@ export default createWidget("topic-admin-menu", {
|
||||
buttonClass: "btn-default",
|
||||
action: "showTopicStatusUpdate",
|
||||
icon: "far-clock",
|
||||
label: "actions.timed_update"
|
||||
label: "actions.timed_update",
|
||||
title: "topic.actions.timed_update_tooltip"
|
||||
});
|
||||
|
||||
const isPrivateMessage = topic.get("isPrivateMessage");
|
||||
@@ -197,7 +204,10 @@ export default createWidget("topic-admin-menu", {
|
||||
buttonClass: "btn-default",
|
||||
action: "showFeatureTopic",
|
||||
icon: "thumbtack",
|
||||
label: featured ? "actions.unpin" : "actions.pin"
|
||||
label: featured ? "actions.unpin" : "actions.pin",
|
||||
title: featured
|
||||
? "topic.actions.unpin_tooltip"
|
||||
: "topic.actions.pin_tooltip"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -207,7 +217,8 @@ export default createWidget("topic-admin-menu", {
|
||||
buttonClass: "btn-default",
|
||||
action: "showChangeTimestamp",
|
||||
icon: "calendar-alt",
|
||||
label: "change_timestamp.title"
|
||||
label: "change_timestamp.title",
|
||||
title: "topic.change_timestamp.tooltip"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -216,7 +227,8 @@ export default createWidget("topic-admin-menu", {
|
||||
buttonClass: "btn-default",
|
||||
action: "resetBumpDate",
|
||||
icon: "anchor",
|
||||
label: "actions.reset_bump_date"
|
||||
label: "actions.reset_bump_date",
|
||||
title: "topic.actions.reset_bump_date_tooltip"
|
||||
});
|
||||
|
||||
if (!isPrivateMessage) {
|
||||
@@ -225,7 +237,10 @@ export default createWidget("topic-admin-menu", {
|
||||
buttonClass: "btn-default",
|
||||
action: "toggleArchived",
|
||||
icon: "folder",
|
||||
label: topic.get("archived") ? "actions.unarchive" : "actions.archive"
|
||||
label: topic.get("archived") ? "actions.unarchive" : "actions.archive",
|
||||
title: topic.get("archived")
|
||||
? "topic.actions.unarchive_tooltip"
|
||||
: "topic.actions.archive_tooltip"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -235,7 +250,10 @@ export default createWidget("topic-admin-menu", {
|
||||
buttonClass: "btn-default",
|
||||
action: "toggleVisibility",
|
||||
icon: visible ? "far-eye-slash" : "far-eye",
|
||||
label: visible ? "actions.invisible" : "actions.visible"
|
||||
label: visible ? "actions.invisible" : "actions.visible",
|
||||
title: visible
|
||||
? "topic.actions.invisible_tooltip"
|
||||
: "topic.actions.visible_tooltip"
|
||||
});
|
||||
|
||||
if (details.get("can_convert_topic")) {
|
||||
@@ -246,7 +264,12 @@ export default createWidget("topic-admin-menu", {
|
||||
? "convertToPublicTopic"
|
||||
: "convertToPrivateMessage",
|
||||
icon: isPrivateMessage ? "comment" : "envelope",
|
||||
label: isPrivateMessage ? "actions.make_public" : "actions.make_private"
|
||||
label: isPrivateMessage
|
||||
? "actions.make_public"
|
||||
: "actions.make_private",
|
||||
title: isPrivateMessage
|
||||
? "topic.actions.make_public_tooltip"
|
||||
: "topic.actions.make_private_tooltip"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -255,7 +278,8 @@ export default createWidget("topic-admin-menu", {
|
||||
action: "showModerationHistory",
|
||||
buttonClass: "btn-default",
|
||||
icon: "list",
|
||||
fullLabel: "admin.flags.moderation_history"
|
||||
fullLabel: "admin.flags.moderation_history",
|
||||
title: "admin.flags.moderation_history_tooltip"
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user