mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 02:19:27 +08:00
Support /group/xyz
paths as well as /groups/xyz
This commit is contained in:
parent
366d7e892c
commit
216f718607
|
@ -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'),
|
||||
|
|
|
@ -269,6 +269,10 @@ Discourse::Application.routes.draw do
|
|||
get 'counts'
|
||||
end
|
||||
|
||||
# In case people try the wrong URL
|
||||
get '/group/:id', to: redirect('/groups/%{id}')
|
||||
get '/group/:id/members', to: redirect('/groups/%{id}/members')
|
||||
|
||||
resources :posts do
|
||||
put "bookmark"
|
||||
put "wiki"
|
||||
|
|
Loading…
Reference in New Issue
Block a user