2017-11-21 05:53:09 -05:00
|
|
|
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
|
2020-02-03 08:22:14 -05:00
|
|
|
import { computed } from "@ember/object";
|
|
|
|
import { setting } from "discourse/lib/computed";
|
2017-10-19 15:51:08 -04:00
|
|
|
|
|
|
|
export default DropdownSelectBoxComponent.extend({
|
2017-11-21 05:53:09 -05:00
|
|
|
pluginApiIdentifiers: ["categories-admin-dropdown"],
|
2020-02-03 08:22:14 -05:00
|
|
|
classNames: ["categories-admin-dropdown"],
|
|
|
|
fixedCateoryPositions: setting("fixed_category_positions"),
|
|
|
|
|
|
|
|
selectKitOptions: {
|
|
|
|
icon: "bars",
|
|
|
|
showFullTitle: false,
|
|
|
|
autoFilterable: false,
|
|
|
|
filterable: false
|
2019-05-28 06:15:12 -04:00
|
|
|
},
|
2017-10-19 15:51:08 -04:00
|
|
|
|
2020-02-03 08:22:14 -05:00
|
|
|
content: computed(function() {
|
2017-10-19 15:51:08 -04:00
|
|
|
const items = [
|
|
|
|
{
|
|
|
|
id: "create",
|
|
|
|
name: I18n.t("category.create"),
|
|
|
|
description: I18n.t("category.create_long"),
|
|
|
|
icon: "plus"
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2020-02-03 08:22:14 -05:00
|
|
|
if (this.fixedCateoryPositions) {
|
2017-10-19 15:51:08 -04:00
|
|
|
items.push({
|
|
|
|
id: "reorder",
|
|
|
|
name: I18n.t("categories.reorder.title"),
|
|
|
|
description: I18n.t("categories.reorder.title_long"),
|
|
|
|
icon: "random"
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
return items;
|
2020-02-03 08:22:14 -05:00
|
|
|
})
|
2017-10-19 15:51:08 -04:00
|
|
|
});
|