diff --git a/app/controllers/application_forms_controller.rb b/app/controllers/application_forms_controller.rb
index f681cf8..f2f1183 100644
--- a/app/controllers/application_forms_controller.rb
+++ b/app/controllers/application_forms_controller.rb
@@ -305,7 +305,7 @@ class ApplicationFormsController < ApplicationController
application_form = ApplicationFormMain.find_by(uid: params[:uid].to_s)
- if application_form.application_form_start_date <= time_now && ( application_form.application_form_end_date.nil? || application_form.application_form_end_date+1 >= time_now )
+ if (application_form.application_form_start_date.nil? || application_form.application_form_start_date <= time_now) && ( application_form.application_form_end_date.nil? || application_form.application_form_end_date+1 >= time_now )
sign_up = ('' + t('application_form.signup') + '').html_safe
elsif application_form.registration_status.blank?
sign_up = t('application_form.sign_up_not_open')
diff --git a/app/views/application_forms/show.html.erb b/app/views/application_forms/show.html.erb
index 063d753..dfb5d46 100644
--- a/app/views/application_forms/show.html.erb
+++ b/app/views/application_forms/show.html.erb
@@ -13,11 +13,7 @@
%>
<% if @application_form.application_form_start_date < @time_now and ( @application_form.application_form_end_date.nil? or @application_form.application_form_end_date+1.days > @time_now ) %>
- <%#= stylesheet_link_tag "lib/main-forms" %>
- <%= stylesheet_link_tag "basic/bootstrap-datetimepicker" %>
- <%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
- <%= javascript_include_tag "lib/datetimepicker/date.time.picker.js" %>
- <%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
+<%#= stylesheet_link_tag "lib/main-forms" %>
<% notice = flash["notice"] || params[:notice] %>
<% flash.each do |key, msg| %>
<% next if key.to_s == "notice" %>
@@ -367,17 +363,17 @@
elem = $(this),
value = $(this).val() || null;
var checkAvailability = function(){
- $.ajax({
- url : "<%= "#{prefix_url}?method=check_availability&no=#{@application_form.id}" %>",
- data : {"type" : type, "value" : value},
- dataType : "json",
- type : "get",
- success : function(data){
- if( data.success == true ){
- }else{
- }
- }
- })
+ // $.ajax({
+ // url : "/xhr/application_forms/check_availability",
+ // data : {"type" : type, "value" : value},
+ // dataType : "json",
+ // type : "get",
+ // success : function(data){
+ // if( data.success == true ){
+ // }else{
+ // }
+ // }
+ // })
}
if( value ){
diff --git a/app/views/application_forms/show_privacy.html.erb b/app/views/application_forms/show_privacy.html.erb
index 9b606cc..fc145df 100644
--- a/app/views/application_forms/show_privacy.html.erb
+++ b/app/views/application_forms/show_privacy.html.erb
@@ -19,7 +19,7 @@
-<%= @application_form_agreement.content.html_safe %>
+<%= @application_form_agreement.content.to_s.html_safe %>
diff --git a/application_form.gemspec b/application_form.gemspec
index 4f995fa..33f716d 100644
--- a/application_form.gemspec
+++ b/application_form.gemspec
@@ -86,12 +86,12 @@ Gem::Specification.new do |s|
s.date = "2019-11-19"
s.description = "ApplicationForm plugin."
s.email = ["orbit@rulingcom.com"]
- s.files = ["MIT-LICENSE", "README.rdoc", "Rakefile", "app/assets/javascripts/check_application_form_set_items.js.erb", "app/assets/javascripts/field-forms.js", "app/assets/javascripts/application_form.js.coffee", "app/assets/javascripts/application_form_sets.js", "app/assets/stylesheets/application_form.css.scss", "app/assets/stylesheets/application_form_sets.css", "app/controllers/admin/application_form_agreements_controller.rb", "app/controllers/admin/application_form_item_contents_controller.rb", "app/controllers/admin/application_form_items_controller.rb", "app/controllers/admin/application_form_signups_controller.rb", "app/controllers/admin/application_forms_controller.rb", "app/controllers/application_forms_controller.rb", "app/helpers/admin/application_forms_field_helper.rb", "app/helpers/admin/application_forms_helper.rb", "app/helpers/admin/application_forms_values_helper.rb", "app/models/application_form_agreement.rb", "app/models/application_form_file.rb", "app/models/application_form_item.rb", "app/models/application_form_item_content.rb", "app/models/application_form_link.rb", "app/models/application_form_main.rb", "app/models/application_form_review.rb", "app/models/application_form_signup.rb", "app/models/application_form_signup_contribute.rb", "app/models/application_form_signup_field.rb", "app/models/application_form_signup_value.rb", "app/views/admin/application_form_agreements", "app/views/admin/application_form_agreements/index.html.erb", "app/views/admin/application_form_item_contents", "app/views/admin/application_form_item_contents/_form.html.erb", "app/views/admin/application_form_item_contents/edit.html.erb", "app/views/admin/application_form_item_contents/index.html.erb", "app/views/admin/application_form_item_contents/new.html.erb", "app/views/admin/application_form_items", "app/views/admin/application_form_items/_delete_modal.html.erb", "app/views/admin/application_form_items/_form.html.erb", "app/views/admin/application_form_items/_index.html.erb", "app/views/admin/application_form_items/_item.html.erb", "app/views/admin/application_form_items/index.html.erb", "app/views/admin/application_form_items/index.js.erb", "app/views/admin/application_form_signups", "app/views/admin/application_form_signups/edit.html.erb", "app/views/admin/application_forms", "app/views/admin/application_forms/_attribute_field.html.erb", "app/views/admin/application_forms/_form.html.erb", "app/views/admin/application_forms/_form_file.html.erb", "app/views/admin/application_forms/_form_link.html.erb", "app/views/admin/application_forms/_index.html.erb", "app/views/admin/application_forms/_support_member_form_js.erb", "app/views/admin/application_forms/edit.html.erb", "app/views/admin/application_forms/export.xlsx.axlsx", "app/views/admin/application_forms/index.html.erb", "app/views/admin/application_forms/new.html.erb", "app/views/admin/application_forms/application_form_item_content.html.erb", "app/views/admin/application_forms/application_form_signup.html.erb", "app/views/admin/application_forms/application_form_signup_field.html.erb", "app/views/application_forms", "app/views/application_forms/add_file.html.erb", "app/views/application_forms/check_availability.html.erb", "app/views/application_forms/check_email.html.erb", "app/views/application_forms/con_login.html.erb", "app/views/application_forms/con_logout.html.erb", "app/views/application_forms/con_upload.html.erb", "app/views/application_forms/edit_file.html.erb", "app/views/application_forms/index.html.erb", "app/views/application_forms/show.html.erb", "app/views/application_forms/show_data.html.erb", "app/views/application_forms/show_privacy.html.erb", "app/views/application_forms/signup_ok.html.erb", "app/views/simple_captcha", "app/views/simple_captcha/_simple_captcha.erb", "config/locales/en.yml", "config/locales/zh_tw.yml", "config/routes.rb", "lib/application_form", "lib/application_form.rb", "lib/application_form/engine.rb", "lib/application_form/version.rb", "lib/tasks/application_form_tasks.rake", "test/controllers/application_form_controller_test.rb", "test/dummy", "test/dummy/README.rdoc", "test/dummy/Rakefile", "test/dummy/app", "test/dummy/app/assets", "test/dummy/app/assets/images", "test/dummy/app/assets/javascripts", "test/dummy/app/assets/javascripts/application.js", "test/dummy/app/assets/stylesheets", "test/dummy/app/assets/stylesheets/application.css", "test/dummy/app/controllers", "test/dummy/app/controllers/application_controller.rb", "test/dummy/app/controllers/concerns", "test/dummy/app/helpers", "test/dummy/app/helpers/application_helper.rb", "test/dummy/app/mailers", "test/dummy/app/models", "test/dummy/app/models/concerns", "test/dummy/app/views", "test/dummy/app/views/layouts", "test/dummy/app/views/layouts/application.html.erb", "test/dummy/bin", "test/dummy/bin/bundle", "test/dummy/bin/rails", "test/dummy/bin/rake", "test/dummy/config", "test/dummy/config.ru", "test/dummy/config/application.rb", "test/dummy/config/boot.rb", "test/dummy/config/database.yml", "test/dummy/config/environment.rb", "test/dummy/config/environments", "test/dummy/config/environments/development.rb", "test/dummy/config/environments/production.rb", "test/dummy/config/environments/test.rb", "test/dummy/config/initializers", "test/dummy/config/initializers/assets.rb", "test/dummy/config/initializers/backtrace_silencers.rb", "test/dummy/config/initializers/cookies_serializer.rb", "test/dummy/config/initializers/filter_parameter_logging.rb", "test/dummy/config/initializers/inflections.rb", "test/dummy/config/initializers/mime_types.rb", "test/dummy/config/initializers/session_store.rb", "test/dummy/config/initializers/wrap_parameters.rb", "test/dummy/config/locales", "test/dummy/config/locales/en.yml", "test/dummy/config/routes.rb", "test/dummy/config/secrets.yml", "test/dummy/lib", "test/dummy/lib/assets", "test/dummy/log", "test/dummy/public", "test/dummy/public/404.html", "test/dummy/public/422.html", "test/dummy/public/500.html", "test/dummy/public/favicon.ico", "test/helpers/application_form_helper_test.rb", "test/application_form_test.rb", "test/test_helper.rb"]
+ s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
s.homepage = "http://www.rulingcom.com"
s.licenses = ["MIT"]
s.rubygems_version = "2.2.2"
s.summary = "ApplicationForm plugin."
- s.test_files = ["test/dummy", "test/dummy/app", "test/dummy/app/assets", "test/dummy/app/assets/javascripts", "test/dummy/app/assets/javascripts/application.js", "test/dummy/app/assets/images", "test/dummy/app/assets/stylesheets", "test/dummy/app/assets/stylesheets/application.css", "test/dummy/app/models", "test/dummy/app/models/concerns", "test/dummy/app/helpers", "test/dummy/app/helpers/application_helper.rb", "test/dummy/app/mailers", "test/dummy/app/views", "test/dummy/app/views/layouts", "test/dummy/app/views/layouts/application.html.erb", "test/dummy/app/controllers", "test/dummy/app/controllers/concerns", "test/dummy/app/controllers/application_controller.rb", "test/dummy/config", "test/dummy/config/routes.rb", "test/dummy/config/environments", "test/dummy/config/environments/test.rb", "test/dummy/config/environments/development.rb", "test/dummy/config/environments/production.rb", "test/dummy/config/initializers", "test/dummy/config/initializers/assets.rb", "test/dummy/config/initializers/session_store.rb", "test/dummy/config/initializers/wrap_parameters.rb", "test/dummy/config/initializers/filter_parameter_logging.rb", "test/dummy/config/initializers/inflections.rb", "test/dummy/config/initializers/mime_types.rb", "test/dummy/config/initializers/backtrace_silencers.rb", "test/dummy/config/initializers/cookies_serializer.rb", "test/dummy/config/secrets.yml", "test/dummy/config/boot.rb", "test/dummy/config/environment.rb", "test/dummy/config/database.yml", "test/dummy/config/application.rb", "test/dummy/config/locales", "test/dummy/config/locales/en.yml", "test/dummy/public", "test/dummy/public/500.html", "test/dummy/public/422.html", "test/dummy/public/404.html", "test/dummy/public/favicon.ico", "test/dummy/bin", "test/dummy/bin/rake", "test/dummy/bin/rails", "test/dummy/bin/bundle", "test/dummy/lib", "test/dummy/lib/assets", "test/dummy/config.ru", "test/dummy/Rakefile", "test/dummy/README.rdoc", "test/dummy/log", "test/application_form_test.rb", "test/helpers/application_form_helper_test.rb", "test/test_helper.rb", "test/controllers/application_form_controller_test.rb"]
+ s.test_files = Dir["test/**/*"]
s.installed_by_version = "2.2.2" if s.respond_to? :installed_by_version
# s.add_dependency "custom_announcement"
diff --git a/config/routes.rb b/config/routes.rb
index 45ac5db..7287682 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -70,6 +70,7 @@ Rails.application.routes.draw do
post 'del_file', to: 'application_forms#del_file'
end
end
+ get '/xhr/application_forms/check_availability', to: 'application_forms#check_availability'
get '/xhr/application_forms/agree_link' , to: 'application_forms#agree_link'
end