mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 10:13:43 +08:00
33 lines
855 B
Plaintext
33 lines
855 B
Plaintext
![]() |
import ShowFooter from "discourse/mixins/show-footer";
|
||
|
|
||
|
export default function (filter) {
|
||
|
return Discourse.Route.extend(ShowFooter, {
|
||
|
actions: {
|
||
|
didTransition: function() {
|
||
|
this.controllerFor('user').set('indexStream', true);
|
||
|
this.controllerFor("user-posts")._showFooter();
|
||
|
return true;
|
||
|
}
|
||
|
},
|
||
|
|
||
|
model: function () {
|
||
|
return this.modelFor("user").get("postsStream");
|
||
|
},
|
||
|
|
||
|
afterModel: function () {
|
||
|
return this.modelFor("user").get("postsStream").filterBy(filter);
|
||
|
},
|
||
|
|
||
|
setupController: function(controller, model) {
|
||
|
// initialize "canLoadMore"
|
||
|
model.set("canLoadMore", model.get("itemsLoaded") === 60);
|
||
|
|
||
|
this.controllerFor("user-posts").set("model", model);
|
||
|
},
|
||
|
|
||
|
renderTemplate: function() {
|
||
|
this.render("user/posts", { into: "user" });
|
||
|
}
|
||
|
});
|
||
|
}
|