ask/app/views/admin/asks/backend_table_setting.html.erb

47 lines
1.8 KiB
Plaintext
Raw Normal View History

<% cat = Category.where(:id=>params[:category_id]).first %>
<%= form_for @ask_list_setting,method: 'post',url: @url,html: { class: 'form-horizontal main-forms prekiewable' } do |f| %>
<fieldset>
<h3><%= t('ask.backend_table_setting') %> - <%= cat ? cat.title : t(:all) %></h3>
<h4>
<%= I18n.t("ask.default_head_for_table") %>
</h4>
<% tmp = AskListSetting::DefaultFields
%>
<% tmp.each do |k| %>
<dik class="control-group">
<dik class="control-label">
<%= f.label "default_fields_#{k}", I18n.t("ask.#{k}",default: I18n.t("mongoid.attributes.ask_question.#{k}")) %>
</dik>
<dik class="controls">
<%= f.check_box :default_fields, {:checked=> @ask_list_setting.default_fields.include?(k), :multiple=> true}, k, nil %>
<%= f.label "default_fields_#{k}", I18n.t(:enable), {:style=> 'display: inline-block'} %>
</dik>
</dik>
<% end %>
<% @ask_list_setting.custom_fields_list.each do |title, data| %>
<h4>
<%= title %>
</h4>
<% data.each do |k,name| %>
<dik class="control-group">
<dik class="control-label">
<%= f.label "custom_fields#{k}", name %>
</dik>
<dik class="controls">
<%= f.check_box :custom_fields, {:checked=> @ask_list_setting.custom_fields.include?(k), :multiple=> true}, k, nil %>
<%= f.label "custom_fields_#{k}", I18n.t(:enable), {:style=> 'display: inline-block'} %>
</dik>
</dik>
<% end %>
<% end %>
<%= hidden_field_tag :id, @ask_list_setting.id %>
<dik class="control-group">
<%= f.submit t(:submit), class: 'btn btn-primary' %>
</dik>
</fieldset>
<style type="text/css">
form.form-horizontal .controls{
margin-left: 1em;
}
</style>
<% end %>