update files
This commit is contained in:
parent
161290948a
commit
abca9b7f26
|
@ -92,3 +92,10 @@ if ( jQuery.ajax ) {
|
||||||
return jQXHR;
|
return jQXHR;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
$(function(){
|
||||||
|
$('input[type!="checkbox"],select,textarea').not('[type="submit"]').on('focus', function() {
|
||||||
|
$([document.documentElement, document.body]).animate({
|
||||||
|
scrollTop: $(this).offset().top -200
|
||||||
|
}, 100);
|
||||||
|
});
|
||||||
|
})
|
|
@ -6,6 +6,7 @@ class Site
|
||||||
DEBUG = false
|
DEBUG = false
|
||||||
has_many :page_sets, :autosave => true, :dependent => :destroy
|
has_many :page_sets, :autosave => true, :dependent => :destroy
|
||||||
accepts_nested_attributes_for :page_sets, :allow_destroy => true
|
accepts_nested_attributes_for :page_sets, :allow_destroy => true
|
||||||
|
field :update_flag, type: Boolean, default: true
|
||||||
field :title, as: :slug_title, type: String, localize: true
|
field :title, as: :slug_title, type: String, localize: true
|
||||||
field :school, type: String
|
field :school, type: String
|
||||||
field :department, type: String
|
field :department, type: String
|
||||||
|
@ -44,13 +45,22 @@ class Site
|
||||||
field :enable_last_update, type: Boolean, :default => false
|
field :enable_last_update, type: Boolean, :default => false
|
||||||
field :personal_plugins_sort, type: Array, :default => []
|
field :personal_plugins_sort, type: Array, :default => []
|
||||||
field :sign_up_roles, type: Array, :default => []
|
field :sign_up_roles, type: Array, :default => []
|
||||||
|
field :required_sign_up_attributes , :type => Hash , :default => {}
|
||||||
field :mobile_orbit_bar_title, localize: true
|
field :mobile_orbit_bar_title, localize: true
|
||||||
field :google_oauth_enabled, :type => Boolean, :default => false
|
field :google_oauth_enabled, :type => Boolean, :default => false
|
||||||
field :google_client_id
|
field :google_client_id
|
||||||
field :google_client_secret
|
field :google_client_secret
|
||||||
|
|
||||||
|
field :gmail_oauth2_enabled, :type => Boolean, :default => false
|
||||||
|
field :gmail_login_flag, :type => Boolean, :default => false
|
||||||
|
field :gmail_client_id
|
||||||
|
field :gmail_client_secret
|
||||||
|
field :gmail_access_token
|
||||||
|
field :gmail_refresh_token
|
||||||
|
field :gmail
|
||||||
|
|
||||||
field :meta_tags
|
field :meta_tags
|
||||||
field :every_page_sharer, type: Array, :default => ["facebook","twitter","google","printer"]
|
field :every_page_sharer, type: Array, :default => ["facebook","line","twitter","google","printer"]
|
||||||
|
|
||||||
field :sync_enabled, type: Boolean, :default => false
|
field :sync_enabled, type: Boolean, :default => false
|
||||||
field :sync_rake_task
|
field :sync_rake_task
|
||||||
|
@ -60,44 +70,55 @@ class Site
|
||||||
field :home_link_1, :type => String, :default=>"/"
|
field :home_link_1, :type => String, :default=>"/"
|
||||||
field :site_title, :type => Hash, :default=>{:zh_tw=>"主頁",:en=>"home_page"}
|
field :site_title, :type => Hash, :default=>{:zh_tw=>"主頁",:en=>"home_page"}
|
||||||
field :site_title_1, :type => Hash, :default=>{:zh_tw=>"主頁",:en=>"home_page"}
|
field :site_title_1, :type => Hash, :default=>{:zh_tw=>"主頁",:en=>"home_page"}
|
||||||
|
field :orbitbar_language_login_btn_mobile_configuration , type: String, :default => ""
|
||||||
field :is_hidden_orbit_bar , type: Boolean, :default => false
|
field :is_hidden_orbit_bar , type: Boolean, :default => false
|
||||||
field :orbit_bar_background_color , type: String, :default => ""
|
field :orbit_bar_background_color , type: String, :default => ""
|
||||||
field :orbit_bar_text_color , type: String, :default => ""
|
field :orbit_bar_background_hover_color
|
||||||
|
field :orbit_bar_text_color , type: String, :default => "#ffffff"
|
||||||
|
field :orbit_bar_text_hover_color
|
||||||
field :orbit_bar_submenu_background_color , type: String, :default => ""
|
field :orbit_bar_submenu_background_color , type: String, :default => ""
|
||||||
field :orbit_bar_submenu_text_color , type: String, :default => ""
|
field :orbit_bar_submenu_text_color , type: String, :default => "#ffffff"
|
||||||
field :orbit_bar_animation_time , type: String, :default => "0.3s"
|
field :orbit_bar_animation_time , type: String, :default => "0.3s"
|
||||||
|
field :login_text , type: String, :default => "", localize: true
|
||||||
|
|
||||||
mount_uploader :default_image, ImageUploader
|
mount_uploader :default_image, ImageUploader
|
||||||
mount_uploader :site_logo, ImageUploader
|
mount_uploader :site_logo, ImageUploader
|
||||||
mount_uploader :site_logo_1, ImageUploader
|
mount_uploader :site_logo_1, ImageUploader
|
||||||
mount_uploader :favicon, ImageUploader
|
mount_uploader :favicon, ImageUploader
|
||||||
mount_uploader :mobile_icon, ImageUploader
|
mount_uploader :mobile_icon, ImageUploader
|
||||||
after_initialize do
|
after_initialize do |record|
|
||||||
if !self.new_record?
|
if !record.new_record?
|
||||||
if self.is_hidden_orbit_bar.nil?
|
if record.is_hidden_orbit_bar.nil?
|
||||||
self.is_hidden_orbit_bar = false
|
record.is_hidden_orbit_bar = false
|
||||||
self.save
|
record.save
|
||||||
end
|
end
|
||||||
if self.orbit_bar_background_color.nil?
|
if record.orbit_bar_background_color.nil?
|
||||||
self.orbit_bar_background_color = ""
|
record.orbit_bar_background_color = ""
|
||||||
self.save
|
record.save
|
||||||
end
|
end
|
||||||
if self.orbit_bar_text_color.nil?
|
if record.orbit_bar_text_color.nil?
|
||||||
self.orbit_bar_text_color = ""
|
record.orbit_bar_text_color = ""
|
||||||
self.save
|
record.save
|
||||||
end
|
end
|
||||||
if self.orbit_bar_submenu_background_color.nil?
|
if record.orbit_bar_submenu_background_color.nil?
|
||||||
self.orbit_bar_submenu_background_color = ""
|
record.orbit_bar_submenu_background_color = ""
|
||||||
self.save
|
record.save
|
||||||
end
|
end
|
||||||
if self.orbit_bar_submenu_text_color.nil?
|
if record.orbit_bar_submenu_text_color.nil?
|
||||||
self.orbit_bar_submenu_text_color = ""
|
record.orbit_bar_submenu_text_color = ""
|
||||||
self.save
|
record.save
|
||||||
end
|
end
|
||||||
if self.orbit_bar_animation_time.nil?
|
if record.orbit_bar_animation_time.nil?
|
||||||
self.orbit_bar_animation_time = "0.3s"
|
record.orbit_bar_animation_time = "0.3s"
|
||||||
self.save
|
record.save
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if record.orbit_bar_background_color == '#000000' && record.orbit_bar_text_color == '#000000'
|
||||||
|
record.update(:orbit_bar_text_color => '#ffffff')
|
||||||
|
end
|
||||||
|
if record.orbit_bar_submenu_background_color == '#000000' && record.orbit_bar_submenu_text_color == '#000000'
|
||||||
|
record.update(:orbit_bar_submenu_text_color => '#ffffff')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
def register_site(url,university,department,email,country)
|
def register_site(url,university,department,email,country)
|
||||||
api_key = STORE_CONFIG[:store_settings]["api_key"]
|
api_key = STORE_CONFIG[:store_settings]["api_key"]
|
||||||
|
|
Loading…
Reference in New Issue