mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: Add a title
to the groups pages
This commit is contained in:
parent
b0f7e4ba00
commit
215eae9972
5 changed files with 22 additions and 12 deletions
|
@ -1,4 +1,9 @@
|
||||||
export default Discourse.Route.extend({
|
export default Discourse.Route.extend({
|
||||||
|
|
||||||
|
titleToken() {
|
||||||
|
return I18n.t('groups.members');
|
||||||
|
},
|
||||||
|
|
||||||
model() {
|
model() {
|
||||||
return this.modelFor("group");
|
return this.modelFor("group");
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,6 +2,10 @@ export function buildGroupPage(type) {
|
||||||
return Discourse.Route.extend({
|
return Discourse.Route.extend({
|
||||||
type,
|
type,
|
||||||
|
|
||||||
|
titleToken() {
|
||||||
|
return I18n.t(`groups.${type}`);
|
||||||
|
},
|
||||||
|
|
||||||
model() {
|
model() {
|
||||||
return this.modelFor("group").findPosts({ type });
|
return this.modelFor("group").findPosts({ type });
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,25 +2,25 @@ import Group from 'discourse/models/group';
|
||||||
|
|
||||||
export default Discourse.Route.extend({
|
export default Discourse.Route.extend({
|
||||||
|
|
||||||
model: function(params) {
|
titleToken() {
|
||||||
|
return [ this.modelFor('group').get('name') ];
|
||||||
|
},
|
||||||
|
|
||||||
|
model(params) {
|
||||||
return Group.find(params.name);
|
return Group.find(params.name);
|
||||||
},
|
},
|
||||||
|
|
||||||
serialize: function(model) {
|
serialize(model) {
|
||||||
return { name: model.get('name').toLowerCase() };
|
return { name: model.get('name').toLowerCase() };
|
||||||
},
|
},
|
||||||
|
|
||||||
afterModel: function(model) {
|
afterModel(model) {
|
||||||
var self = this;
|
return Group.findGroupCounts(model.get('name')).then(counts => {
|
||||||
return Group.findGroupCounts(model.get('name')).then(function (counts) {
|
this.set('counts', counts);
|
||||||
self.set('counts', counts);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
setupController: function(controller, model) {
|
setupController(controller, model) {
|
||||||
controller.setProperties({
|
controller.setProperties({ model, counts: this.get('counts') });
|
||||||
model: model,
|
|
||||||
counts: this.get('counts')
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -388,6 +388,7 @@ en:
|
||||||
selector_placeholder: "Add members"
|
selector_placeholder: "Add members"
|
||||||
owner: "owner"
|
owner: "owner"
|
||||||
visible: "Group is visible to all users"
|
visible: "Group is visible to all users"
|
||||||
|
index: "Groups"
|
||||||
title:
|
title:
|
||||||
one: "group"
|
one: "group"
|
||||||
other: "groups"
|
other: "groups"
|
||||||
|
|
Loading…
Reference in a new issue