<% ask_setting = @ask_setting set_input_name_for_ask('ask_question') %> <% content_for :page_specific_css do %> <%= stylesheet_link_tag "lib/main-forms" %> <%= stylesheet_link_tag "lib/main-list" %> <%= stylesheet_link_tag "custom_field" %> <% end %> <%# javascript_include_tag "lib/bootstrap-datetimepicker.js" %> <%# javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min.js"%> <%# javascript_include_tag "/assets/lib/jquery-ui-1.12.1/jquery-ui.min" %> <%# javascript_include_tag "lib/module-area" %> <%# javascript_include_tag "jquery.ui.datepicker.monthyearpicker" %> <%# javascript_include_tag "lib/bootstrap-datetimepicker" %>
<% if ask_setting.default_setting['appointment'] %> <% end %>
<%= AskQuestion.human_attribute_name(:name) %>:<%= @ask_question.name %> <%= AskQuestion.human_attribute_name(:mail) %>:<%= @ask_question.mail %> <%= AskQuestion.human_attribute_name(:phone) %>:<%= @ask_question.phone %>
<%= t('ask.serial_number') %>:<%= @ask_question.get_serial_number %>
<%= t('ask.ip') %>:<%= @ask_question.ip %>
<%= t('title') %>:<%= @ask_question.title %>
<%= AskQuestion.human_attribute_name(:appointment) %>:<%= @ask_question.appointment.strftime("%Y-%m-%d %H:%M") rescue nil %>
<%= f.label :reply %>
<%= f.text_area :reply, rows: 10, style: 'width: 500px' %>
<%= f.label :comment %>
<%= @ask_question.comment %>
<%= f.label :agree_show %><%= @ask_question.agree_show ? t('ask.yes') : t('ask.no') %>
<%= f.label t('situation') %> <%= f.select :situation, AskTicketStatus.all.map{|a| [a.title, a.key]} %>
<%= f.label :send_email %><%= f.radio_button :send_email, 1, checked: @ask_question.send_email? %><%= t('ask.yes') %>      <%= f.radio_button :send_email, 0, checked: !@ask_question.send_email? %><%= t('ask.no') %>
<%= ask_setting.custom_fields.collect do |k,v| required_pattern = v['required']=='true' ? '*' : '' "
#{show_on_front(k,v,@ask_question.custom_values[k],true)}
" end.join.html_safe %>
<% cancel_href = url_for(:back) if cancel_href == 'javascript:history.back()' now_ask_page = AskQuestion.order_by(:id).map(&:id).map.with_index.select{|v,i| v==@ask_question.id}[0][1] rescue nil now_ask_page = now_ask_page.nil? ? 1 : ((now_ask_page+1).to_f/10).ceil cancel_href = "/#{I18n.locale}/admin/asks?page=#{now_ask_page}" end %>
<%= f.submit t('submit'), class: 'btn btn-primary' %> <%= link_to t('cancel'),cancel_href,title: t('cancel'),:class=> 'btn' %>