mirror of
https://github.com/discourse/discourse.git
synced 2025-02-10 06:58:45 +08:00
30 lines
720 B
JavaScript
30 lines
720 B
JavaScript
export function buildGroupPage(type) {
|
|
return Discourse.Route.extend({
|
|
type,
|
|
|
|
titleToken() {
|
|
return I18n.t(`groups.${type}`);
|
|
},
|
|
|
|
model(params, transition) {
|
|
let categoryId = Ember.get(transition, 'queryParams.category_id');
|
|
return this.modelFor("group").findPosts({ type, categoryId });
|
|
},
|
|
|
|
setupController(controller, model) {
|
|
this.controllerFor('group-activity-posts').setProperties({ model, type, canLoadMore: true });
|
|
this.controllerFor("group").set("showing", type);
|
|
},
|
|
|
|
renderTemplate() {
|
|
this.render('group-activity-posts');
|
|
},
|
|
|
|
actions: {
|
|
didTransition() { return true; }
|
|
}
|
|
});
|
|
}
|
|
|
|
export default buildGroupPage('posts');
|