mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 03:52:47 +08:00
![Régis Hanol](/assets/img/avatar_default.png)
- new "show-footer" mixins - converted most of the routes to ES6 - FIX: handling of "indexStream" in user pages There will now be a footer on all the following pages - /exception - /about - /latest - /new - /unread - /starred - /top - /categories - /c/:category - /c/:category/l/latest - /c/:category/l/new - /c/:category/l/unread - /c/:category/l/top - /t/:topic/:id - /groups/:name/members - /user/activity - /user/activity/topics - /user/activity/posts - /user/activity/replies - /user/activity/likes-given - /user/activity/likes-received - /user/activity/bookmarks - /user/activity/starred - /user/badges - /user/notifications - /user/flagged-posts - /user/deleted-posts - /user/private-messages - /user/private-messages/mine - /user/private-messages/unread - /user/invited - /user/:username/preferences - /faq (static pages) - /badges - /badges/:id/:badge
33 lines
855 B
JavaScript
33 lines
855 B
JavaScript
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" });
|
|
}
|
|
});
|
|
}
|