From 73b2cd1035c82307d1a53ef5e0fdd66c204fb4b1 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Sun, 5 Aug 2012 15:04:52 +0800 Subject: [PATCH] Fix typo and title in news and announcement frontend --- .../front_end/bulletins_controller.rb | 2 ++ .../front_end/bulletins/index.html.erb | 6 +----- .../news/front_end/news_bulletins_controller.rb | 6 ++++-- .../news/front_end/news_bulletins/index.html.erb | 16 +++++++--------- 4 files changed, 14 insertions(+), 16 deletions(-) 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 b3d71665..685eaa24 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 @@ -9,6 +9,7 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController # GET /bulletins.xml def index + @page = Page.find(params[:page_id]) if !params[:search_query].blank? search_cond = {:is_checked=>true,:is_hidden=>false,:is_pending => false} search_cond.merge!({:bulletin_category_id => "#{params[:category_id]}" }) if !params[:category_id].blank? @@ -39,6 +40,7 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController end def show + @page = Page.find(params[:page_id]) if params[:preview] == "true" preview_content else 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 6049186d..1bb363d0 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 @@ -2,11 +2,7 @@ <%= flash_messages %> -<% if @current_category %> -

<%= @current_category.title %>

-<% else %> -

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

-<% end %> +

<%= @page.title %>

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 033ce70c..87826f02 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 @@ -9,6 +9,7 @@ class Panel::News::FrontEnd::NewsBulletinsController < OrbitWidgetController # GET /news_bulletins.xml def index + @page = Page.find(params[:page_id]) if !params[:search_query].blank? search_cond = {:is_checked=>true,:is_hidden=>false,:is_pending=>false,:is_pending=>false} search_cond.merge!({:news_bulletin_category_id => "#{params[:category_id]}" }) if !params[:category_id].blank? @@ -23,14 +24,14 @@ class Panel::News::FrontEnd::NewsBulletinsController < OrbitWidgetController @news_bulletins = @tag.news_bulletins.available_for_lang(I18n.locale).can_display.where(:news_bulletin_category_id => params[:category_id]).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(15) @current_category = NewsBulletinCategory.from_id(params[:category_id]) rescue nil elsif !params[:category_id].blank? - @news_bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.where(:news_bulletin_category_id => params[:category_id]).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(15) + @news_bulletins = NewsBulletin.all.available_for_lang(I18n.locale).can_display.where(:news_bulletin_category_id => params[:category_id]).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(15) @current_category = NewsBulletinCategory.from_id(params[:category_id]) rescue nil elsif !params[:tag_id].blank? @tag = NewsTag.find(params[:tag_id]) rescue nil @tag = NewsTag.where(key: params[:tag_id])[0] unless @tag @news_bulletins = @tag.news_bulletins.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(15) else - @news_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(15) + @news_bulletins = NewsBulletin.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(15) end impressionist(@tag) if @tag end @@ -40,6 +41,7 @@ class Panel::News::FrontEnd::NewsBulletinsController < OrbitWidgetController if params[:preview] == "true" preview_content else + '' @news_bulletin = NewsBulletin.all.available_for_lang(I18n.locale).can_display.where(_id: params[:id]).first unless @news_bulletin.disable? impressionist(@news_bulletin) 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 b7b1f57a..23708c13 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 @@ -2,16 +2,14 @@ <%= flash_messages %> -<% if @current_category %> -

<%= @current_category.title %>

-<% else %> -

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

+

<%= @page.title %>

+ +<% if @news_bulletins.blank? and !params[:search_query].blank? %> + <%=render :partial => 'shared/search_not_found' %> +<% elsif !params[:search_query].blank? %> + <%= t("search.result_get",:search_word => params[:search_query],:item_num=>@news_bulletins.count) %> <% end %> - <% if @news_bulletins.blank? and !params[:search_query].blank? %> - <%=render :partial => 'shared/search_not_found' %> - <% elsif !params[:search_query].blank? %> - <%= t("search.result_get",:search_word => params[:search_query],:item_num=>@news_bulletins.count) %> - <% end %> +