mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Support /group/xyz paths as well as /groups/xyz
This commit is contained in:
@@ -129,7 +129,6 @@ Discourse.URL = Em.Object.createWithMixins({
|
||||
path = path.replace(rootURL, '');
|
||||
}
|
||||
|
||||
|
||||
// Rewrite /my/* urls
|
||||
if (path.indexOf('/my/') === 0) {
|
||||
var currentUser = Discourse.User.current();
|
||||
@@ -141,6 +140,11 @@ Discourse.URL = Em.Object.createWithMixins({
|
||||
}
|
||||
}
|
||||
|
||||
// Rewrite /groups paths
|
||||
if (path.indexOf('/group/') === 0) {
|
||||
path = path.replace('group/', 'groups/');
|
||||
}
|
||||
|
||||
if (this.navigatedToPost(oldPath, path)) { return; }
|
||||
// Schedule a DOM cleanup event
|
||||
Em.run.scheduleOnce('afterRender', Discourse.Route, 'cleanDOM');
|
||||
|
||||
@@ -41,9 +41,11 @@ export default function(filter, extras) {
|
||||
|
||||
setupController: function(controller, model, trans) {
|
||||
|
||||
controller.setProperties(Em.getProperties(trans, _.keys(queryParams).map(function(v){
|
||||
return 'queryParams.' + v;
|
||||
})));
|
||||
if (trans) {
|
||||
controller.setProperties(Em.getProperties(trans, _.keys(queryParams).map(function(v){
|
||||
return 'queryParams.' + v;
|
||||
})));
|
||||
}
|
||||
|
||||
|
||||
var periods = this.controllerFor('discovery').get('periods'),
|
||||
|
||||
Reference in New Issue
Block a user