mirror of
https://github.com/discourse/discourse.git
synced 2025-04-17 12:49:04 +08:00
ES6: Enable compatibility layer for routes
This commit is contained in:
parent
75c477a9aa
commit
fd3ceae1d6
@ -1,4 +1,4 @@
|
|||||||
Discourse.UserBadgesRoute = Discourse.Route.extend({
|
export default Discourse.Route.extend({
|
||||||
model: function() {
|
model: function() {
|
||||||
return Discourse.UserBadge.findByUsername(this.modelFor('user').get('username_lower'), {grouped: true});
|
return Discourse.UserBadge.findByUsername(this.modelFor('user').get('username_lower'), {grouped: true});
|
||||||
},
|
},
|
||||||
|
@ -68,7 +68,7 @@ module Tilt
|
|||||||
# For backwards compatibility with plugins, for now export the Global format too.
|
# For backwards compatibility with plugins, for now export the Global format too.
|
||||||
# We should eventually have an upgrade system for plugins to use ES6 or some other
|
# We should eventually have an upgrade system for plugins to use ES6 or some other
|
||||||
# resolve based API.
|
# resolve based API.
|
||||||
if ENV['DISCOURSE_NO_CONSTANTS'].nil? && scope.logical_path =~ /discourse\/(controllers|components|views)\/(.*)/
|
if ENV['DISCOURSE_NO_CONSTANTS'].nil? && scope.logical_path =~ /discourse\/(controllers|components|views|routes)\/(.*)/
|
||||||
type = Regexp.last_match[1]
|
type = Regexp.last_match[1]
|
||||||
file_name = Regexp.last_match[2].gsub(/[\-\/]/, '_')
|
file_name = Regexp.last_match[2].gsub(/[\-\/]/, '_')
|
||||||
class_name = file_name.classify
|
class_name = file_name.classify
|
||||||
|
Loading…
x
Reference in New Issue
Block a user