Remove duplicated codes.
This commit is contained in:
parent
92cf65bfaa
commit
49e2e3c7c7
|
@ -23,17 +23,6 @@
|
|||
<% @field_name_translations << t(th) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if @application_form.application_form_signup_field_customs.count != 0 %>
|
||||
<% @application_form.application_form_signup_field_customs.each do |field_set| %>
|
||||
<% s = ApplicationFormSignupField.where(id:field_set.application_form_signup_field_id).first %>
|
||||
<% title = s.title rescue '' %>
|
||||
<% next if title.blank? %>
|
||||
<% next if s.key.blank? %>
|
||||
<% default_hidden << "application_form_signup_field_custom.#{s.key}" if (field_set.hidden) %>
|
||||
<% @field_names << "application_form_signup_field_custom.#{s.key}" %>
|
||||
<% @field_name_translations << (title)%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% @application_form.application_form_signup_fields.each do |s| %>
|
||||
<% default_hidden << "application_form_signup_fields.#{s.key}" %>
|
||||
<% @field_names << "application_form_signup_fields.#{s.key}" %>
|
||||
|
@ -93,16 +82,6 @@
|
|||
<% @field_name_translations << t(th) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% application_form_signup_field_customs = ApplicationFormSignupFieldCustom.all.map{|field_set| ApplicationFormSignupField.where(id: field_set.application_form_signup_field_id).first}.select{|s| !s.nil?}.uniq{|s| s.key } %>
|
||||
<% if application_form_signup_field_customs.count != 0 %>
|
||||
<% application_form_signup_field_customs.each do |s| %>
|
||||
<% title = s.title rescue '' %>
|
||||
<% next if title.blank? %>
|
||||
<% next if s.key.blank? %>
|
||||
<% @field_names << "application_form_signup_field_custom.#{s.key}" %>
|
||||
<% @field_name_translations << (title)%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% application_form_signup_fields = ApplicationFormSignupField.all.uniq{|s| s.key} %>
|
||||
<% application_form_signup_fields.each do |s| %>
|
||||
<% @field_names << "application_form_signup_fields.#{s.key}" %>
|
||||
|
|
Loading…
Reference in New Issue