standalone css and icon
This commit is contained in:
parent
cf0d7cfc64
commit
21bf3a0ccd
Binary file not shown.
After Width: | Height: | Size: 524 B |
Binary file not shown.
After Width: | Height: | Size: 738 B |
|
@ -7,7 +7,7 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
background-color: #FFFFFF;
|
background: #FFFFFF none;
|
||||||
box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
|
@ -0,0 +1,83 @@
|
||||||
|
diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb
|
||||||
|
index a6535c5..a89f60e 100644
|
||||||
|
--- a/app/controllers/pages_controller.rb
|
||||||
|
+++ b/app/controllers/pages_controller.rb
|
||||||
|
@@ -7,7 +7,7 @@ class PagesController < ApplicationController
|
||||||
|
@item = Page.find_by_name('home')
|
||||||
|
|
||||||
|
if @item
|
||||||
|
- impressionist(@item)
|
||||||
|
+ delayed_impressionist(@item)
|
||||||
|
render_page
|
||||||
|
else
|
||||||
|
render :text => t(:need_home)
|
||||||
|
@@ -18,7 +18,7 @@ class PagesController < ApplicationController
|
||||||
|
#begin
|
||||||
|
@item = Item.first(:conditions => {:path => params[:page_name]})
|
||||||
|
if @item && @item.is_published && (@item.enabled_for.nil? ? true : @item.enabled_for.include?(I18n.locale.to_s))
|
||||||
|
- impressionist(@item)
|
||||||
|
+ delayed_impressionist(@item)
|
||||||
|
case @item.class.to_s
|
||||||
|
when 'Page'
|
||||||
|
render_page unless save_from_no_lang_for_page
|
||||||
|
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
|
||||||
|
index e20a0c2..b4aa12b 100644
|
||||||
|
--- a/app/helpers/application_helper.rb
|
||||||
|
+++ b/app/helpers/application_helper.rb
|
||||||
|
@@ -278,4 +278,8 @@ module ApplicationHelper
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
+ def delayed_impressionist(object)
|
||||||
|
+ Resque.enqueue_at(1.minute.from_now,DelayedImpressionist,object)
|
||||||
|
+ end
|
||||||
|
+
|
||||||
|
end
|
||||||
|
diff --git a/app/jobs/delayed_impressionist.rb b/app/jobs/delayed_impressionist.rb
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..65a4a6d
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/app/jobs/delayed_impressionist.rb
|
||||||
|
@@ -0,0 +1,7 @@
|
||||||
|
+class DelayedImpressionist
|
||||||
|
+ @queue = :low
|
||||||
|
+ def self.perform(object)
|
||||||
|
+ impressionist(object)
|
||||||
|
+ true
|
||||||
|
+ end
|
||||||
|
+end
|
||||||
|
diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb
|
||||||
|
index 2fe0f71..72fe43b 100644
|
||||||
|
--- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb
|
||||||
|
+++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb
|
||||||
|
@@ -53,7 +53,7 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
||||||
|
else
|
||||||
|
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
||||||
|
end
|
||||||
|
- impressionist(@tag) if @tag
|
||||||
|
+ delayed_impressionist(@tag) if @tag
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
@@ -66,7 +66,7 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
||||||
|
@bulletin = Bulletin.all.can_display.where(_id: params[:id]).first
|
||||||
|
if @bulletin and !@bulletin.disable? and !@bulletin.is_rejected
|
||||||
|
if @bulletin.enabled_for_lang(I18n.locale.to_s)
|
||||||
|
- impressionist(@bulletin)
|
||||||
|
+ delayed_impressionist(@bulletin)
|
||||||
|
get_categorys
|
||||||
|
else
|
||||||
|
render :text => "<div class='alert alert-error'>#{t('sys.can_not_display_due_to_no_context')}</div>".html_safe
|
||||||
|
diff --git a/vendor/built_in_modules/page_content/app/controllers/panel/page_content/front_end/page_contexts_controller.rb b/vendor/built_in_modules/page_content/app/controllers/panel/page_content/front_end/page_contexts_controller.rb
|
||||||
|
index e1e98c7..90a079e 100644
|
||||||
|
--- a/vendor/built_in_modules/page_content/app/controllers/panel/page_content/front_end/page_contexts_controller.rb
|
||||||
|
+++ b/vendor/built_in_modules/page_content/app/controllers/panel/page_content/front_end/page_contexts_controller.rb
|
||||||
|
@@ -8,7 +8,7 @@ class Panel::PageContent::FrontEnd::PageContextsController < OrbitWidgetControll
|
||||||
|
def index
|
||||||
|
# @page_context = PageContext.where("page_id" => params[:page_id], :archived => false)
|
||||||
|
@page_context = PageContext.first(conditions: { page_id: params[:page_id], :archived => false })
|
||||||
|
- impressionist(@page_context)
|
||||||
|
+ delayed_impressionist(@page_context)
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html # index.html.erb
|
|
@ -48,7 +48,21 @@ class Survey
|
||||||
end
|
end
|
||||||
|
|
||||||
def result
|
def result
|
||||||
I18n.t 'survey.view_result'
|
if ( self.result_type == Survey::ResultChart && Time.now > self.deadline ) ||
|
||||||
|
( self.result_type == Survey::ResultExtern && !self.extern_link.blank? ) ||
|
||||||
|
( self.result_type == Survey::ResultFile && self.upload_file? )
|
||||||
|
('<a href="'+Rails.application.routes.url_helpers.result_panel_survey_front_end_survey_path(self) + '"><img src="/assets/result.png" /></a>').html_safe
|
||||||
|
else
|
||||||
|
''
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def write
|
||||||
|
if Time.now < self.deadline
|
||||||
|
('<a href="' + Rails.application.routes.url_helpers.panel_survey_front_end_survey_path(self) + '"><img src="/assets/write.png" /></a>').html_safe
|
||||||
|
else
|
||||||
|
''
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def generate_chart_data
|
def generate_chart_data
|
||||||
|
|
|
@ -46,6 +46,7 @@ zh_tw:
|
||||||
default_widget:
|
default_widget:
|
||||||
title: 問卷標題
|
title: 問卷標題
|
||||||
time_range: 問卷期間
|
time_range: 問卷期間
|
||||||
|
write: 填問卷
|
||||||
result: 結果
|
result: 結果
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
|
|
|
@ -21,10 +21,11 @@ module Faq
|
||||||
widgets do
|
widgets do
|
||||||
default_widget do
|
default_widget do
|
||||||
enable ["typeA"]
|
enable ["typeA"]
|
||||||
query 'Survey.any_of( {deadline: nil,:postdate.lte => Time.now} , {:deadline.gte => Time.now, :postdate.lte => Time.now} )'
|
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}
|
||||||
link_field :result, {:method => 'result_panel_survey_front_end_survey_path', :args=>:self}
|
|
||||||
field :time_range
|
field :time_range
|
||||||
|
field :write
|
||||||
|
field :result
|
||||||
link_to_more 'panel_survey_front_end_survey_path', :title_i18n=> 'faq.default_widget.to_more'
|
link_to_more 'panel_survey_front_end_survey_path', :title_i18n=> 'faq.default_widget.to_more'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue