From 987504c6ab63c254f78fa72eeac6118baadb25cd Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 15 Jan 2015 15:56:53 -0500 Subject: [PATCH] Rename `no_js` layout to `no_ember` While *sometimes* `no_js` was used for visitors without js (for example disabling it on your browser) it was also used for some pages that were disabled to JS capable browsers, including the 404 page. Even worse, sometimes it was used on pages that *had* Javascript, such as our `/activate-account` route. It has been renamed to `no_ember` to indicate what it really is, a layout for the site that doesn't load our Ember.js application. --- app/controllers/application_controller.rb | 2 +- app/controllers/email_controller.rb | 2 +- app/controllers/invites_controller.rb | 2 +- app/controllers/users/omniauth_callbacks_controller.rb | 2 +- app/controllers/users_controller.rb | 10 +++++----- .../layouts/{no_js.html.erb => no_ember.html.erb} | 2 +- app/views/users/activate_account.html.erb | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) rename app/views/layouts/{no_js.html.erb => no_ember.html.erb} (97%) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6d10f99780b..b3158c509f7 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -126,7 +126,7 @@ class ApplicationController < ActionController::Base # from the above rescue_from blocks will fail because that isn't valid json. render status: error, layout: false, text: (error == 404) ? build_not_found_page(error) : message else - render text: build_not_found_page(error, include_ember ? 'application' : 'no_js') + render text: build_not_found_page(error, include_ember ? 'application' : 'no_ember') end end diff --git a/app/controllers/email_controller.rb b/app/controllers/email_controller.rb index 7fe28798dfd..01d07426cd2 100644 --- a/app/controllers/email_controller.rb +++ b/app/controllers/email_controller.rb @@ -1,6 +1,6 @@ class EmailController < ApplicationController skip_before_filter :check_xhr - layout 'no_js' + layout 'no_ember' before_filter :ensure_logged_in, only: :preferences_redirect skip_before_filter :redirect_to_login_if_required diff --git a/app/controllers/invites_controller.rb b/app/controllers/invites_controller.rb index 3958a7db85c..c5289ce4316 100644 --- a/app/controllers/invites_controller.rb +++ b/app/controllers/invites_controller.rb @@ -163,7 +163,7 @@ class InvitesController < ApplicationController def ensure_new_registrations_allowed unless SiteSetting.allow_new_registrations flash[:error] = I18n.t('login.new_registrations_disabled') - render layout: 'no_js' + render layout: 'no_ember' false end end diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb index e710eda62b7..8c9bf69c574 100644 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ b/app/controllers/users/omniauth_callbacks_controller.rb @@ -48,7 +48,7 @@ class Users::OmniauthCallbacksController < ApplicationController def failure flash[:error] = I18n.t("login.omniauth_error") - render layout: 'no_js' + render layout: 'no_ember' end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 7fd78ab6cf8..06d03a7146e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -312,7 +312,7 @@ class UsersController < ApplicationController end end end - render layout: 'no_js' + render layout: 'no_ember' end def logon_after_password_reset @@ -363,18 +363,18 @@ class UsersController < ApplicationController else flash[:error] = I18n.t('change_email.error') end - render layout: 'no_js' + render layout: 'no_ember' end def account_created @message = session['user_created_message'] expires_now - render layout: 'no_js' + render layout: 'no_ember' end def activate_account expires_now - render layout: 'no_js' + render layout: 'no_ember' end def perform_account_activation @@ -392,7 +392,7 @@ class UsersController < ApplicationController else flash[:error] = I18n.t('activation.already_done') end - render layout: 'no_js' + render layout: 'no_ember' end def send_activation_email diff --git a/app/views/layouts/no_js.html.erb b/app/views/layouts/no_ember.html.erb similarity index 97% rename from app/views/layouts/no_js.html.erb rename to app/views/layouts/no_ember.html.erb index 6b091097515..81097d4e863 100644 --- a/app/views/layouts/no_js.html.erb +++ b/app/views/layouts/no_ember.html.erb @@ -12,7 +12,7 @@ <%- unless customization_disabled? %> <%= raw SiteCustomization.custom_head_tag(session[:preview_style]) %> <%- end %> - <%= yield(:no_js_head) %> + <%= yield(:no_ember_head) %> <%- unless customization_disabled? %> diff --git a/app/views/users/activate_account.html.erb b/app/views/users/activate_account.html.erb index f6847f9376e..3d33bb8270f 100644 --- a/app/views/users/activate_account.html.erb +++ b/app/views/users/activate_account.html.erb @@ -9,7 +9,7 @@ <% end %> -<%- content_for(:no_js_head) do %> +<%- content_for(:no_ember_head) do %> <%= script "vendor" %> <%- end %>