2020-03-21 15:36:33 +00:00
|
|
|
|
<%
|
2020-07-27 02:11:58 +00:00
|
|
|
|
ask_setting = @ask_setting
|
2022-09-21 10:07:01 +00:00
|
|
|
|
set_input_name_for_ask('ask_question')
|
2020-03-21 15:36:33 +00:00
|
|
|
|
%>
|
2014-10-02 06:00:35 +00:00
|
|
|
|
<% content_for :page_specific_css do %>
|
|
|
|
|
<%= stylesheet_link_tag "lib/main-forms" %>
|
|
|
|
|
<%= stylesheet_link_tag "lib/main-list" %>
|
2020-03-22 04:27:46 +00:00
|
|
|
|
<%= stylesheet_link_tag "custom_field" %>
|
2014-10-02 06:00:35 +00:00
|
|
|
|
<% end %>
|
2020-03-21 15:36:33 +00:00
|
|
|
|
<%# javascript_include_tag "lib/bootstrap-datetimepicker.js" %>
|
|
|
|
|
<%# javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min.js"%>
|
2020-03-22 15:58:53 +00:00
|
|
|
|
<%# javascript_include_tag "/assets/lib/jquery-ui-1.12.1/jquery-ui.min" %>
|
2020-03-21 15:36:33 +00:00
|
|
|
|
<%# javascript_include_tag "lib/module-area" %>
|
2020-03-22 15:58:53 +00:00
|
|
|
|
<%# javascript_include_tag "jquery.ui.datepicker.monthyearpicker" %>
|
2020-03-21 15:36:33 +00:00
|
|
|
|
<%# javascript_include_tag "lib/bootstrap-datetimepicker" %>
|
|
|
|
|
<style type="text/css">
|
2020-07-27 02:11:58 +00:00
|
|
|
|
.input-area tr td {
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
.form-horizontal .control-label {
|
|
|
|
|
padding-top: 0;
|
|
|
|
|
}
|
2020-03-21 15:36:33 +00:00
|
|
|
|
</style>
|
2020-05-30 14:20:10 +00:00
|
|
|
|
<script type="text/javascript">
|
2020-07-27 02:11:58 +00:00
|
|
|
|
$(document).ready(function(){
|
2020-05-30 14:20:10 +00:00
|
|
|
|
$('input:file').change(function(e){
|
|
|
|
|
var fileName = e.target.files[0].name;
|
|
|
|
|
$(this).parents(".file-selector").eq(0).find('.filename').html(fileName);
|
|
|
|
|
})
|
|
|
|
|
$('input:file').each(function(i,v){
|
2020-07-27 02:11:58 +00:00
|
|
|
|
|
|
|
|
|
var filename = $(v).attr('value')
|
|
|
|
|
if (filename){
|
|
|
|
|
if ($(v).attr('data-image-src')){
|
|
|
|
|
$(v).parents(".file-selector").eq(0).find('.filename').html("<img src=\""+$(v).attr('data-image-src')+"\">"+filename);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
$(v).parents(".file-selector").eq(0).find('.filename').html("<a href=\""+$(v).attr('data-src')+"\">"+filename);
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-05-30 14:20:10 +00:00
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
</script>
|
2014-10-02 06:00:35 +00:00
|
|
|
|
<div class="input-area">
|
2020-07-27 02:11:58 +00:00
|
|
|
|
<div id="ask-asks">
|
|
|
|
|
<table class="table">
|
|
|
|
|
<tr>
|
|
|
|
|
<td><%= AskQuestion.human_attribute_name(:name) %>:<%= @ask_question.name %></td>
|
|
|
|
|
<!-- <td><%# AskQuestion.human_attribute_name(:identity) %>:
|
|
|
|
|
<%# Tag.where({:id => @ask_question[:identity]}).each do |tag| %>
|
|
|
|
|
<%# tag.name %>
|
|
|
|
|
<%# end %>
|
|
|
|
|
</td> -->
|
|
|
|
|
<td><%= AskQuestion.human_attribute_name(:mail) %>:<%= @ask_question.mail %></td>
|
|
|
|
|
<td><%= AskQuestion.human_attribute_name(:phone) %>:<%= @ask_question.phone %></td>
|
|
|
|
|
<!-- <td><%# AskQuestion.human_attribute_name(:fax) %>:<%# @ask_question.fax %></td> -->
|
|
|
|
|
</tr>
|
2022-08-18 03:07:45 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="5"><%= t('ask.serial_number') %>:<%= @ask_question.get_serial_number %></td>
|
|
|
|
|
</tr>
|
2020-07-27 02:11:58 +00:00
|
|
|
|
<tr>
|
2022-07-07 08:54:09 +00:00
|
|
|
|
<td colspan="5"><%= t('ask.ip') %>:<%= @ask_question.ip %></td>
|
2020-07-27 02:11:58 +00:00
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
2022-07-07 08:54:09 +00:00
|
|
|
|
<td colspan="5"><%= t('title') %>:<%= @ask_question.title %></td>
|
2020-07-27 02:11:58 +00:00
|
|
|
|
</tr>
|
2022-07-07 08:54:09 +00:00
|
|
|
|
<% if ask_setting.default_setting['appointment'] %>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="5"><%= AskQuestion.human_attribute_name(:appointment) %>:<%= @ask_question.appointment.strftime("%Y-%m-%d %H:%M") rescue nil %></td>
|
|
|
|
|
<!-- <td colspan="5"><%# AskQuestion.human_attribute_name(:name) %>:<%# @ask_question.name %></td> -->
|
|
|
|
|
</tr>
|
|
|
|
|
<% end %>
|
2020-07-27 02:11:58 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<!-- <td colspan="5"><%# AskQuestion.human_attribute_name(:name) %>:<br/><%# @ask_question.name.gsub(/[(\n)(\r)]/, "\n" => "<br/>", "\r" => "" ).html_safe %></td> -->
|
|
|
|
|
</tr>
|
2014-10-02 06:00:35 +00:00
|
|
|
|
|
2020-07-27 02:11:58 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="5">
|
|
|
|
|
<%= f.label :reply %>
|
|
|
|
|
<br/> <%= f.text_area :reply, rows: 10, style: 'width: 500px' %>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="5">
|
|
|
|
|
<%= f.label :comment %>
|
|
|
|
|
<br/> <%= @ask_question.comment %></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="5"><%= f.label :agree_show %><%= @ask_question.agree_show ? t('ask.yes') : t('ask.no') %>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="5"><%= f.label t('situation') %>
|
2022-07-07 08:54:09 +00:00
|
|
|
|
<%= f.select :situation, AskTicketStatus.all.map{|a| [a.title, a.key]} %>
|
2020-07-27 02:11:58 +00:00
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2014-10-02 06:00:35 +00:00
|
|
|
|
|
2020-07-27 02:11:58 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="5">
|
|
|
|
|
<%= 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') %>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
<%= ask_setting.custom_fields.collect do |k,v|
|
|
|
|
|
required_pattern = v['required']=='true' ? '*' : ''
|
|
|
|
|
"<div class=\"control-group\">
|
|
|
|
|
<label class=\"control-label\">#{required_pattern}#{v['field'][I18n.locale]}</label>
|
|
|
|
|
<div class=\"controls\">
|
2022-10-15 04:32:29 +00:00
|
|
|
|
#{show_on_front(k,v,@ask_question,true)}
|
2020-07-27 02:11:58 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>"
|
|
|
|
|
end.join.html_safe %>
|
|
|
|
|
</div>
|
2014-10-02 06:00:35 +00:00
|
|
|
|
</div>
|
2020-04-30 05:18:02 +00:00
|
|
|
|
<%
|
2020-07-27 02:11:58 +00:00
|
|
|
|
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
|
2020-04-30 05:18:02 +00:00
|
|
|
|
%>
|
2014-10-02 06:00:35 +00:00
|
|
|
|
<div class="form-actions">
|
|
|
|
|
<%= f.submit t('submit'), class: 'btn btn-primary' %>
|
2020-04-30 05:18:02 +00:00
|
|
|
|
<%= link_to t('cancel'),cancel_href,title: t('cancel'),:class=> 'btn' %>
|
2014-10-02 06:00:35 +00:00
|
|
|
|
</div>
|