From b0116e3d5a36035b6fc0c0959bc8b58a5eef740f Mon Sep 17 00:00:00 2001 From: rulingcom Date: Tue, 2 Apr 2024 21:51:42 +0800 Subject: [PATCH] added fix for edit page --- .../edit_login_seminar_signup.html.erb | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/app/views/seminars/edit_login_seminar_signup.html.erb b/app/views/seminars/edit_login_seminar_signup.html.erb index a5ab61e..25f255b 100644 --- a/app/views/seminars/edit_login_seminar_signup.html.erb +++ b/app/views/seminars/edit_login_seminar_signup.html.erb @@ -224,10 +224,10 @@ %> <% @seminar.seminar_signup_fields.where(:disabled=>false).asc(:sort_number, :_id).each_with_index do |rf, idx| %> - <% if(idx == 5) %> + <% if(idx == 6) %>
<% end %> - <% if(idx % 5 == 0) && idx != 0 %> + <% if(idx % 6 == 0) && idx != 0 %> <% group += 1 %> <% if @seminar_signup.seminar_signup_values[@form_index] && !@seminar_signup.seminar_signup_values[@form_index].value.blank? %>
@@ -241,11 +241,11 @@ <%= rf.block_helper(@seminar,@form_index,false,"seminar_signup",@seminar_signup, rf.to_require) %>
- <% if(counter % 5 == 0) && idx != 4 %> + <% if(counter % 6 == 0) && idx != 5 %> <% counter = 0 %>
<% end %> - <% if(idx == 25) %> + <% if(idx == 30) %>
<% end %> <% @form_index = @form_index +1 %> @@ -452,10 +452,13 @@ // $("#seminar_signup_values_3_value").removeAttr("placeholder"); let currentGroup = 1 + $("#new-seminar-signup div[id^=group]:visible").length; - function showGroup($group){ + function showGroup($group, init){ $group.show(); $group.find('.fake-clean-file').remove(); $group.find('input,textarea').attr("required", true); + if(init){ + $group.find('input.tick').attr("checked", true); + } } function hideGroup($group){ @@ -469,11 +472,11 @@ if (currentGroup > 1){ $("#remove-member").show(); - for (var i = 1; i < currentGroup; i++){ - showGroup($("#group" + i)); + for (var i = 1; i <= currentGroup; i++){ + showGroup($("#group" + i), true); } } - + $("input.first-tick").attr("checked",true); $("#add-member").on("click",function () { if(currentGroup < 5){ $("#remove-member").show();