<% 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" %>
<%= AskQuestion.human_attribute_name(:name) %>:<%= @ask_question.name %>
<%= AskQuestion.human_attribute_name(:mail) %>:<%= @ask_question.mail %>
<%= AskQuestion.human_attribute_name(:phone) %>:<%= @ask_question.phone %>
<% ask_setting.custom_fields.each do |k,v| %> <% required_pattern = v['required']=='true' ? '*' : '' %>
<%= show_on_front(k,v,@ask_question,true) %>
<% end %>
<%= @ask_question.get_serial_number %>
<%= @ask_question.ip %>
<%= @ask_question.title %>
<% if ask_setting.default_setting['appointment'] %>
<%= @ask_question.appointment.strftime("%Y-%m-%d %H:%M") if @ask_question.appointment %>
<% end %> <% if !@ask_question.comment.blank? %>
<%= f.label :comment, class: "control-label muted" %>
<%= @ask_question.comment %>
<% end %>
<%= f.label :agree_show, class: "control-label muted" %>
<%= @ask_question.agree_show ? t('ask.yes') : t('ask.no') %>
<%= f.label t('situation'), class: "control-label muted" %>
<%= f.select :situation, AskTicketStatus.default_sorting.map{|a| [a.title, a.key] } %>
<%= select_tags(f, @module_app) %>
<%= f.label :send_email, class: "control-label muted" %>
<%= f.label :reply, class: "control-label muted" %>
<%= f.text_area :reply, rows: 10, style: 'max-width: 500px; width: 100%;' %>
<%= f.text_area :release_comment, :id => "#{f.object_name}_comment" %>
<%= f.file_field :release_file %>

<%= t('history') %>

<% if f.object.ask_status_histories.present? %> <% status_mapping = AskTicketStatus.default_sorting.map{|a| [a.key, a.title]}.to_h %> <% f.object.ask_status_histories.each do |ask_status_history| %> <% end %>
<%= t('status') %> <%= t('ask.modified_by') %> <%= t('ask.remark') %> <%= t('ask.attachment') %> <%= t('ask.updated_at') %>
<%= status_mapping[ask_status_history.status] %> <%= ask_status_history.modified_by_name %> <%= ask_status_history.comment %> <%= link_to(ask_status_history[:file], ask_status_history.file.url) if ask_status_history.file.present? %> <%= ask_status_history.created_at.strftime("%Y-%m-%d %H:%M:%S") %>
<% else %>

<%= t('no_history_records') %>

<% end %>
<% 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' %>