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.
This commit is contained in:
Robin Ward 2015-01-15 15:56:53 -05:00
parent e4e239c159
commit 987504c6ab
7 changed files with 11 additions and 11 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -12,7 +12,7 @@
<%- unless customization_disabled? %>
<%= raw SiteCustomization.custom_head_tag(session[:preview_style]) %>
<%- end %>
<%= yield(:no_js_head) %>
<%= yield(:no_ember_head) %>
</head>
<body>
<%- unless customization_disabled? %>

View File

@ -9,7 +9,7 @@
<% end %>
</div>
<%- content_for(:no_js_head) do %>
<%- content_for(:no_ember_head) do %>
<%= script "vendor" %>
<%- end %>