diff --git a/app/assets/stylesheets/ember_cli.scss b/app/assets/stylesheets/ember_cli.scss new file mode 100644 index 00000000000..175fe19cf75 --- /dev/null +++ b/app/assets/stylesheets/ember_cli.scss @@ -0,0 +1,16 @@ +body.requires-ember-cli { + margin: 2rem; + font-family: Arial, Helvetica; + background-color: white; +} + +pre { + background-color: lightgrey; +} + +pre, +code { + padding: 0; + margin: 0; + padding: 0.5rem; +} diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6903b9df652..adad4c685fb 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -94,15 +94,23 @@ class ApplicationController < ActionController::Base end end + def ember_cli_required? + ENV['NO_EMBER_CLI'] != '1' && Rails.env.development? + end + + def application_layout + ember_cli_required? ? "ember_cli" : "application" + end + def set_layout case request.headers["Discourse-Render"] when "desktop" - return "application" + return application_layout when "crawler" return "crawler" end - use_crawler_layout? ? 'crawler' : 'application' + use_crawler_layout? ? 'crawler' : application_layout end class RenderEmpty < StandardError; end diff --git a/app/views/layouts/ember_cli.html.erb b/app/views/layouts/ember_cli.html.erb new file mode 100644 index 00000000000..dd4e070c54c --- /dev/null +++ b/app/views/layouts/ember_cli.html.erb @@ -0,0 +1,27 @@ + + +
+ +To run Ember CLI in development mode, please do the following:
+ +$ bin/ember-cli
+
+ If it's your first time starting Ember CLI you'll have to run yarn:
+ +$ cd app/assets/javascripts/discourse && yarn
+
+ Then visit the following URL to use Discourse:
+ + http://localhost:4200 +