Modified some field

This commit is contained in:
Keith 2016-11-07 10:08:04 +08:00
parent d33b0fe5a7
commit 2a0a0a6241
10 changed files with 90 additions and 37 deletions

View File

@ -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

View File

@ -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
}
)

View File

@ -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

View File

@ -11,20 +11,21 @@
<table class="table">
<tr>
<td><%= AskQuestion.human_attribute_name(:name) %><%= @ask_question.name %></td>
<td><%= AskQuestion.human_attribute_name(:identity) %>
<!-- <td><%= AskQuestion.human_attribute_name(:identity) %>
<% Tag.where({:id => @ask_question[:identity]}).each do |tag| %>
<%= tag.name %>
<% end %>
</td>
</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>
<!-- <td><%= AskQuestion.human_attribute_name(:fax) %><%= @ask_question.fax %></td> -->
</tr>
<tr>
<td colspan="5"><%= AskQuestion.human_attribute_name(:title) %><%= @ask_question.title %></td>
<td colspan="5"><%= AskQuestion.human_attribute_name(:appointment) %><%= @ask_question.appointment.strftime("%Y-%m-%d %H:%M") %></td>
<!-- <td colspan="5"><%= AskQuestion.human_attribute_name(:name) %><%= @ask_question.name %></td> -->
</tr>
<tr>
<td colspan="5"><%= AskQuestion.human_attribute_name(:content) %><br/><%= @ask_question.content.gsub(/[(\n)(\r)]/, "\n" => "<br/>", "\r" => "" ).html_safe %></td>
<!-- <td colspan="5"><%= AskQuestion.human_attribute_name(:name) %><br/><%= @ask_question.name.gsub(/[(\n)(\r)]/, "\n" => "<br/>", "\r" => "" ).html_safe %></td> -->
</tr>
<tr>

View File

@ -19,7 +19,7 @@
<% end %>
</td>
<td><%= b.category.title %></td>
<td>
<!-- <td>
<%= b.title %>
<div class="quick-edit">
<ul class="nav nav-pills">
@ -29,9 +29,20 @@
<% end %>
</ul>
</div>
</td> -->
<td>
<%= b.name %>
<div class="quick-edit">
<ul class="nav nav-pills">
<% if can_edit_or_delete?(b) %>
<li><a href="/admin/asks/<%=b.id.to_s%>/edit"><%= t(:edit) %></a></li>
<li><a href="#" class="delete text-error" rel="/admin/asks/<%=b.id.to_s%>"><%= t(:delete_) %></a></li>
<% end %>
</ul>
</div>
</td>
<td><%= b.name %></td>
<td><%= format_value b.created_at %></td>
<td><%= b.phone %></td>
<td><%= b.appointment.strftime("%Y-%m-%d %H:%M") %></td>
</tr>
<% end %>
</tbody>

View File

@ -4,20 +4,20 @@
<meta charset="UTF-8">
</head>
<body>
<h1><%= @data['title'] %></h1>
<!-- <h1><%= @data['title'] %></h1> -->
<table>
<tr>
<th><%= AskQuestion.human_attribute_name(:name) %></th>
<td><%= @data['name'] %></td>
</tr>
<tr>
<!-- <tr>
<th><%= AskQuestion.human_attribute_name(:identity) %></th>
<td>
<% Tag.where({:id => @data['identity']}).each do |tag| %>
<%= tag.name %>
<% end %>
</td>
</tr>
</tr> -->
<tr>
<th><%= AskQuestion.human_attribute_name(:mail) %></th>
<td><%= @data['mail'] %></td>
@ -26,14 +26,14 @@
<th><%= AskQuestion.human_attribute_name(:phone) %></th>
<td><%= @data['phone'] %></td>
</tr>
<tr>
<!-- <tr>
<th><%= AskQuestion.human_attribute_name(:fax) %></th>
<td><%= @data['fax'] %></td>
</tr>
</tr> -->
<tr>
<th><%= AskQuestion.human_attribute_name(:content) %></th>
<td><%= @data['content'].gsub(/[(\n)(\r)]/, "\n" => "<br/>", "\r" => "" ).html_safe %></td>
</tr>
<th><%= AskQuestion.human_attribute_name(:name) %></th>
<td><%= @data['name'].gsub(/[(\n)(\r)]/, "\n" => "<br/>", "\r" => "" ).html_safe %></td>
</tr>
</table>
<p>此為系統自動發信,請勿直接回覆</p>
</body>

