Add agree settings.

This commit is contained in:
邱博亞 2024-01-18 23:47:13 +08:00
parent 61fa9d03f8
commit b54791bb95
3 changed files with 14 additions and 5 deletions

View File

@ -939,7 +939,7 @@ class Admin::ApplicationFormsController < OrbitAdminController
if @application_form.application_form_signup_field_sets.where(:field_name.in=>except_attributes).destroy != 0
@application_form = @application_form.reload
end
(ApplicationFormSignup.attribute_names + ['recaptcha']).each do |attr_signup|
(ApplicationFormSignup.attribute_names + ['recaptcha', 'agree']).each do |attr_signup|
next if except_attributes.include?(attr_signup)
signup_set = @application_form.application_form_signup_field_sets.select{|v| v.field_name==attr_signup }
fix_trans = false

View File

@ -4,7 +4,7 @@ class ApplicationFormSignup
include Mongoid::Document
include Mongoid::Timestamps
HiddenFields = ['ip', 'application_form_signup_id', 'password', 'status', 'reviewer_ids_list','_id', 'created_at', 'updated_at','application_form_main_id',"serial_number","final_session","final_sessions","preferred_sessions",'application_form_session_id',"application_form_session_ids","preferred_session","sort_number","abstract_number","presentation_type", "cipher_stage_num", "process_stage", "review_status", "agree_reviewer_ids", "agree_reviewer_times"]
DefaultEnableFields = ['name','tel','phone','email', 'recaptcha']
DefaultEnableFields = ['name','tel','phone','email', 'recaptcha', 'agree']
field :ip, type: String
field :sort_number , type: Integer, default: 10000
field :process_stage, type: Integer, default: 1

View File

@ -54,7 +54,7 @@
</div>
<% if @application_form.application_form_signup_field_sets.count != 0 %>
<% @application_form.application_form_signup_field_sets.each do |signup_field| %>
<% if !(signup_field.disabled) && signup_field.field_name != 'recaptcha' %>
<% if !(signup_field.disabled) && !(['recaptcha', 'agree'].include?(signup_field.field_name)) %>
<div class="form-group<%= (@application_form.registration_status[0] == 'G' && signup_field.field_name == 'password') ? ' hide' : '' %>" id="<%= signup_field.field_name == 'password' ? 'registration_status' : '' %>">
<label for="<%= signup_field['name'][I18n.locale] %>" class="col-sm-2 control-label">
<% if !(['address','note'].include? signup_field.field_name) %>
@ -288,14 +288,23 @@
</div>
</div> -->
<% agree_set = @application_form.application_form_signup_field_sets.select{|v| v.field_name=='agree'}[0]
if agree_set.nil?
agree_trans = t("application_form_signup.agree")
else
agree_trans = agree_set.name[I18n.locale.to_s]
end
%>
<% if agree_set.nil? || !agree_set.disabled %>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<label>
<input id="agree" name="agree" value="1" type="checkbox" required="required">
<a href="<%= prefix_url %>?method=show_privacy" target="_blank"><%= t("application_form_signup.agree")%></a>
<input id="agree" name="agree" value="1" type="checkbox" required="required">
<a href="<%= prefix_url %>?method=show_privacy" target="_blank"><%= agree_trans %></a>
</label>
</div>
</div>
<% end %>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">