Compare commits

..

No commits in common. "df2570337528c63a3f52e0fca3a2da3016e96fdd" and "cbb211401bbdb4715c6e56ae16d93e4aa82abb40" have entirely different histories.

2 changed files with 4 additions and 27 deletions

View File

@ -530,9 +530,7 @@ class AsksController < ApplicationController
old_input = old_.find('input, select');
if(new_input.length != 0 && old_input.length != 0){
if(new_input.length == old_input.length){
var old_clone = old_.clone();
old_clone.find('input, select').attr('name', new_input.attr('name'));
old_clone.replaceAll(new_);
old_.clone().replaceAll(new_);
}
}
}

View File

@ -15,10 +15,6 @@
yes_trans = t('ask.yes')
no_trans = t('ask.no')
locale = I18n.locale.to_s
ask_setting = AskCategorySetting.enabled.where(category_id: question.category_id.to_s).first
ask_setting = AskSetting.first if ask_setting.nil?
is_cat_record = (ask_setting.class == AskCategorySetting)
tmp_ask_cat_id = (is_cat_record ? ask_setting.id.to_s : '')
%>
<% @data['disp_fields_infos'].each do |f, field_info| %>
<% next if f == 'recaptcha' %>
@ -28,25 +24,8 @@
is_cat = false
is_custom = false
if f.include?("@")
field = f
f = field_info["key"]
is_custom = true
is_field_enable = false
if field.start_with?("default@")
f = is_cat_record ? field : field[8..-1]
v = ask_setting.custom_fields[f]
if v
is_field_enable = true
end
elsif field.start_with?("custom@") && is_cat_record
if field.include?(tmp_ask_cat_id)
f = field[8+tmp_ask_cat_id.length..-1]
v = ask_setting.custom_fields[f]
if v
is_field_enable = true
end
end
end
next if !is_field_enable
elsif f == 'ask_category_id'
f = 'category_id'
is_cat = true
@ -71,9 +50,9 @@
elsif type == "date"
val = val["datetime"].values[0].values rescue []
if val.count == 2
val = val[0].to_s.gsub('-', '/') + " ~ " + val[1].to_s.gsub('-', '/')
val = val[0].gsub('-', '/') + " ~ " + val[1].gsub('-', '/')
else
val = val[0].to_s.gsub('-', '/')
val = val[0].gsub('-', '/')
end
elsif type == "instructions"
val = field_info["instructions"][locale].to_s.html_safe rescue ""