diff --git a/app/assets/javascripts/discourse/components/categories-admin-dropdown.js.es6 b/app/assets/javascripts/discourse/components/categories-admin-dropdown.js.es6 new file mode 100644 index 00000000000..ac53485198d --- /dev/null +++ b/app/assets/javascripts/discourse/components/categories-admin-dropdown.js.es6 @@ -0,0 +1,37 @@ +import { iconHTML } from 'discourse/helpers/fa-icon'; +import DropdownButton from 'discourse/components/dropdown-button'; +import computed from "ember-addons/ember-computed-decorators"; + +export default DropdownButton.extend({ + buttonExtraClasses: 'no-text', + title: '', + text: iconHTML('bars') + ' ' + iconHTML('caret-down'), + classNames: ['category-notification-menu', 'category-admin-menu'], + + @computed() + dropDownContent() { + const includeReorder = this.get('siteSettings.fixed_category_positions'); + const items = [ + { id: 'createCategory', + title: I18n.t('category.create'), + description: I18n.t('category.create_long'), + styleClasses: 'fa fa-plus' } + ]; + if (includeReorder) { + items.push({ + id: 'reorderCategories', + title: I18n.t('categories.reorder.title'), + description: I18n.t('categories.reorder.title_long'), + styleClasses: 'fa fa-random' + }); + } + return items; + }, + + // sendAction() is pretty silly if you ask me + actionFor_createCategory: 'createCategory', + actionFor_reorderCategories: 'reorderCategories', + clicked(id) { + this.sendAction('actionFor_' + id); + } +}); diff --git a/app/assets/javascripts/discourse/components/dropdown-button.js.es6 b/app/assets/javascripts/discourse/components/dropdown-button.js.es6 index 99d211bbe38..0037ec17f2a 100644 --- a/app/assets/javascripts/discourse/components/dropdown-button.js.es6 +++ b/app/assets/javascripts/discourse/components/dropdown-button.js.es6 @@ -29,9 +29,7 @@ export default Ember.Component.extend(StringBuffer, { buffer.push("

" + title + "

"); } - buffer.push(""); + buffer.push(``); buffer.push("