diff --git a/config/environments/development.rb b/config/environments/development.rb index 048dfff1..1ae657f6 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -23,7 +23,7 @@ Orbit::Application.configure do # Only use best-standards-support built into browsers config.action_dispatch.best_standards_support = :builtin - config.cache_store = :mem_cache_store + # config.cache_store = :mem_cache_store config.assets.debug = true diff --git a/config/locales/en.yml b/config/locales/en.yml index 3966c893..06f7ae64 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -298,4 +298,5 @@ en: domains: Google Search Domains site_search: Site Search sitesearch: Google Site Search - site_setting_help: Please Enter the search argument for Google search. \ No newline at end of file + site_setting_help: Please Enter the search argument for Google search. + result_get: "Found %{item_num} items" diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index c06bdf07..00135276 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -436,6 +436,7 @@ zh_tw: site_search: "全站搜尋" sitesearch: Google Site Search site_setting_help: 請輸入送交Google搜尋的參數 + result_get: "共搜尋到%{item_num}筆資料" activerecord: errors: template: # ~ 2.3.5 backward compatible 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 33f5df00..bcbffe60 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 @@ -12,8 +12,9 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController if !params[:search_query].blank? search_cond = {:is_checked=>true,:is_hidden=>false} search_cond.merge!({:bulletin_category_id => "#{params[:category_id]}" }) if !params[:category_id].blank? - search = Redis::Search.query("Bulletin", params[:search_query], :conditions =>search_cond) + search = Redis::Search.query("Bulletin", params[:search_query], :conditions =>search_cond,:limit=>Bulletin.all.count) search_result = search.collect{|t| t["id"]} + @bulletins = Bulletin.all.can_display.any_in(_id:search_result).page( params[:page_main]).per(10) else date_now = Time.now diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb index 4ba18b51..228ce31c 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb @@ -15,7 +15,11 @@ <%= t('announcement.bulletin.title') %> <%= t('announcement.bulletin.postdate') %> - + <% if @bulletins.blank? %> + <%=render :partial => 'shared/search_not_found' %> + <% else %> + <%= t("search.result_get",:item_num=>@bulletins.count) %> + <% end %> <% @bulletins.each do |post| %> <%= post.bulletin_category.i18n_variable[I18n.locale] rescue nil %> diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb index 540f33b2..0174c2b5 100644 --- a/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb +++ b/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb @@ -12,7 +12,7 @@ class Panel::News::FrontEnd::NewsBulletinsController < OrbitWidgetController if !params[:search_query].blank? search_cond = {:is_checked=>true,:is_hidden=>false} search_cond.merge!({:news_bulletin_category_id => "#{params[:category_id]}" }) if !params[:category_id].blank? - search = Redis::Search.query("NewsBulletin", params[:search_query], :conditions =>search_cond) + search = Redis::Search.query("NewsBulletin", params[:search_query], :conditions =>search_cond,:limit=>NewsBulletin.all.count) search_result = search.collect{|t| t["id"]} @news_bulletins = NewsBulletin.all.can_display.any_in(_id:search_result).page( params[:page_main]).per(10) else diff --git a/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/index.html.erb b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/index.html.erb index 76ad680c..dc55f48a 100644 --- a/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/index.html.erb +++ b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/index.html.erb @@ -7,7 +7,11 @@ <% else %>

<%= t('news.news') %>

<% end %> - + <% if @news_bulletins.blank? %> + <%=render :partial => 'shared/search_not_found' %> + <% else %> + <%= t("search.result_get",:item_num=>@news_bulletins.count) %> + <% end %> @@ -25,9 +29,6 @@ <% end %> - <% if @news_bulletins.blank? %> - <%=render :partial => 'shared/search_not_found' %> - <% end %>
<%= display_date(post.postdate) %>