mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-02 11:59:17 -05:00
28 lines
580 B
JavaScript
28 lines
580 B
JavaScript
export function buildGroupPage(type) {
|
|
return Discourse.Route.extend({
|
|
type,
|
|
|
|
titleToken() {
|
|
return I18n.t(`groups.${type}`);
|
|
},
|
|
|
|
model() {
|
|
return this.modelFor("group").findPosts({ type });
|
|
},
|
|
|
|
setupController(controller, model) {
|
|
this.controllerFor('group-posts').setProperties({ model, type });
|
|
this.controllerFor("group").set("showing", type);
|
|
},
|
|
|
|
renderTemplate() {
|
|
this.render('group-posts');
|
|
},
|
|
|
|
actions: {
|
|
didTransition() { return true; }
|
|
}
|
|
});
|
|
}
|
|
|
|
export default buildGroupPage('posts');
|