2022-07-07 08:54:09 +00:00
|
|
|
<fieldset>
|
|
|
|
<style>
|
|
|
|
.show_field {
|
|
|
|
border: 1px solid black;
|
|
|
|
padding: 3px;
|
|
|
|
min-width: 1em;
|
|
|
|
height: 20px;
|
|
|
|
overflow-y: auto;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<table class="table">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<a href="#" class="btn btn-primary clone_default_setting" data-parent=".show_default_ask_setting"><%= t('ask.clone_default_setting') %></a>
|
|
|
|
<a href="#" class="btn btn-success recover_data switch_to_default <%= 'hide' if @first_setting.nil? %>" data-parent=".show_default_ask_setting" data-id="<%= @first_setting.id if @first_setting%>" data-use-default="false"><%= t('ask.recover_data') %></a>
|
|
|
|
</td>
|
|
|
|
<td></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><%= t("ask.title_layout") %>:</td>
|
|
|
|
<td><%= [t("ask.single_column"),t("ask.two_column")][@default_ask_setting.title_layout] %></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><%= t("ask.email_regex") %>:</td>
|
|
|
|
<td>
|
|
|
|
<%= check_box_tag :email_regex_enable, @default_ask_setting.email_regex_enable , nil, {:id=>"",:disabled=>'disabled'} %><%= t("ask.enable") %>
|
|
|
|
<div style="clear: both;"></div>
|
|
|
|
<div class="show_field">
|
|
|
|
<%= @default_ask_setting.email_regex %>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<%= t('ask.field') %>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<%= t('ask.whether_open') %>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<% locale = I18n.locale.to_s %>
|
|
|
|
<% true_false_trans = {'true'=> t('yes'), 'false'=>t('no')} %>
|
|
|
|
<%
|
|
|
|
default_setting = @default_ask_setting.default_setting
|
|
|
|
if default_setting.keys[0].to_s != 'title'
|
|
|
|
default_setting = {title: true}.merge(default_setting)
|
|
|
|
end
|
|
|
|
%>
|
|
|
|
<% default_setting.each do |k,v| %>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<%= tmp = @default_ask_setting.field_name(k,locale, true) %>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<%=
|
|
|
|
tmp2 = true_false_trans[v]
|
|
|
|
tmp2 = true_false_trans.values[0] if tmp2.nil?
|
|
|
|
tmp2
|
|
|
|
%>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<%= t("ask.usage_rule") %>
|
|
|
|
</td>
|
|
|
|
<td colspan="2">
|
2022-09-21 10:07:01 +00:00
|
|
|
<%= @default_ask_setting.usage_rule.to_s.html_safe %>
|
2022-07-07 08:54:09 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
<% @default_ask_setting.custom_fields.each do |k,v| %>
|
2022-09-22 08:06:12 +00:00
|
|
|
<%= custom_field_block_for_ask(k,v,true).html_safe %>
|
2022-07-07 08:54:09 +00:00
|
|
|
<% end %>
|
|
|
|
</table>
|
|
|
|
</fieldset>
|