Compare commits
54
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19068bc8b8 | ||
|
|
d0364c788b | ||
|
|
e2ec8f134e | ||
|
|
83a8433e52 | ||
|
|
8f65da0a04 | ||
|
|
ad8bb72b07 | ||
|
|
06a8b9073e | ||
|
|
627425b72e | ||
|
|
9cb2a5b211 | ||
|
|
75f5404b7a | ||
|
|
bd3a922073 | ||
|
|
9fbb2917b1 | ||
|
|
bd6d94a143 | ||
|
|
8684388ab9 | ||
|
|
5e05f5d02b | ||
|
|
6607f6b66e | ||
|
|
63fab74a25 | ||
|
|
48969b70b5 | ||
|
|
88c8ca68d0 | ||
|
|
3eeda5410c | ||
|
|
660960f316 | ||
|
|
696134aa18 | ||
|
|
2777b92589 | ||
|
|
5432238816 | ||
|
|
4e12c0bb5b | ||
|
|
d68f324ca3 | ||
|
|
50f5d12da3 | ||
|
|
d635c892cf | ||
|
|
26bc837c76 | ||
|
|
8247f077df | ||
|
|
70de1cea9d | ||
|
|
0f18cdfe8e | ||
|
|
0d1426cab8 | ||
|
|
b57b899dba | ||
|
|
1305b9f1ef | ||
|
|
21009961ef | ||
|
|
1edc134691 | ||
|
|
e89615a6f3 | ||
|
|
0c29701f9b | ||
|
|
580be0b34b | ||
|
|
c361a7a201 | ||
|
|
b7bf180df2 | ||
|
|
71dad22b04 | ||
|
|
883496ede1 | ||
|
|
0a1ebf18e3 | ||
|
|
3f9cdec426 | ||
|
|
24b9f4015b | ||
|
|
1237a111ca | ||
|
|
64e14d42e2 | ||
|
|
cc7a4ffb6d | ||
|
|
da40c2b669 | ||
|
|
bf5416095e | ||
|
|
8cd27e26e2 | ||
|
|
d98d008806 |
No files matched your search
+1
-2
@@ -12,7 +12,6 @@ development:
|
||||
test:
|
||||
<<: *defaults
|
||||
database: test_site
|
||||
|
||||
# set these environment variables on your prod server
|
||||
production:
|
||||
# host: <%= ENV['MONGOID_HOST'] %>
|
||||
@@ -21,4 +20,4 @@ production:
|
||||
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
||||
# database: <%= ENV['MONGOID_DATABASE'] %>
|
||||
<<: *defaults
|
||||
database: test_site
|
||||
database: production_8
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
class Panel::Ask::BackEnd::AskCoordinationsController < OrbitWidgetController
|
||||
|
||||
include AdminHelper
|
||||
include OrbitControllerLib::DivisionForDisable
|
||||
|
||||
before_filter :for_app_manager
|
||||
|
||||
def initialize
|
||||
super
|
||||
@app_title = 'ask_coordinations'
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
end
|
||||
Vendored
+103
-1
@@ -1,5 +1,5 @@
|
||||
# encoding: utf-8
|
||||
class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController
|
||||
|
||||
include AdminHelper
|
||||
include OrbitControllerLib::DivisionForDisable
|
||||
|
||||
@@ -13,19 +13,121 @@ class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController
|
||||
def create
|
||||
@ask_question = AskQuestion.find(params[:ask_question_id])
|
||||
@ask_question.ask_reply = AskReply.new(params[:ask_reply])
|
||||
@ask_reply = @ask_question.ask_reply
|
||||
@ask_question.save
|
||||
if @ask_question.ask_reply.send_email?
|
||||
Resque.enqueue(SendAskReplyMail, @ask_reply.ask_question.id)
|
||||
end
|
||||
|
||||
status_stack = []
|
||||
new_status = ""
|
||||
params[:school][:depts].each do |dns|
|
||||
begin
|
||||
status_stack << send_request(dns, @ask_question, @ask_reply)
|
||||
rescue
|
||||
status_stack << "fail"
|
||||
end
|
||||
end unless params[:school].nil?
|
||||
|
||||
success_count = status_stack.count("success")
|
||||
failed_count = status_stack.count("fail")
|
||||
|
||||
if failed_count == 0 && success_count > 0
|
||||
new_status = "轉介其他單位"
|
||||
elsif failed_count > 0 && success_count > 0
|
||||
new_status = "部份轉介失敗"
|
||||
elsif failed_count > 0 && success_count == 0
|
||||
new_status = "轉介失敗"
|
||||
elsif failed_count == 0 && success_count == 0 && @ask_reply.status == "待處理"
|
||||
new_status = "待處理"
|
||||
elsif failed_count == 0 && success_count == 0 && @ask_reply.status == "已處理"
|
||||
new_status = "已處理"
|
||||
elsif failed_count == 0 && success_count == 0 && @ask_reply.status == "轉介其他單位"
|
||||
new_status = "轉介失敗"
|
||||
end
|
||||
|
||||
@ask_reply.update_attributes(status: new_status)
|
||||
|
||||
redirect_to panel_ask_back_end_ask_questions_path, notice: t('ask.reply_success')
|
||||
end
|
||||
|
||||
def update
|
||||
@ask_question = AskQuestion.find(params[:ask_question_id])
|
||||
@ask_reply = AskReply.find(params[:id])
|
||||
@ask_reply.update_attributes(params[:ask_reply])
|
||||
if @ask_reply.send_email?
|
||||
Resque.enqueue(SendAskReplyMail, @ask_reply.ask_question.id)
|
||||
end
|
||||
|
||||
status_stack = []
|
||||
new_status = ""
|
||||
params[:school][:depts].each do |dns|
|
||||
begin
|
||||
status_stack << send_request(dns, @ask_question, @ask_reply)
|
||||
rescue
|
||||
status_stack << "fail"
|
||||
end
|
||||
end unless params[:school].nil?
|
||||
|
||||
success_count = status_stack.count("success")
|
||||
failed_count = status_stack.count("fail")
|
||||
|
||||
if failed_count == 0 && success_count > 0
|
||||
new_status = "轉介其他單位"
|
||||
elsif failed_count > 0 && success_count > 0
|
||||
new_status = "部份轉介失敗"
|
||||
elsif failed_count > 0 && success_count == 0
|
||||
new_status = "轉介失敗"
|
||||
elsif failed_count == 0 && success_count == 0 && @ask_reply.status == "待處理"
|
||||
new_status = "待處理"
|
||||
elsif failed_count == 0 && success_count == 0 && @ask_reply.status == "已處理"
|
||||
new_status = "已處理"
|
||||
elsif failed_count == 0 && success_count == 0 && @ask_reply.status == "轉介其他單位"
|
||||
new_status = "轉介失敗"
|
||||
end
|
||||
|
||||
@ask_reply.update_attributes(status: new_status)
|
||||
redirect_to panel_ask_back_end_ask_questions_path, notice: t('ask.reply_success')
|
||||
end
|
||||
|
||||
def send_request(dep_dns, current_question, current_reply)
|
||||
require 'net/http'
|
||||
require 'uri'
|
||||
require 'json'
|
||||
|
||||
uri_path = "/panel/ask/back_end/ask_requests/transfer_request"
|
||||
http = Net::HTTP.new(dep_dns,80)
|
||||
request = Net::HTTP::Post.new(uri_path)
|
||||
|
||||
body = {
|
||||
# 'auth_token' => '3kjlfksjDFJ',
|
||||
'name' => current_question.name,
|
||||
'title' => current_question.title,
|
||||
'identity' => current_question.identity,
|
||||
'email' => current_question.email,
|
||||
'phone' => current_question.phone,
|
||||
'tax' => current_question.tax,
|
||||
'content' => current_question.content,
|
||||
}
|
||||
#binding.pry
|
||||
status = ""
|
||||
3.times do
|
||||
request.set_form_data(body)
|
||||
request.add_field 'X-Auth-Token', '3kjlfksjDFJ'
|
||||
response = http.request(request)
|
||||
|
||||
if response.code == "200"
|
||||
status = "success"
|
||||
break
|
||||
else
|
||||
status = "fail"
|
||||
end
|
||||
end
|
||||
|
||||
return status
|
||||
# puts "Response #{response.code} #{response.message}: #{response.body}"
|
||||
# flash[:notice] = response.body
|
||||
# flash[:notice] = "Response #{response.code} #{response.message}: #{response.body}"
|
||||
end
|
||||
|
||||
end
|
||||
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
# encoding: utf-8
|
||||
class Panel::Ask::BackEnd::AskRequestsController < OrbitBackendController
|
||||
include AdminHelper
|
||||
include OrbitControllerLib::DivisionForDisable
|
||||
skip_before_filter :verify_authenticity_token
|
||||
|
||||
def transfer_request
|
||||
|
||||
if request.headers["HTTP_X_AUTH_TOKEN"] == '3kjlfksjDFJ'
|
||||
if !AskCategory.where(key: "transferred_question").any?
|
||||
@ask_category = AskCategory.new(key: "transferred_question")
|
||||
@ask_category.name_translations = { "zh_tw" => "轉介的問題", "en" => "Transferred Question" }
|
||||
@ask_category.save!
|
||||
end
|
||||
|
||||
category = AskCategory.where(key: "transferred_question")
|
||||
|
||||
@transfered_question = AskQuestion.new(
|
||||
name: params['name'],
|
||||
identity: params['identity'],
|
||||
email: params['email'],
|
||||
phone: params['phone'],
|
||||
tax: params['tax'],
|
||||
title: params['title'],
|
||||
content: params['content'],
|
||||
ask_category_id: category.first.id)
|
||||
|
||||
@transfered_question.ask_reply = AskReply.new
|
||||
@transfered_question.ask_reply.update_attributes(status: "待處理 (轉)")
|
||||
@transfered_question.save
|
||||
|
||||
render :nothing => true
|
||||
else
|
||||
render :status => 500
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Vendored
+12
-5
@@ -14,18 +14,22 @@ class Panel::Ask::FrontEnd::AskQuestionsController < OrbitWidgetController
|
||||
def create
|
||||
@ask_question = AskQuestion.new(params[:ask_question])
|
||||
if gotcha_valid? && @ask_question.save
|
||||
@acknowledgement = AskAcknowledgement.last
|
||||
@acknowledgement = AskAcknowledgement.last
|
||||
@ask_acknowledgement = AskAcknowledgement.first || AskAcknowlegement.new
|
||||
#@ask_question.save
|
||||
redirect_to root_path
|
||||
|
||||
AskAdmin.all.each do |ask_admin|
|
||||
AskMailer.notice(ask_admin, @ask_question).deliver
|
||||
Resque.enqueue(SendAskNoticeMail, ask_admin.id, @ask_question.id)
|
||||
end
|
||||
# redirect_to panel_ask_front_end_thank_you_path
|
||||
|
||||
# Render to create.js.erb
|
||||
respond_to do |format|
|
||||
format.js
|
||||
# format.js { render :thank_you, notice: 'Your question has been successfully sent.' }
|
||||
end
|
||||
else
|
||||
# Render to index.js.erb
|
||||
respond_to do |format|
|
||||
format.js { render :index }
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -43,4 +47,7 @@ class Panel::Ask::FrontEnd::AskQuestionsController < OrbitWidgetController
|
||||
end
|
||||
@item = Page.find(params[:page_id]) rescue nil
|
||||
end
|
||||
|
||||
def sorry
|
||||
end
|
||||
end
|
||||
+66
@@ -1,3 +1,47 @@
|
||||
<script type="text/javascript">
|
||||
|
||||
var local_host = "<%= request.host %>";
|
||||
|
||||
function hide_current_host_name(localhost) {
|
||||
$('input[type=checkbox]').each(function() {
|
||||
if ($(this).val() == local_host) {
|
||||
$(this).addClass("hide");
|
||||
$(this).next().addClass("hide");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
if ($("#ask_reply_status").val() == '轉介其他單位') {
|
||||
|
||||
hide_current_host_name(local_host);
|
||||
|
||||
$('.dept_options').show();
|
||||
}
|
||||
|
||||
$("#ask_reply_status").change(function() {
|
||||
|
||||
hide_current_host_name(local_host);
|
||||
|
||||
$('.dept_options').slideUp();
|
||||
if ($(this).find('option:selected').attr('value') == '轉介其他單位') {
|
||||
$('.dept_options').slideDown();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
.dept_options {
|
||||
display: none;
|
||||
}
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="ask_question_reply">
|
||||
<%= form_for @ask_reply, url: @url, method: @method do |f| %>
|
||||
<table class="table">
|
||||
@@ -31,7 +75,29 @@
|
||||
['已處理', '已處理'],
|
||||
['轉介其他單位', '轉介其他單位']
|
||||
] %></td>
|
||||
<td id="XXX"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" class="dept_options">
|
||||
<div class="dept_options">
|
||||
<%= check_box("school", "depts", {:multiple => true}, 'ntu_ga_test_p.tp.rulingcom.com', nil) %><%= label_tag("ntu_ga_test_p.tp.rulingcom.com", "測試站總務處 (ntu_ga_test_p)") %>
|
||||
<%= check_box("school", "depts", {:multiple => true}, 'ntu_ga_test.tp.rulingcom.com', nil) %><%= label_tag("ntu_ga_test.tp.rulingcom.com", "測試站總務處經管組 (ntu_ga_test)") %>
|
||||
<!-- <%= check_box("school", "depts", {:multiple => true}, (request.host + ":3000"), nil) %><%= label_tag((request.host + ":3000"), "測試站3000") %>
|
||||
<%= check_box("school", "depts", {:multiple => true}, (request.host + ":4000"), nil) %><%= label_tag((request.host + ":4000"), "測試站4000") %> -->
|
||||
<%= check_box("school", "depts", {:multiple => true}, "", nil) %><%= label_tag(:dep1, "總務長室暨總務處秘書室") %>
|
||||
<%= check_box("school", "depts", {:multiple => true}, "文書組", nil) %><%= label_tag(:dep2, "文書組") %>
|
||||
<%= check_box("school", "depts", {:multiple => true}, "事務組", nil) %><%= label_tag(:dep3, "事務組") %>
|
||||
<%= check_box("school", "depts", {:multiple => true}, "保管組", nil) %><%= label_tag(:dep4, "保管組") %>
|
||||
<%= check_box("school", "depts", {:multiple => true}, "營繕組", nil) %><%= label_tag(:dep5, "營繕組") %>
|
||||
<%= check_box("school", "depts", {:multiple => true}, "出納組", nil) %><%= label_tag(:dep6, "出納組") %>
|
||||
<%= check_box("school", "depts", {:multiple => true}, "採購組", nil) %><%= label_tag(:dep7, "採購組") %>
|
||||
<%= check_box("school", "depts", {:multiple => true}, "經營管理組", nil) %><%= label_tag(:dep8, "經營管理組") %>
|
||||
<%= check_box("school", "depts", {:multiple => true}, "駐警隊", nil) %><%= label_tag(:dep9, "駐警隊") %>
|
||||
<%= check_box("school", "depts", {:multiple => true}, "社科院總務分處", nil) %><%= label_tag(:dep10, "社科院總務分處") %>
|
||||
<%= check_box("school", "depts", {:multiple => true}, "醫學院總務分處", nil) %><%= label_tag(:dep11, "醫學院總務分處") %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<%= f.label :send_email %><%= f.radio_button :send_email, 1, checked: @ask_reply.send_email? %><%= t('ask.yes') %>
|
||||
|
||||
File renamed without changes.
+1
-1
@@ -1 +1 @@
|
||||
window.location.href= "<%= panel_ask_front_end_thank_you_path %>"
|
||||
window.location.href = "<%= panel_ask_front_end_thank_you_path %>";
|
||||
+4
-4
@@ -21,9 +21,9 @@ $(document).ready(function(){
|
||||
$(this).hide();
|
||||
}).bind("ajaxError", function() {
|
||||
$(this).hide();
|
||||
// window.location.href = "<%= panel_ask_front_end_thank_you_path %>";
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="spinner" class="spinner" style="display:none;">
|
||||
@@ -31,11 +31,11 @@ $(document).ready(function(){
|
||||
</div>
|
||||
<div id="new-ask-question" class="ask-question">
|
||||
<div id="acknowledgement"></div>
|
||||
<%= form_for @ask_question, url: panel_ask_front_end_ask_questions_path(standalone: true), html: {class: 'form-horizontal'} do |f| %>
|
||||
<%= form_for @ask_question, url: panel_ask_front_end_ask_questions_path(standalone: true), html: {class: 'form-horizontal'}, method: :post do |f| %>
|
||||
<div class="control-group">
|
||||
<%= f.label :ask_category_id, class: 'control-label required' %>
|
||||
<div class="controls">
|
||||
<%= f.collection_select :ask_category_id, AskCategory.all, :id, :name %>
|
||||
<%= f.collection_select :ask_category_id, AskCategory.all.select { |c| c.key != 'transferred_question' }, :id, :name %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
window.location.href = "<%= panel_ask_front_end_sorry_path %>";
|
||||
+1
@@ -0,0 +1 @@
|
||||
<h3><%= t(:ask_fail, :scope => :ask) %> !</h3>
|
||||
@@ -1,5 +1,6 @@
|
||||
en:
|
||||
ask:
|
||||
ask_fail: Something went wrong
|
||||
ask: Ask
|
||||
export: Export
|
||||
reply: Reply
|
||||
|
||||
@@ -3,6 +3,7 @@ zh_tw:
|
||||
errors:
|
||||
verification_failed: 驗證碼錯誤
|
||||
ask:
|
||||
ask_fail: 寄送失敗
|
||||
ask: 發問
|
||||
export: 匯出
|
||||
reply: 回覆
|
||||
|
||||
+5
-1
@@ -11,14 +11,18 @@ Rails.application.routes.draw do
|
||||
end
|
||||
resources :ask_replies
|
||||
end
|
||||
|
||||
|
||||
resources :ask_categories
|
||||
resources :ask_acknowledgements
|
||||
resources :ask_admins
|
||||
|
||||
match "ask_requests/auth_request" => "ask_requests#auth_request", :as => 'auth_request'
|
||||
match "ask_requests/transfer_request" => "ask_requests#transfer_request", :as => 'transfer_request'
|
||||
end
|
||||
|
||||
namespace :front_end do
|
||||
match "ask_questions/thank_you" => "ask_questions#thank_you", :as => 'thank_you'
|
||||
match "ask_questions/sorry" => "ask_questions#sorry", :as => 'sorry'
|
||||
resources :ask_questions
|
||||
end
|
||||
end
|
||||
|
||||
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Vendored
Whitespace-only changes.
Vendored
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
+1
-1
@@ -17,6 +17,6 @@
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t(:add), new_panel_faq_back_end_qa_path, :class => 'btn btn-primary pull-right' if (is_manager? rescue nil) %>
|
||||
<div id="qa_pagination" class="paginationFixed">
|
||||
<%= paginate @qas, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
|
||||
<%= paginate @qas, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} rescue nil %>
|
||||
</div>
|
||||
</div>
|
||||
+7
@@ -85,6 +85,13 @@ class Panel::Survey::BackEnd::SurveysController < OrbitBackendController
|
||||
redirect_to panel_survey_back_end_surveys_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
||||
def set_import
|
||||
@survey = ::Survey.find(params[:id])
|
||||
end
|
||||
|
||||
def import
|
||||
end
|
||||
|
||||
def export
|
||||
@survey = ::Survey.find(params[:id])
|
||||
@chart_data, @survey_questions, @survey_answers = @survey.generate_chart_data
|
||||
|
||||
Vendored
+6
@@ -110,4 +110,10 @@ class Panel::Survey::FrontEnd::SurveysController < OrbitWidgetController
|
||||
end
|
||||
end
|
||||
|
||||
def info
|
||||
redirect_standalone result_panel_survey_front_end_survey_path(params[:id], :standalone => 'true') do
|
||||
@survey = ::Survey.find params[:id]
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -41,6 +41,16 @@ class Survey
|
||||
|
||||
before_save :check_deadline, :update_avliable_language
|
||||
|
||||
def topic
|
||||
unless self.deadline && Time.now > self.deadline
|
||||
('<a target="_blank" href="' + Rails.application.routes
|
||||
.url_helpers.panel_survey_front_end_survey_path(self, :standalone => true) + '">' + self.title + '</a>').html_safe
|
||||
else
|
||||
('<a target="_blank" href="' + Rails.application.routes
|
||||
.url_helpers.info_panel_survey_front_end_survey_path(self, :standalone => true) + '">' + self.title + '</a>').html_safe
|
||||
end
|
||||
end
|
||||
|
||||
def time_range
|
||||
r = "#{self.postdate.to_date}"
|
||||
r += "- #{self.deadline.to_date}" if self.deadline
|
||||
|
||||
+1
@@ -14,6 +14,7 @@
|
||||
<li><%= link_to t('survey.jump'), jump_panel_survey_back_end_survey_path(survey, :page => params[:page]) %></li>
|
||||
<li><%= link_to t('survey.set_answers'), set_answers_panel_survey_back_end_survey_path(survey, :page => params[:page]) %></li>
|
||||
<li><%= link_to t('survey.export_csv'), export_panel_survey_back_end_survey_path(survey, :format => :csv), :target => '_blank' %></li>
|
||||
<li><%= link_to t('survey.import_csv'), set_import_panel_survey_back_end_survey_path(survey), :target => '_blank' %></li>
|
||||
<li><%= link_to t('survey.chart'), result_panel_survey_front_end_survey_path(survey, :force_chart => true, :standalone => true), :target => '_blank' %></li>
|
||||
<li><%= link_to t(:delete_), panel_survey_back_end_survey_path(survey), :confirm => t('sure?'), :method => :delete, :remote => true %></li>
|
||||
<% end -%>
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
<%= form_tag import_panel_survey_back_end_survey_path(@survey), multipart: true do %>
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span2"><%= t('survey.import.title') %></th>
|
||||
<th class="span2"><%= t('survey.import.description') %></th>
|
||||
<th class="span2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody_surveys" class="sort-holder">
|
||||
<tr>
|
||||
<td><%= @survey.title %></td>
|
||||
<td><%= file_field_tag :file %></td>
|
||||
<td><%= submit_tag t("survey.import_csv"), :class => 'btn' %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<h3>問卷已結束!感謝您的參與!</h3>
|
||||
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>問卷標題</th>
|
||||
<th>問卷說明</th>
|
||||
<th>開始期間</th>
|
||||
<th>結束期間</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= @survey.title %></td>
|
||||
<td><%= truncate(@survey.description, to: 40) %></td>
|
||||
<td><%= @survey.postdate.to_date %></td>
|
||||
<td><%= @survey.deadline.to_date %></td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -23,6 +23,13 @@ en:
|
||||
|
||||
answers_list: Answers List
|
||||
export_csv: Export CSV
|
||||
|
||||
import_csv: Import CSV
|
||||
|
||||
import:
|
||||
title: Imported Survey
|
||||
description: Choose the Modified Exported File According to this Survey
|
||||
|
||||
chart: Chart
|
||||
set_answers: Set Answers
|
||||
duplicate_it: Duplicate It
|
||||
@@ -46,6 +53,7 @@ en:
|
||||
title: Title
|
||||
time_range: Date Range
|
||||
result: Result
|
||||
topic: Title
|
||||
|
||||
frontend:
|
||||
survey: Survey Frontend
|
||||
|
||||
@@ -24,6 +24,13 @@ zh_tw:
|
||||
|
||||
answers_list: 結果清單
|
||||
export_csv: 匯出CSV
|
||||
|
||||
import_csv: 匯入CSV
|
||||
|
||||
import:
|
||||
title: 匯入的問卷
|
||||
description: 選擇根據此問卷所修改的匯出檔案
|
||||
|
||||
chart: 結果圖表
|
||||
set_answers: 設定結果
|
||||
duplicate_it: 複製問卷
|
||||
@@ -48,6 +55,7 @@ zh_tw:
|
||||
time_range: 問卷期間
|
||||
write: 填問卷
|
||||
result: 結果
|
||||
topic: 問卷標題
|
||||
|
||||
frontend:
|
||||
survey: 問卷調查前台
|
||||
|
||||
@@ -9,6 +9,8 @@ Rails.application.routes.draw do
|
||||
end
|
||||
member do
|
||||
get 'export'
|
||||
get 'set_import'
|
||||
post 'import'
|
||||
get 'set_answers'
|
||||
get 'jump'
|
||||
get 'duplicate_it'
|
||||
@@ -24,6 +26,7 @@ Rails.application.routes.draw do
|
||||
resources :surveys do
|
||||
member do
|
||||
get 'result'
|
||||
get 'info'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+4
-1
@@ -20,9 +20,12 @@ module Faq
|
||||
|
||||
widgets do
|
||||
default_widget do
|
||||
sorting 'desc(:postdate)'
|
||||
enable ["typeA"]
|
||||
query 'Survey.any_of( {:postdate.lte => Time.now} )'
|
||||
link_field :title, {:method => 'panel_survey_front_end_survey_path',:args=>:self}
|
||||
# link_field :title, {:method => 'panel_survey_front_end_survey_path',:args=>:self}
|
||||
# field :title
|
||||
field :topic
|
||||
field :time_range
|
||||
field :write
|
||||
field :result
|
||||
|
||||
Reference in new issue
Block a user