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/controllers/user-activity.js.es6
Sam 01281b6364 FIX: hide bookmarks tab on other peoples profile (unless self or admin)
FIX: missing download my posts button
FIX: moderators had no way of seeing responses and edits etc
2015-12-31 15:05:23 +11:00

20 lines
740 B
JavaScript

export default Ember.Controller.extend({
userActionType: null,
needs: ["application", "user"],
viewingSelf: Em.computed.alias("controllers.user.viewingSelf"),
showBookmarks: Em.computed.alias("controllers.user.showBookmarks"),
_showFooter: function() {
var showFooter;
if (this.get("userActionType")) {
const stat = _.find(this.get("model.stats"), { action_type: this.get("userActionType") });
showFooter = stat && stat.count <= this.get("model.stream.itemsLoaded");
} else {
showFooter = this.get("model.statsCountNonPM") <= this.get("model.stream.itemsLoaded");
}
this.set("controllers.application.showFooter", showFooter);
}.observes("userActionType", "model.stream.itemsLoaded")
});