Add routing and links for import
This commit is contained in:
parent
83a8433e52
commit
e2ec8f134e
|
@ -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])
|
redirect_to panel_survey_back_end_surveys_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def set_import
|
||||||
|
@survey = ::Survey.find(params[:id])
|
||||||
|
end
|
||||||
|
|
||||||
|
def import
|
||||||
|
end
|
||||||
|
|
||||||
def export
|
def export
|
||||||
@survey = ::Survey.find(params[:id])
|
@survey = ::Survey.find(params[:id])
|
||||||
@chart_data, @survey_questions, @survey_answers = @survey.generate_chart_data
|
@chart_data, @survey_questions, @survey_answers = @survey.generate_chart_data
|
||||||
|
|
|
@ -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.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.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.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('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>
|
<li><%= link_to t(:delete_), panel_survey_back_end_survey_path(survey), :confirm => t('sure?'), :method => :delete, :remote => true %></li>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
18
vendor/built_in_modules/survey/app/views/panel/survey/back_end/surveys/set_import.html.erb
vendored
Normal file
18
vendor/built_in_modules/survey/app/views/panel/survey/back_end/surveys/set_import.html.erb
vendored
Normal file
|
@ -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">匯入的問卷</th>
|
||||||
|
<th class="span2">原始匯出檔案</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 %>
|
|
@ -23,6 +23,7 @@ en:
|
||||||
|
|
||||||
answers_list: Answers List
|
answers_list: Answers List
|
||||||
export_csv: Export CSV
|
export_csv: Export CSV
|
||||||
|
import_csv: Import CSV
|
||||||
chart: Chart
|
chart: Chart
|
||||||
set_answers: Set Answers
|
set_answers: Set Answers
|
||||||
duplicate_it: Duplicate It
|
duplicate_it: Duplicate It
|
||||||
|
|
|
@ -24,6 +24,7 @@ zh_tw:
|
||||||
|
|
||||||
answers_list: 結果清單
|
answers_list: 結果清單
|
||||||
export_csv: 匯出CSV
|
export_csv: 匯出CSV
|
||||||
|
import_csv: 匯入CSV
|
||||||
chart: 結果圖表
|
chart: 結果圖表
|
||||||
set_answers: 設定結果
|
set_answers: 設定結果
|
||||||
duplicate_it: 複製問卷
|
duplicate_it: 複製問卷
|
||||||
|
|
|
@ -9,6 +9,8 @@ Rails.application.routes.draw do
|
||||||
end
|
end
|
||||||
member do
|
member do
|
||||||
get 'export'
|
get 'export'
|
||||||
|
get 'set_import'
|
||||||
|
post 'import'
|
||||||
get 'set_answers'
|
get 'set_answers'
|
||||||
get 'jump'
|
get 'jump'
|
||||||
get 'duplicate_it'
|
get 'duplicate_it'
|
||||||
|
|
Loading…
Reference in New Issue