diff --git a/app/assets/stylesheets/lib/orbit_bar/orbit-bar.scss.erb b/app/assets/stylesheets/lib/orbit_bar/orbit-bar.scss.erb index a987707..8b60f83 100644 --- a/app/assets/stylesheets/lib/orbit_bar/orbit-bar.scss.erb +++ b/app/assets/stylesheets/lib/orbit_bar/orbit-bar.scss.erb @@ -468,4 +468,24 @@ $orbit-bar-bgc-lighter: lighten($orbit-bar-bgc, 20%) !default; } } } -} \ No newline at end of file +} + + +// Page doesn't exist error message +.modal { + .modal-title { + font-weight: bold; + } + .modal-dialog { + width: 300px; + margin: 130px auto; + } + + .modal-footer { + margin: 0; + padding: 10px 10px 10px; + } + p { + font-size: 16px; + } +} diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b90d049..1a7286b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -347,12 +347,16 @@ module ApplicationHelper def switch_language(loc) url = request.original_fullpath - locale = url.include?("zh_cn") ? :zh_cn : I18n.locale - url = url.gsub("/#{locale.to_s}/","/#{loc.to_s}/") url = url.gsub("locale=#{locale.to_s}","locale=#{loc.to_s}") if url == request.original_fullpath url = url + "#{url.include?("?") ? "&" : "?"}locale=#{loc.to_s}" if url == request.original_fullpath and (!url.include?('/'+locale.to_s) or !url.include?(locale.to_s+'=')) + if params["page_id"] + page = Page.where(:page_id => params["page_id"]).first rescue nil + if !page.nil? + url = "#language_alert" if !page.enabled_for.include? loc.to_s + end + end url end diff --git a/app/views/orbit_bar/index.html.erb b/app/views/orbit_bar/index.html.erb index 9b78ec7..7a7e597 100644 --- a/app/views/orbit_bar/index.html.erb +++ b/app/views/orbit_bar/index.html.erb @@ -112,11 +112,11 @@