" id="<%= signup_field.field_name == 'password' ? 'registration_status' : '' %>">
- <%= f.email_field :email, :class=>"input-medium form-control availibility", :placeholder=> signup_field.placeholder[I18n.locale], :required => true, :title => t("seminar_signup.email_check") %>
check mail
+ <%= f.email_field :email, :class=>"input-medium form-control availibility", :placeholder=> signup_field.placeholder[I18n.locale], :required => true, :title => t("seminar_signup.email_check") %>
+
<% elsif signup_field.field_name == 'password' %>
<% end %>
- <% @seminar.seminar_signup_fields.where(:disabled=>false).asc(:sort_number, :_id).each do |rf| %>
-
+ <%
+ group = 1
+ counter = 0
+ %>
+
+ <% @seminar.seminar_signup_fields.where(:disabled=>false).asc(:sort_number, :_id).each_with_index do |rf, idx| %>
+ <% if(idx == 5) %>
+
+ <% end %>
+ <% if(idx % 5 == 0) && idx != 0 %>
+ <% group += 1 %>
+
+ <% end %>
+ <% counter += 1 %>
<%= rf.block_helper(@seminar,@form_index,false,"seminar_signup",@seminar_signup, rf.to_require) %>
-
+ <% if(counter % 5 == 0) && idx != 4 %>
+ <% counter = 0 %>
+
+ <% end %>
+ <% if(idx == 25) %>
+
+ <% end %>
<% @form_index = @form_index +1 %>
<% end %>
-
+
+
+
+
+
<% if @seminar.seminar_signup_field_sets.count != 0 %>
@@ -243,8 +271,8 @@
@@ -310,36 +338,33 @@
});
- $(".availibility").blur(function(){
+$(".availibility").blur(function(){
var type = $(this).attr("id"),
loader = $(this).parent().find('.loader'),
elem = $(this),
value = $(this).val() || null;
- var checkAvailability = function(){
- $.ajax({
- url : "<%= "#{prefix_url}?method=check_availability&no=#{@seminar.id}" %>",
- data : {"type" : type, "value" : value},
- dataType : "json",
- type : "get",
- success : function(data){
- if( data.success == true ){
-
-alert("1tttt");
- }else{
-
-alert("1ssss2");
+ var checkAvailability = function(){
+ $.ajax({
+ url : "<%= "/xhr/seminars/check_email/#{@seminar.id}" %>",
+ data : {"type" : type, "email" : value},
+ dataType : "json",
+ type : "get",
+ success : function(data){
+ if( data.success == true ){
+ loader.removeClass("error");
+ }else{
+ loader.addClass("error");
+ }
+ loader.text(data.result);
}
- }
- })
- }
-
- if( value ){
- if(type == "seminar_signup_email"){
- checkAvailability();
+ })
+ }
+ if( value ){
+ if(type == "seminar_signup_email"){
+ loader.text("Checking...")
+ checkAvailability();
+ }
}
- }
-
-
})
$(".upload").on("change",function(){
let filenamedom = $(this).parent().parent().find(".filename");
@@ -347,6 +372,43 @@ alert("1ssss2");
filenamedom.text(filenameA[filenameA.length - 1]);
})
+ $("#optional label").each(function(){
+ if($(this).hasClass("control-label")){
+ $(this).text("*" + $(this).text());
+ }
+ })
+
+ // $("#seminar_signup_values_3_value").removeAttr("placeholder");
+
+ let currentGroup = 1;
+ $("#add-member").on("click",function () {
+ if(currentGroup < 5){
+ $("#remove-member").show();
+ currentGroup++;
+ $("#group" + currentGroup).show();
+ if(currentGroup == 5){
+ $(this).attr("disabled","disabled").hide();
+ }
+ }
+ $("#group" + currentGroup + " input").attr("required", true);
+ $("#group" + currentGroup + " textarea").attr("required", true);
+ return false;
+ })
+ $("#remove-member").on("click",function () {
+ if(currentGroup > 0){
+ $("#group" + currentGroup).hide();
+ $("#group" + currentGroup + " input").attr("required", false);
+ $("#group" + currentGroup + " input").val("");
+ $("#group" + currentGroup + " textarea").attr("required", false);
+ $("#group" + currentGroup + " textarea").val("");
+ currentGroup--;
+ if(currentGroup == 1){
+ $(this).hide();
+ }
+ }
+ return false;
+ })
+
})();
diff --git a/app/views/seminars/show.html.erb b/app/views/seminars/show.html.erb
index 3f33675..0185a32 100644
--- a/app/views/seminars/show.html.erb
+++ b/app/views/seminars/show.html.erb
@@ -14,6 +14,11 @@
sign_up_overdue = @seminar.signup_end_date && @time_now && (@seminar.signup_end_date + 1.day <= @time_now)
signup_is_full = @seminar.signup_is_full?
%>
+
<% if !registration_is_open %>
<%= t('seminar.sign_up_not_open') %>
@@ -58,9 +63,9 @@
<% if !@seminar.signup_note.blank? %>
@@ -77,7 +82,7 @@
<% if @seminar.seminar_signup_field_sets.count != 0 %>
<% @seminar.seminar_signup_field_sets.each do |signup_field| %>
<% if !(signup_field.disabled) && signup_field.field_name != 'recaptcha' %>
-
+
" id="<%= signup_field.field_name == 'password' ? 'registration_status' : '' %>">
<% elsif signup_field.field_name == 'email' %>
- <%= f.email_field :email, :class=>"input-medium form-control availibility", :placeholder=> signup_field.placeholder[I18n.locale], :required => true, :title => t("seminar_signup.email_check") %>
check mail
+ <%= f.email_field :email, :class=>"input-medium form-control availibility", :placeholder=> signup_field.placeholder[I18n.locale], :required => true, :title => t("seminar_signup.email_check") %>
+
<% elsif signup_field.field_name == 'password' %>
@@ -207,18 +213,40 @@
<% end %>
- <% @seminar.seminar_signup_fields.where(:disabled=>false).asc(:sort_number, :_id).each do |rf| %>
-
+ <%
+ group = 1
+ counter = 0
+ %>
+
+ <% @seminar.seminar_signup_fields.where(:disabled=>false).asc(:sort_number, :_id).each_with_index do |rf, idx| %>
+ <% if(idx == 5) %>
+
+ <% end %>
+ <% if(idx % 5 == 0) && idx != 0 %>
+ <% group += 1 %>
+
+ <% end %>
+ <% counter += 1 %>
<%= rf.block_helper(@seminar,@form_index,false,"seminar_signup",@seminar_signup, rf.to_require) %>
-
+ <% if(counter % 5 == 0) && idx != 4 %>
+ <% counter = 0 %>
+
+ <% end %>
+ <% if(idx == 25) %>
+
+ <% end %>
<% @form_index = @form_index +1 %>
<% end %>
-
+
+
+
+
+
<% if @seminar.seminar_signup_field_sets.count != 0 %>
@@ -244,7 +272,7 @@
@@ -309,36 +337,33 @@
});
- $(".availibility").blur(function(){
+$(".availibility").blur(function(){
var type = $(this).attr("id"),
loader = $(this).parent().find('.loader'),
elem = $(this),
value = $(this).val() || null;
- var checkAvailability = function(){
- $.ajax({
- url : "<%= "#{prefix_url}?method=check_availability&no=#{@seminar.id}" %>",
- data : {"type" : type, "value" : value},
- dataType : "json",
- type : "get",
- success : function(data){
- if( data.success == true ){
-
-alert("1tttt");
- }else{
-
-alert("1ssss2");
+ var checkAvailability = function(){
+ $.ajax({
+ url : "<%= "/xhr/seminars/check_email/#{@seminar.id}" %>",
+ data : {"type" : type, "email" : value},
+ dataType : "json",
+ type : "get",
+ success : function(data){
+ if( data.success == true ){
+ loader.removeClass("error");
+ }else{
+ loader.addClass("error");
+ }
+ loader.text(data.result);
}
- }
- })
- }
-
- if( value ){
- if(type == "seminar_signup_email"){
- checkAvailability();
+ })
+ }
+ if( value ){
+ if(type == "seminar_signup_email"){
+ loader.text("Checking...")
+ checkAvailability();
+ }
}
- }
-
-
})
$(".upload").on("change",function(){
let filenamedom = $(this).parent().parent().find(".filename");
@@ -346,6 +371,44 @@ alert("1ssss2");
filenamedom.text(filenameA[filenameA.length - 1]);
})
+ $("#optional label").each(function(){
+ if($(this).hasClass("control-label")){
+ $(this).text("*" + $(this).text());
+ }
+ })
+
+ // $("#seminar_signup_values_3_value").removeAttr("placeholder");
+
+ let currentGroup = 1;
+ $("#add-member").on("click",function () {
+ if(currentGroup < 5){
+ $("#remove-member").show();
+ currentGroup++;
+ $("#group" + currentGroup).show();
+ if(currentGroup == 5){
+ $(this).attr("disabled","disabled").hide();
+ }
+ }
+ $("#group" + currentGroup + " input").attr("required", true);
+ $("#group" + currentGroup + " textarea").attr("required", true);
+ return false;
+ })
+ $("#remove-member").on("click",function () {
+ if(currentGroup > 0){
+ $("#group" + currentGroup).hide();
+ $("#group" + currentGroup + " input").attr("required", false);
+ $("#group" + currentGroup + " input[type='text']").val("");
+ $("#group" + currentGroup + " input[type='file']").val("");
+ $("#group" + currentGroup + " textarea").attr("required", false);
+ $("#group" + currentGroup + " textarea").val("");
+ currentGroup--;
+ if(currentGroup == 1){
+ $(this).hide();
+ }
+ }
+ return false;
+ })
+
})();
diff --git a/config/locales/en.yml b/config/locales/en.yml
index cab9601..3658b3d 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -207,7 +207,7 @@ en:
note: Note #註解
time: 'Start / End Time' #(開始/結束)時間
place: Place #地點
- agree: "Accept Privacy and Personal Information Protection Policy of the Site"
+ agree: "I agree with all terms"
privacy_statement: 'Privacy and Personal Information Protection Policy of the Site'
recaptcha: Verification code
signup_field: Sign Up Field #圈選項目
@@ -253,4 +253,6 @@ en:
edit_form: Edit Form
emails_already_sent: Emails Already Sent
is_confirmed_date: Email confirmed time
- signup_confirmed_date: Signup confirmed time
\ No newline at end of file
+ signup_confirmed_date: Signup confirmed time
+ add_member: Add Member
+ remove_member: Remove Member
diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml
index 2c01d60..082fa4e 100644
--- a/config/locales/zh_tw.yml
+++ b/config/locales/zh_tw.yml
@@ -208,7 +208,7 @@ zh_tw:
note: 註解
time: (開始/結束)時間
place: 地點
- agree: 同意接受註冊相關條款(Agree upon terms of this web)
+ agree: 已確認閱讀相關條款
privacy_statement: '個資及隱私權保護宣告'
recaptcha: 驗證碼
signup_field: 圈選項目
@@ -250,7 +250,9 @@ zh_tw:
email_not_confirmed: Email尚未確認
signup_not_confirmed: 註冊尚未查核確認
send_email: 寄送Email
- edit_form: 編輯註冊表單
+ edit_form: 編輯註冊表單
emails_already_sent: 已寄送Email
+ add_member: 增加組員
+ remove_member: 移除加組員
is_confirmed_date: Email認證時間
signup_confirmed_date: 註冊查核確認時間
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index 9fb825b..c193a8b 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -113,6 +113,7 @@ Rails.application.routes.draw do
end
end
post "/xhr/seminars/send_notifying_email" => "seminars#send_notifying_email"
+ get "/xhr/seminars/check_email/:no" => "seminars#check_email"
end
end