FIX: Add a `title` to the groups pages

This commit is contained in:
Robin Ward 2016-07-25 14:21:27 -04:00
parent b0f7e4ba00
commit 215eae9972
5 changed files with 22 additions and 12 deletions

View File

@ -1,4 +1,9 @@
export default Discourse.Route.extend({
titleToken() {
return I18n.t('groups.members');
},
model() {
return this.modelFor("group");
},

View File

@ -2,6 +2,10 @@ export function buildGroupPage(type) {
return Discourse.Route.extend({
type,
titleToken() {
return I18n.t(`groups.${type}`);
},
model() {
return this.modelFor("group").findPosts({ type });
},

View File

@ -2,25 +2,25 @@ import Group from 'discourse/models/group';
export default Discourse.Route.extend({
model: function(params) {
titleToken() {
return [ this.modelFor('group').get('name') ];
},
model(params) {
return Group.find(params.name);
},
serialize: function(model) {
serialize(model) {
return { name: model.get('name').toLowerCase() };
},
afterModel: function(model) {
var self = this;
return Group.findGroupCounts(model.get('name')).then(function (counts) {
self.set('counts', counts);
afterModel(model) {
return Group.findGroupCounts(model.get('name')).then(counts => {
this.set('counts', counts);
});
},
setupController: function(controller, model) {
controller.setProperties({
model: model,
counts: this.get('counts')
});
setupController(controller, model) {
controller.setProperties({ model, counts: this.get('counts') });
}
});

View File

@ -1 +1 @@
empty
empty

View File

@ -388,6 +388,7 @@ en:
selector_placeholder: "Add members"
owner: "owner"
visible: "Group is visible to all users"
index: "Groups"
title:
one: "group"
other: "groups"