This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/d-navigation.js.es6
2018-07-30 11:56:48 -04:00

36 lines
910 B
JavaScript

import computed from "ember-addons/ember-computed-decorators";
export default Ember.Component.extend({
tagName: "",
@computed("category")
showCategoryNotifications(category) {
return category && this.currentUser;
},
@computed()
categories() {
return this.site.get("categoriesList");
},
@computed("hasDraft")
createTopicLabel(hasDraft) {
return hasDraft ? "topic.open_draft" : "topic.create";
},
@computed("category.can_edit")
showCategoryEdit: canEdit => canEdit,
@computed("filterMode", "category", "noSubcategories")
navItems(filterMode, category, noSubcategories) {
// we don't want to show the period in the navigation bar since it's in a dropdown
if (filterMode.indexOf("top/") === 0) {
filterMode = filterMode.replace("top/", "");
}
return Discourse.NavItem.buildList(category, {
filterMode,
noSubcategories
});
}
});