mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Admin interface for adding custom fields for users
This commit is contained in:
@@ -70,7 +70,7 @@ module Tilt
|
||||
# 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
|
||||
# resolve based API.
|
||||
if ENV['DISCOURSE_NO_CONSTANTS'].nil? && scope.logical_path =~ /(discourse|admin)\/(controllers|components|views|routes|mixins)\/(.*)/
|
||||
if ENV['DISCOURSE_NO_CONSTANTS'].nil? && scope.logical_path =~ /(discourse|admin)\/(controllers|components|views|routes|mixins|models)\/(.*)/
|
||||
type = Regexp.last_match[2]
|
||||
file_name = Regexp.last_match[3].gsub(/[\-\/]/, '_')
|
||||
class_name = file_name.classify
|
||||
@@ -87,6 +87,7 @@ module Tilt
|
||||
# HAX
|
||||
result = "Controller" if result == "ControllerController"
|
||||
result.gsub!(/Mixin$/, '')
|
||||
result.gsub!(/Model$/, '')
|
||||
|
||||
@output << "\n\nDiscourse.#{result} = require('#{require_name}').default;\n"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user