This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/routes/group-posts.js.es6
2016-07-25 14:24:43 -04:00

29 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');