2014-11-19 14:37:43 -05:00
|
|
|
import UserTopicListRoute from "discourse/routes/user-topic-list";
|
|
|
|
|
|
|
|
// A helper to build a user topic list route
|
2015-07-31 10:53:18 -04:00
|
|
|
export default (viewName, path) => {
|
|
|
|
return UserTopicListRoute.extend({
|
2014-11-19 14:37:43 -05:00
|
|
|
userActionType: Discourse.UserAction.TYPES.messages_received,
|
|
|
|
|
|
|
|
actions: {
|
2015-07-31 10:53:18 -04:00
|
|
|
didTransition() {
|
2014-11-19 14:37:43 -05:00
|
|
|
this.controllerFor("user-topics-list")._showFooter();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2015-07-31 10:53:18 -04:00
|
|
|
model() {
|
|
|
|
return this.store.findFiltered("topicList", { filter: "topics/" + path + "/" + this.modelFor("user").get("username_lower") });
|
2014-11-19 14:37:43 -05:00
|
|
|
},
|
|
|
|
|
2015-07-31 10:53:18 -04:00
|
|
|
setupController() {
|
2014-11-19 14:37:43 -05:00
|
|
|
this._super.apply(this, arguments);
|
|
|
|
|
2015-07-31 10:53:18 -04:00
|
|
|
this.controllerFor("user-topics-list").setProperties({
|
2014-11-19 14:37:43 -05:00
|
|
|
hideCategory: true,
|
2015-12-29 22:49:40 -05:00
|
|
|
showPosters: true,
|
2015-12-22 19:09:17 -05:00
|
|
|
canBulkSelect: true,
|
|
|
|
selected: []
|
2014-11-19 14:37:43 -05:00
|
|
|
});
|
|
|
|
|
2015-12-22 19:09:17 -05:00
|
|
|
this.controllerFor("user-private-messages").set("archive", false);
|
|
|
|
this.controllerFor("user-private-messages").set("pmView", viewName);
|
2015-08-26 16:55:01 -04:00
|
|
|
this.searchService.set('contextType', 'private_messages');
|
2014-12-03 21:46:52 -05:00
|
|
|
},
|
|
|
|
|
2015-07-31 10:53:18 -04:00
|
|
|
deactivate() {
|
2015-08-26 16:55:01 -04:00
|
|
|
this.searchService.set('contextType', 'private_messages');
|
2014-11-19 14:37:43 -05:00
|
|
|
}
|
|
|
|
});
|
2015-07-31 10:53:18 -04:00
|
|
|
};
|