FEATURE: Admin interface for adding custom fields for users

This commit is contained in:
Robin Ward
2014-09-25 11:32:08 -04:00
parent a3e2e1fa6e
commit 0fc0533134
23 changed files with 482 additions and 2 deletions

View File

@@ -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