diff --git a/vendor/built_in_modules/survey/app/controllers/panel/survey/front_end/surveys_controller.rb b/vendor/built_in_modules/survey/app/controllers/panel/survey/front_end/surveys_controller.rb index 847fa430d..69f157b50 100644 --- a/vendor/built_in_modules/survey/app/controllers/panel/survey/front_end/surveys_controller.rb +++ b/vendor/built_in_modules/survey/app/controllers/panel/survey/front_end/surveys_controller.rb @@ -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 \ No newline at end of file diff --git a/vendor/built_in_modules/survey/app/models/survey.rb b/vendor/built_in_modules/survey/app/models/survey.rb index 4f271eeef..f94c43766 100644 --- a/vendor/built_in_modules/survey/app/models/survey.rb +++ b/vendor/built_in_modules/survey/app/models/survey.rb @@ -41,6 +41,16 @@ class Survey before_save :check_deadline, :update_avliable_language + def topic + unless self.deadline && Time.now > self.deadline + ('' + self.title + '').html_safe + else + ('' + self.title + '').html_safe + end + end + def time_range r = "#{self.postdate.to_date}" r += "- #{self.deadline.to_date}" if self.deadline diff --git a/vendor/built_in_modules/survey/app/views/panel/survey/front_end/surveys/info.html.erb b/vendor/built_in_modules/survey/app/views/panel/survey/front_end/surveys/info.html.erb new file mode 100644 index 000000000..27ef9712d --- /dev/null +++ b/vendor/built_in_modules/survey/app/views/panel/survey/front_end/surveys/info.html.erb @@ -0,0 +1,16 @@ +
問卷標題 | +問卷說明 | +開始期間 | +結束期間 | +
---|---|---|---|
<%= @survey.title %> | +<%= truncate(@survey.description, to: 40) %> | +<%= @survey.postdate.to_date %> | +<%= @survey.deadline.to_date %> | +