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

86 lines
3.4 KiB
Plaintext
Raw Normal View History

<%
ask_setting = AskSetting.first
set_input_name('ask_question')
%>
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" %>
<%= stylesheet_link_tag "custom_field" %>
2014-10-02 06:00:35 +00:00
<% end %>
<%# 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" %>
<%# javascript_include_tag "lib/module-area" %>
2020-03-22 15:58:53 +00:00
<%# javascript_include_tag "jquery.ui.datepicker.monthyearpicker" %>
<%# javascript_include_tag "lib/bootstrap-datetimepicker" %>
<style type="text/css">
.input-area tr td {
text-align: center;
}
</style>
2014-10-02 06:00:35 +00:00
<div class="input-area">
<div id="ask-asks">
<table class="table">
<tr>
<td><%= AskQuestion.human_attribute_name(:name) %><%= @ask_question.name %></td>
2016-11-07 02:08:04 +00:00
<!-- <td><%= AskQuestion.human_attribute_name(:identity) %>
2014-10-23 07:03:21 +00:00
<% Tag.where({:id => @ask_question[:identity]}).each do |tag| %>
<%= tag.name %>
<% end %>
2016-11-07 02:08:04 +00:00
</td> -->
2014-10-02 06:00:35 +00:00
<td><%= AskQuestion.human_attribute_name(:mail) %><%= @ask_question.mail %></td>
<td><%= AskQuestion.human_attribute_name(:phone) %><%= @ask_question.phone %></td>
2016-11-07 02:08:04 +00:00
<!-- <td><%= AskQuestion.human_attribute_name(:fax) %><%= @ask_question.fax %></td> -->
2014-10-02 06:00:35 +00:00
</tr>
<tr>
<td colspan="5"><%= AskQuestion.human_attribute_name(:appointment) %><%= @ask_question.appointment.strftime("%Y-%m-%d %H:%M") rescue nil %></td>
2016-11-07 02:08:04 +00:00
<!-- <td colspan="5"><%= AskQuestion.human_attribute_name(:name) %><%= @ask_question.name %></td> -->
2014-10-02 06:00:35 +00:00
</tr>
<tr>
2016-11-07 02:08:04 +00:00
<!-- <td colspan="5"><%= AskQuestion.human_attribute_name(:name) %><br/><%= @ask_question.name.gsub(/[(\n)(\r)]/, "\n" => "<br/>", "\r" => "" ).html_safe %></td> -->
2014-10-02 06:00:35 +00:00
</tr>
<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/> <%= f.text_field :comment, style: 'width: 500px' %></td>
</tr>
<tr>
2014-10-23 07:03:21 +00:00
<td colspan="5"><%= f.label t('situation') %> <%= f.select :situation, [
[t('is_waiting'), 'is_waiting'],
[t('is_processed'), 'is_processed'],
[t('is_referral'), 'is_referral']
2014-10-02 06:00:35 +00:00
] %></td>
</tr>
<tr>
<td colspan="5">
<%= f.label :send_email %><%= f.radio_button :send_email, 1, checked: @ask_question.send_email? %><%= t('ask.yes') %>
&nbsp;&nbsp;&nbsp;&nbsp;
<%= 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\" for=\"ask_question_mail\">#{required_pattern}#{v['field'][I18n.locale]}</label>
<div class=\"controls\">
#{show_on_front(k,v,@ask_question.custom_values[k])}
</div>
</div>"
end.join.html_safe %>
2014-10-02 06:00:35 +00:00
</div>
</div>
<div class="form-actions">
<%= f.submit t('submit'), class: 'btn btn-primary' %>
<%= f.button t('cancel'), type: 'reset', class: 'btn' %>
</div>