Updated fixes for site info - desktop openess, title always displayed
This commit is contained in:
1 parent
2bcecc322e
commit
155039ac16
10 files changed
+28
-35
No files matched your search
@@ -60,7 +60,7 @@ class Admin::SitesController < OrbitBackendController
|
||||
end
|
||||
|
||||
def preference
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -140,7 +140,9 @@ class ApplicationController < ActionController::Base
|
||||
# update session if passed
|
||||
session[:locale] = params[:locale] if params[:locale]
|
||||
browser_locale = condition = nil
|
||||
default_locale = @site.default_locale if @site.default_locale.present?
|
||||
# check if locale is valid for non site pages
|
||||
|
||||
if LIST[:forbidden_item_names].include?(env['PATH_INFO'].split('/')[1].to_s)
|
||||
condition = VALID_LOCALES.include?(session[:locale])
|
||||
elsif session[:locale]
|
||||
@@ -152,7 +154,7 @@ class ApplicationController < ActionController::Base
|
||||
browser_locale = request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first rescue nil
|
||||
condition = @site.in_use_locales.include?(browser_locale)
|
||||
end
|
||||
session[:locale] = condition ? (default_locale || browser_locale || session[:locale]) : I18n.default_locale.to_s
|
||||
session[:locale] = condition ? ( browser_locale || session[:locale] || default_locale) : I18n.default_locale.to_s
|
||||
I18n.locale = session[:locale].to_sym
|
||||
@site_in_use_locales = site_locales_default_head(@site.in_use_locales)
|
||||
@site_valid_locales = site_locales_default_head(@site.valid_locales)
|
||||
|
||||
@@ -340,10 +340,11 @@ class DesktopController< ApplicationController
|
||||
render :json=>b.to_json
|
||||
end
|
||||
|
||||
private
|
||||
protected
|
||||
|
||||
def check_desktop_open
|
||||
if Me.desktop_closed && current_user.nil? #Need to be change
|
||||
@site = Site.first
|
||||
if @site.desktop_closed #Need to be change
|
||||
redirect_to '/admin/dashboards'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user