diff --git a/app/assets/javascripts/validator.js b/app/assets/javascripts/validator.js index 57301b8..dc19069 100644 --- a/app/assets/javascripts/validator.js +++ b/app/assets/javascripts/validator.js @@ -31,6 +31,10 @@ var FormValidator = function(form){ email : function(value){ var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(value); + }, + url : function(value){ + var reg = new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/); + return reg.test(value); } } 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 88707f2..ad1e066 100644 --- a/app/assets/stylesheets/lib/orbit_bar/orbit-bar.scss.erb +++ b/app/assets/stylesheets/lib/orbit_bar/orbit-bar.scss.erb @@ -41,7 +41,7 @@ $orbit-bar-bgc-lighter: lighten($orbit-bar-bgc, 20%) !default; color: #FFF; font-family: 'Chivo'; i { - display: block; + display: inline-block; width: 50px; height: 40px; line-height: 40px; @@ -51,6 +51,13 @@ $orbit-bar-bgc-lighter: lighten($orbit-bar-bgc, 20%) !default; text-align: center; } } + .orbit-bar-language-icon { + width: 30px; + } + .orbit-bar-language-text { + display: inline-block; + vertical-align: top; + } } #orbit-bar { position: fixed; @@ -402,6 +409,9 @@ $orbit-bar-bgc-lighter: lighten($orbit-bar-bgc, 20%) !default; } } } + #language { + padding-left: 0; + } label { padding: 0; margin-bottom: 0; @@ -470,6 +480,8 @@ $orbit-bar-bgc-lighter: lighten($orbit-bar-bgc, 20%) !default; } .orbit-bar-title { display: block; + height: 40px; + line-height: 40px; } ul.orbit-bar-search-sign-language { display: none; diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 864e8b1..3b3f4bb 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -119,7 +119,11 @@ class PagesController < ApplicationController end render :html => render_final_page("#{module_app}/#{params[:target_action]}",page,layout).html_safe else - render :file => "#{Rails.root}/public/404.html", :layout => false, :status => :not_found + if Site.first.enable_redirect_index + redirect_to root_url + else + render :file => "#{Rails.root}/public/404.html", :layout => false, :status => :not_found + end end else render :file => "#{Rails.root}/public/404.html", :layout => false, :status => :not_found diff --git a/app/helpers/admin/module_store_helper.rb b/app/helpers/admin/module_store_helper.rb index 6051a88..5f8f64d 100644 --- a/app/helpers/admin/module_store_helper.rb +++ b/app/helpers/admin/module_store_helper.rb @@ -5,7 +5,7 @@ module Admin::ModuleStoreHelper extensions_to_update = get_extensions_to_update @extensions_to_update_count = extensions_to_update.count built_in_extensions = get_extension_from_file("built_in",extensions_to_update) - # built_in_extensions.concat(get_extension_from_file("downloaded",extensions_to_update)) + built_in_extensions.concat(get_extension_from_file("downloaded",extensions_to_update)) return built_in_extensions end diff --git a/app/models/site.rb b/app/models/site.rb index ed4f3c7..f58d7ba 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -23,6 +23,7 @@ class Site field :mobile_api_openness_on, :type => Boolean, :default => false field :desktop_closed, :type => Boolean, :default => false field :enable_language_detection, :type => Boolean, :default => false + field :enable_redirect_index, :type => Boolean, :default => false field :enable_zh_cn, :type => Boolean, :default => true field :default_locale, :default => "zh_tw" field :mobile_on, :type => Boolean, :default => false diff --git a/app/views/admin/sites/preference.html.erb b/app/views/admin/sites/preference.html.erb index e959128..e5531d1 100644 --- a/app/views/admin/sites/preference.html.erb +++ b/app/views/admin/sites/preference.html.erb @@ -185,6 +185,14 @@ +