Fix bug.
This commit is contained in:
parent
3ba5d512cf
commit
ba912412d3
|
@ -468,14 +468,14 @@ class Admin::ApplicationFormsController < OrbitAdminController
|
|||
application_form_main_params['application_form_links_attributes'].delete(idx.to_s) if link['url'].blank?
|
||||
end
|
||||
end
|
||||
application_form_signup_set_params = application_form_main_params['application_form_signup_field_sets']
|
||||
application_form_email_sets_params = application_form_main_params['application_form_email_sets']
|
||||
application_form_signup_field_customs_params = application_form_main_params["application_form_signup_field_customs"].to_h rescue {}
|
||||
application_form_main_params["application_form_signup_field_customs"].to_h.each do |k,v|
|
||||
application_form_signup_set_params = application_form_main_params['application_form_signup_field_sets_attributes']
|
||||
application_form_email_sets_params = application_form_main_params['application_form_email_sets_attributes']
|
||||
application_form_signup_field_customs_params = application_form_main_params["application_form_signup_field_customs_attributes"].to_h rescue {}
|
||||
application_form_main_params["application_form_signup_field_customs_attributes"].to_h.each do |k,v|
|
||||
v.delete "title"
|
||||
end
|
||||
application_form_main_params.delete(:application_form_signup_field_sets)
|
||||
application_form_main_params.delete(:application_form_email_sets)
|
||||
application_form_main_params.delete(:application_form_signup_field_sets_attributes)
|
||||
application_form_main_params.delete(:application_form_email_sets_attributes)
|
||||
application_form = ApplicationFormMain.new(application_form_main_params)
|
||||
application_form.create_user_id = current_user.id
|
||||
application_form.update_user_id = current_user.id
|
||||
|
@ -541,8 +541,8 @@ class Admin::ApplicationFormsController < OrbitAdminController
|
|||
if @application_form_params.has_key?("title_translations")
|
||||
@application_form_params["organizer_id"] = nil if @application_form_params["organizer_id"].nil?
|
||||
end
|
||||
if @application_form_params[:application_form_signup_fields]
|
||||
@application_form_params[:application_form_signup_fields].each do |a|
|
||||
if @application_form_params[:application_form_signup_fields_attributes]
|
||||
@application_form_params[:application_form_signup_fields_attributes].each do |a|
|
||||
@field_name = 'application_form_main'
|
||||
field_status = a.last[:id].present?
|
||||
@attribute_field = ApplicationFormSignupField.add_application_form_signup_field(@application_form, a.last, a.last[:id], field_status)
|
||||
|
@ -552,8 +552,8 @@ class Admin::ApplicationFormsController < OrbitAdminController
|
|||
@application_form.application_form_signup_fields.each{|t| t.destroy if t["to_delete"] == true}
|
||||
|
||||
redirect_to admin_application_forms_path and return
|
||||
elsif @application_form_params[:application_form_submission_fields]
|
||||
params[:application_form_main][:application_form_submission_fields].each do |a|
|
||||
elsif @application_form_params[:application_form_submission_fields_attributes]
|
||||
params[:application_form_main][:application_form_submission_fields_attributes].each do |a|
|
||||
@field_name = 'application_form_main'
|
||||
field_status = a.last[:id].present?
|
||||
@attribute_field = ApplicationFormSubmissionField.add_application_form_signup_field(@application_form, a.last, a.last[:id], field_status)
|
||||
|
|
|
@ -117,15 +117,15 @@
|
|||
<%= t("application_form_signup.#{attr_signup.field_name}") %>
|
||||
</td>
|
||||
<td>
|
||||
<%= show_set_field(attr_signup,'application_form_signup_field_sets',signup_index,'name') %>
|
||||
<%= show_set_field(attr_signup,'application_form_signup_field_sets_attributes',signup_index,'name') %>
|
||||
</td>
|
||||
<td>
|
||||
<%= show_set_field(attr_signup,'application_form_signup_field_sets',signup_index,'placeholder') %>
|
||||
<%= show_set_field(attr_signup,'application_form_signup_field_sets_attributes',signup_index,'placeholder') %>
|
||||
</td>
|
||||
<td>
|
||||
<input type="hidden" class="field_name" name='<%= "application_form_main[application_form_signup_field_sets][#{signup_index}][field_name]" %>' value="<%= attr_signup.field_name %>">
|
||||
<input type="hidden" class="field_set" name='<%= "application_form_main[application_form_signup_field_sets][#{signup_index}][disabled]" %>' value="false">
|
||||
<%= check_box_tag("application_form_main[application_form_signup_field_sets][#{signup_index}][disabled]", true ,attr_signup.disabled) %>
|
||||
<input type="hidden" class="field_name" name='<%= "application_form_main[application_form_signup_field_sets_attributes][#{signup_index}][field_name]" %>' value="<%= attr_signup.field_name %>">
|
||||
<input type="hidden" class="field_set" name='<%= "application_form_main[application_form_signup_field_sets_attributes][#{signup_index}][disabled]" %>' value="false">
|
||||
<%= check_box_tag("application_form_main[application_form_signup_field_sets_attributes][#{signup_index}][disabled]", true ,attr_signup.disabled) %>
|
||||
</td>
|
||||
<td style="padding-left: 1em;">
|
||||
<% if attr_signup.field_name == 'email' %>
|
||||
|
@ -144,9 +144,9 @@
|
|||
</script>
|
||||
<% end %>
|
||||
<% if false #attr_signup.field_name != 'recaptcha' %>
|
||||
<!-- <input type="hidden" class="field_set" name='<%= "application_form_main[application_form_signup_field_sets][#{signup_index}][hidden]" %>' value="false"> -->
|
||||
<%= hidden_field_tag("application_form_main[application_form_signup_field_sets][#{signup_index}][hidden]",attr_signup.hidden) %>
|
||||
<%#= check_box_tag("application_form_main[application_form_signup_field_sets][#{signup_index}][hidden]", true ,attr_signup.hidden) %>
|
||||
<!-- <input type="hidden" class="field_set" name='<%= "application_form_main[application_form_signup_field_sets_attributes][#{signup_index}][hidden]" %>' value="false"> -->
|
||||
<%= hidden_field_tag("application_form_main[application_form_signup_field_sets_attributes][#{signup_index}][hidden]",attr_signup.hidden) %>
|
||||
<%#= check_box_tag("application_form_main[application_form_signup_field_sets_attributes][#{signup_index}][hidden]", true ,attr_signup.hidden) %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -169,13 +169,13 @@
|
|||
<%= ApplicationFormSignupField.where(id:attr_custom.application_form_signup_field_id).first.title rescue '' %>
|
||||
</td>
|
||||
<td>
|
||||
<input type="hidden" class="field_set" name='<%= "application_form_main[application_form_signup_field_customs][#{custom_index}][hidden]" %>' value="false">
|
||||
<%= check_box_tag("application_form_main[application_form_signup_field_customs][#{custom_index}][hidden]", true ,attr_custom.hidden) %>
|
||||
<input type="hidden" class="field_set" name='<%= "application_form_main[application_form_signup_field_customs_attributes][#{custom_index}][hidden]" %>' value="false">
|
||||
<%= check_box_tag("application_form_main[application_form_signup_field_customs_attributes][#{custom_index}][hidden]", true ,attr_custom.hidden) %>
|
||||
</td>
|
||||
<% if !attr_custom.new_record? %>
|
||||
<input for="field_0" id="application_form_main_application_form_signup_field_customs_<%= custom_index.to_s %>_id" name="application_form_main[application_form_signup_field_customs][<%= custom_index.to_s %>][id]" type="hidden" value="<%= attr_custom.id.to_s %>">
|
||||
<input for="field_0" id="application_form_main_application_form_signup_field_customs_<%= custom_index.to_s %>_id" name="application_form_main[application_form_signup_field_customs_attributes][<%= custom_index.to_s %>][id]" type="hidden" value="<%= attr_custom.id.to_s %>">
|
||||
<% elsif f.object.copy_id.present? %>
|
||||
<input name="application_form_main[application_form_signup_field_customs][<%= custom_index.to_s %>][title]" type="hidden" value="<%= attr_custom.application_form_signup_field.title.to_s %>">
|
||||
<input name="application_form_main[application_form_signup_field_customs_attributes][<%= custom_index.to_s %>][title]" type="hidden" value="<%= attr_custom.application_form_signup_field.title.to_s %>">
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
@ -217,8 +217,8 @@
|
|||
<%= t('application_form.disable') %>
|
||||
</td>
|
||||
<td>
|
||||
<input type="hidden" class="field_set" name='<%= "application_form_main[application_form_email_sets][#{index1}][disabled]" %>' value="false">
|
||||
<%= check_box_tag("application_form_main[application_form_email_sets][#{index1}][disabled]", true ,@email_set[index1].disabled) %>
|
||||
<input type="hidden" class="field_set" name='<%= "application_form_main[application_form_email_sets_attributes][#{index1}][disabled]" %>' value="false">
|
||||
<%= check_box_tag("application_form_main[application_form_email_sets_attributes][#{index1}][disabled]", true ,@email_set[index1].disabled) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -226,7 +226,7 @@
|
|||
<%= t('application_form.email_title') %>
|
||||
</td>
|
||||
<td>
|
||||
<%= show_set_field(@email_set[index1],'application_form_email_sets',index1,'title','text_field') %>
|
||||
<%= show_set_field(@email_set[index1],'application_form_email_sets_attributes',index1,'title','text_field') %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -235,7 +235,7 @@
|
|||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
<%= show_set_field(@email_set[index1],'application_form_email_sets',index1,'content','text_area') %>
|
||||
<%= show_set_field(@email_set[index1],'application_form_email_sets_attributes',index1,'content','text_area') %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
Loading…
Reference in New Issue