View File

@ -5,6 +5,18 @@
@module_app = data["module_app"]
%>
<%= stylesheet_link_tag "basic/bootstrap-datetimepicker" %>
<style type="text/css">
.default_picker label{
display: none;
}
</style>
<%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<%= javascript_include_tag 'validator' %>
<link href="/assets/ask/ask.css" media="screen" rel="stylesheet">
<div id="new-ask-question" class="ask-question">
@ -23,13 +35,25 @@
<%= f.text_field :name, data: {"fv-validation" => "required;", "fv-messages" => "必填欄位;"} %>
</div>
</div>
<!-- 身分 -->
<!-- 性別 -->
<div class="control-group">
<%= f.label :sex, class: 'control-label required' %>
<div class="controls">
<label class="radio-inline">
<%= f.radio_button :sex, "male" %><%= t('users.male')%>
</label>
<label class="radio-inline">
<%= f.radio_button :sex, "female" %><%= t('users.female')%>
</label>
</div>
</div>
<!-- 身分 -->
<!-- <div class="control-group">
<%= f.label :identity, class: 'control-label required' %>
<div class="controls">
<%= select_tag "ask_question[identity]", options_for_select(@tags.collect{|t| [ t.name, t.id ]}) if !@tags.nil? %>
</div>
</div>
</div> -->
<!-- Email -->
<div class="control-group">
<%= f.label :mail, class: 'control-label required' %>
@ -44,27 +68,34 @@
<%= f.text_field :phone %>
</div>
</div>
<!-- 傳真 -->
<!-- 預約日期 -->
<div class="control-group">
<%= f.label :appointment, class: 'control-label' %>
<div class="controls">
<%= f.datetime_picker :appointment %>
</div>
</div>
<!-- 傳真 -->
<!-- <div class="control-group">
<%= f.label :fax, class: 'control-label' %>
<div class="controls">
<%= f.text_field :fax %>
</div>
</div>
</div> -->
<!-- 主旨 -->
<div class="control-group">
<!-- <div class="control-group">
<%= f.label :title, class: 'control-label required' %>
<div class="controls">
<%= f.text_field :title, data: {"fv-validation" => "required;", "fv-messages" => "必填欄位;"} %>
</div>
</div>
</div> -->
<!-- 內容 -->
<div class="control-group">
<!-- <div class="control-group">
<%= f.label :content, class: 'control-label required' %>
<div class="controls">
<%= f.text_area :content, rows: 8, class: 'input-xlarge' %>
</div>
</div>
</div> -->
<!-- 驗證碼 -->
<div class="control-group">
<%= f.label :recaptcha, class: 'control-label' %>

View File

@ -1,7 +1,6 @@
<% data = action_data
@acknowledgement = data["acknowledgement"]
%>
<link href="/assets/ask/ask.css" media="screen" rel="stylesheet">
<div class="form-horizontal">
<%= @acknowledgement[:content].gsub(/[(\n)(\r)]/, "\n" => "<br/>", "\r" => "" ).html_safe %>
</div>
<h2>我們已經收到您的預約,期待您的蒞臨,謝謝</h2>
</div>

View File

@ -3,6 +3,7 @@ en:
is_waiting: Pending
is_processed: Processed
is_referral: Rreferral
sex: Sex
ask:
ask: Ask
all_articles: All
@ -25,5 +26,7 @@ en:
mongoid:
attributes:
ask_question:
male: Man
female: Woman
ask_category_id: Ask Category
identity: Identity

View File

@ -5,15 +5,16 @@ zh_tw:
is_waiting: 待處理
is_processed: 已處理
is_referral: 轉介其他單位
module_name:
ask: 發問
recaptcha:
errors:
verification_failed: 驗證碼錯誤
ask:
name: 發問人
name: 預約客戶
appointment: 預約時間
created_at: 發問時間
phone: 聯絡電話
status: 狀態
ask: 發問
all_articles: 全部
@ -40,10 +41,14 @@ zh_tw:
ask_question:
ask_category_id: 諮詢類別
recaptcha: 驗證碼
sex: 性別
name: 姓名
identity: 身份
mail: Email
phone: 聯絡電話
male:
female:
appointment: 預約時間
fax: 傳真
title: 主旨
reply: 回覆