diff --git a/app/controllers/admin/asks_controller.rb b/app/controllers/admin/asks_controller.rb index 3f15796..51d74ff 100644 --- a/app/controllers/admin/asks_controller.rb +++ b/app/controllers/admin/asks_controller.rb @@ -32,7 +32,7 @@ class Admin::AsksController < OrbitAdminController @categories = @module_app.categories @filter_fields = filter_fields(@categories, @tags) # 列表欄位 - @table_fields = [:situation, :category, :title, 'ask.name', 'ask.created_at'] + @table_fields = [:situation, :category, 'ask.name', 'ask.phone', 'ask.appointment'] # 列表排序 # debugger if filter2("situation").blank? and filter2("identity").blank? @@ -98,7 +98,7 @@ class Admin::AsksController < OrbitAdminController :mail_sentdate=>@mail_sentdate, :module_app=>@module_app, :mail_to=>@group_mail, - :mail_subject=>Site.first.title_translations["zh_tw"]+" #{t('ask.reply')}:"+email_er.title, + :mail_subject=>" #{t('ask.reply')}:", :template=>'admin/asks/email', :template_data=>{ "reply" => email_er.reply diff --git a/app/controllers/asks_controller.rb b/app/controllers/asks_controller.rb index 7ec9ed3..ee17f40 100644 --- a/app/controllers/asks_controller.rb +++ b/app/controllers/asks_controller.rb @@ -52,16 +52,17 @@ class AsksController < ApplicationController :mail_sentdate=>@mail_sentdate, :module_app=>@module_app, :mail_to=>@group_mail, - :mail_subject=>Site.first.title_translations["zh_tw"]+" #{t('ask.new_question')}:"+email_er.title, + :mail_subject=>Site.first.title_translations["zh_tw"]+" #{t('ask.new_question')}:", :template=>'asks/email', :template_data=>{ - "title" => email_er.title, + # "title" => email_er.title, "name" => email_er.name, "identity" => email_er[:identity], "mail" => email_er.mail, "phone" => email_er.phone, - "fax" => email_er.fax, - "content" => email_er.content + # "fax" => email_er.fax, + # "content" => email_er.content + "appointment" => email_er.appointment } ) diff --git a/app/models/ask_question.rb b/app/models/ask_question.rb index bc5b44b..82b71b0 100644 --- a/app/models/ask_question.rb +++ b/app/models/ask_question.rb @@ -13,6 +13,8 @@ class AskQuestion field :fax, type: String field :title, type: String field :content, type: String + field :appointment, type:DateTime + field :sex field :reply, type: String field :comment, type: String diff --git a/app/views/admin/asks/_form.html.erb b/app/views/admin/asks/_form.html.erb index 25008a0..5ce06b7 100644 --- a/app/views/admin/asks/_form.html.erb +++ b/app/views/admin/asks/_form.html.erb @@ -11,20 +11,21 @@
<%= AskQuestion.human_attribute_name(:name) %>:<%= @ask_question.name %> | -<%= AskQuestion.human_attribute_name(:identity) %>: + | <%= AskQuestion.human_attribute_name(:mail) %>:<%= @ask_question.mail %> | <%= AskQuestion.human_attribute_name(:phone) %>:<%= @ask_question.phone %> | -<%= AskQuestion.human_attribute_name(:fax) %>:<%= @ask_question.fax %> | +|||||
<%= AskQuestion.human_attribute_name(:title) %>:<%= @ask_question.title %> | +<%= AskQuestion.human_attribute_name(:appointment) %>:<%= @ask_question.appointment.strftime("%Y-%m-%d %H:%M") %> | +||||||||
<%= AskQuestion.human_attribute_name(:content) %>: <%= @ask_question.content.gsub(/[(\n)(\r)]/, "\n" => " ", "\r" => "" ).html_safe %> |
+
|||||||||
<%= b.category.title %> | -+ + |
+ <%= b.name %>
+
+
+ |
- <%= b.name %> | -<%= format_value b.created_at %> | +<%= b.phone %> | +<%= b.appointment.strftime("%Y-%m-%d %H:%M") %> |
<%= AskQuestion.human_attribute_name(:name) %>: | <%= @data['name'] %> | ||
---|---|---|---|
<%= AskQuestion.human_attribute_name(:mail) %>: | <%= @data['mail'] %> | @@ -26,14 +26,14 @@<%= AskQuestion.human_attribute_name(:phone) %>: | <%= @data['phone'] %> |
<%= AskQuestion.human_attribute_name(:content) %>: | -<%= @data['content'].gsub(/[(\n)(\r)]/, "\n" => " ", "\r" => "" ).html_safe %> |
- <%= AskQuestion.human_attribute_name(:name) %>: | +<%= @data['name'].gsub(/[(\n)(\r)]/, "\n" => " ", "\r" => "" ).html_safe %> |
+
此為系統自動發信,請勿直接回覆
diff --git a/app/views/asks/index.html.erb b/app/views/asks/index.html.erb index 8d70228..8515066 100644 --- a/app/views/asks/index.html.erb +++ b/app/views/asks/index.html.erb @@ -5,6 +5,18 @@ @module_app = data["module_app"] %> +<%= stylesheet_link_tag "basic/bootstrap-datetimepicker" %> + + +<%= javascript_include_tag "lib/bootstrap-datetimepicker" %> +<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %> + + + <%= javascript_include_tag 'validator' %>