\ No newline at end of file
diff --git a/app/views/asks/thank.html.erb b/app/views/asks/thank.html.erb
index 1dea08e..f01d9ca 100644
--- a/app/views/asks/thank.html.erb
+++ b/app/views/asks/thank.html.erb
@@ -2,5 +2,10 @@
-
我們已經收到您的預約,期待您的蒞臨,謝謝
+
+ <% text = AskAcknowledgement.first.content[I18n.locale] rescue t('ask.thank_text')
+ text = t('ask.thank_text') if text.to_s.empty?
+ %>
+ <%= text.html_safe %>
+
\ No newline at end of file
diff --git a/ask.gemspec b/ask.gemspec
index edc13f9..dfef73c 100644
--- a/ask.gemspec
+++ b/ask.gemspec
@@ -2,7 +2,20 @@ $:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "ask/version"
-
+app_path = File.expand_path(__dir__)
+template_path = ENV['PWD'] + '/app/templates'
+all_template = Dir.glob(template_path+'/*/')
+puts 'copying ask module'
+all_template.each do |folder|
+ if folder.split('/')[-1] != 'mobile'
+ begin
+ system ('cp -r '+ app_path + '/modules/ ' + folder)
+ rescue
+ puts 'error copy'
+ end
+ end
+end
+#syst
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "ask"
diff --git a/config/locales/en.yml b/config/locales/en.yml
index ce9988b..40d1c17 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1,10 +1,13 @@
en:
situation: Situation
- is_waiting: Pending
- is_processed: Processed
- is_referral: Rreferral
sex: Sex
ask:
+ no_index_page: There are no page for ask module created at site struture.
+ thank_text: We will reply as soon as posible,thank you.
+ is_waiting: Pending
+ is_processed: Processed
+ is_referral: Rreferral
+ is_published: Processed and Published
'yes': 'Yes'
'no': 'No'
required: Required
@@ -56,4 +59,5 @@ en:
content: Content
comment: Comment
status: Status
- send_email: Whether to reply email
\ No newline at end of file
+ send_email: Whether to reply email
+ agree_show: Do you agree on displaying your request and our reply on the webpage without your personal information?
\ No newline at end of file
diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml
index 54a2692..acdc07a 100644
--- a/config/locales/zh_tw.yml
+++ b/config/locales/zh_tw.yml
@@ -2,15 +2,18 @@ zh_tw:
situation: 狀況
identity: 身份
- is_waiting: 待處理
- is_processed: 已處理
- is_referral: 轉介其他單位
module_name:
ask: 發問
recaptcha:
errors:
verification_failed: 驗證碼錯誤
ask:
+ no_index_page: 前台頁面尚未被建立,請前往網站架構設定,謝謝。
+ thank_text: 我們已經收到您的預約,期待您的蒞臨,謝謝
+ is_waiting: 待處理
+ is_processed: 已處理
+ is_referral: 轉介其他單位
+ is_published: 已處理並發佈網頁
'yes': 是
'no': 否
required: 必填
@@ -24,7 +27,7 @@ zh_tw:
field_name: 欄位名稱
whether_open: 是否開啟
setting: 設定
- name: 預約客戶
+ name: 發問者
appointment: 預約時間
created_at: 發問時間
phone: 聯絡電話
@@ -69,4 +72,5 @@ zh_tw:
content: 內容
comment: 備註
status: 狀態
- send_email: 是否回信
\ No newline at end of file
+ send_email: 是否回信
+ agree_show: 是否同意您提出之需求及回覆內容以不呈現發問者資訊方式刊載於網站供他人參考?
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index 2989470..74e8da4 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -15,8 +15,7 @@ Rails.application.routes.draw do
resources :ask_acknowledgements
resources :ask_admins
end
-
- resources :asks #fronted
+ resources :asks #fronted
end
end
diff --git a/lib/ask/engine.rb b/lib/ask/engine.rb
index bf5c7cd..9803bc7 100644
--- a/lib/ask/engine.rb
+++ b/lib/ask/engine.rb
@@ -1,6 +1,29 @@
module Ask
class Engine < ::Rails::Engine
initializer "ask" do
+ locales = Site.first.in_use_locales rescue [:en,:zh_tw]
+ begin
+ t_data0 = locales.collect{|l| Dir["#{ENV['PWD']}/config/locales/#{l.to_s}.yml"]}.flatten.map{|yaml_file| YAML.load(File.read(yaml_file))}
+ t_data1 = Dir["#{Ask::Engine.root}/config/locales/*.yml"].map{|yaml_file| YAML.load(File.read(yaml_file))}
+ data_item = {}
+ key_item1 = {}
+ value_item1 = {}
+ value_item2 = {}
+ t_data0.each do |t_data|
+ v = t_data.values
+ k = t_data.keys[0]
+ key_item1[k] = v[0]['theme']
+ end
+ t_data1.each do |t_data|
+ v = t_data.values
+ k = t_data.keys[0]
+ value_item1[k] = v[0]['ask']['widget']['index']
+ value_item2[k] = v[0]['ask']['is_published']
+ end
+ data_item[key_item1] = [value_item1,value_item2]
+ rescue => e
+ puts ['error in ask',e]
+ end
begin
require File.expand_path('../../../app/models/ask_setting', __FILE__)
require File.expand_path('../../../app/models/ask_setting_index', __FILE__)
@@ -16,9 +39,14 @@ module Ask
OrbitApp.registration "Ask", :type => "ModuleApp" do
module_label "ask.ask"
base_url File.expand_path File.dirname(__FILE__)
- # widget_methods ["widget","widget1"]
- # widget_settings [{"data_count"=>10}]
+ widget_methods ["widget"]
+ widget_settings [{"data_count"=>10}]
taggable "AskQuestion"
+ begin
+ show_option_items data_item
+ rescue => e
+ puts ['there_was_no_show_option_method',e]
+ end
categorizable
authorizable
frontend_enabled
diff --git a/modules/ask/_ask_widget_form.html.erb b/modules/ask/_ask_widget_form.html.erb
new file mode 100644
index 0000000..04e2573
--- /dev/null
+++ b/modules/ask/_ask_widget_form.html.erb
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+ {{widget-title}}
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/ask/_ask_widget_list.html.erb b/modules/ask/_ask_widget_list.html.erb
new file mode 100644
index 0000000..03687c0
--- /dev/null
+++ b/modules/ask/_ask_widget_list.html.erb
@@ -0,0 +1,17 @@
+
+
+ {{widget-title}}
+
+
+
+
+
{{td}}
+
+
+
+
+
{{content}}
+
+
+
+
\ No newline at end of file
diff --git a/modules/ask/info.json b/modules/ask/info.json
new file mode 100644
index 0000000..9dd7c12
--- /dev/null
+++ b/modules/ask/info.json
@@ -0,0 +1,20 @@
+{
+ "widgets" : [
+ {
+ "filename" : "ask_widget_form",
+ "name" : {
+ "zh_tw" : "1. 模組標題、發問介面",
+ "en" : "1. widget-title, question"
+ },
+ "thumbnail" : "thumb.png"
+ },
+ {
+ "filename" : "ask_widget_list",
+ "name" : {
+ "zh_tw" : "2. 模組標題、 發佈回覆列表",
+ "en" : "2. widget-title, published list"
+ },
+ "thumbnail" : "thumb.png"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/modules/ask/thumbs/thumb.png b/modules/ask/thumbs/thumb.png
new file mode 100644
index 0000000..266af56
Binary files /dev/null and b/modules/ask/thumbs/thumb.png differ