From 8e0a539c04e9bd849d941eac2628ee024536a682 Mon Sep 17 00:00:00 2001 From: Ruling-Mac Date: Wed, 30 Sep 2015 16:27:10 +0800 Subject: [PATCH] modify widget display in announcement show page --- app/controllers/announcements_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index 6949e9b..0e9a5d7 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -90,8 +90,9 @@ class AnnouncementsController < ApplicationController end def widget + uid = OrbitHelper.params[:uid] rescue "" tags = ["all"] if OrbitHelper.widget_tags.empty? - announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).and(:title.ne => nil).can_display.is_approved.order_by(:postdate=>'desc').filter_by_widget_categories.filter_by_tags(tags) + announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil],:uid.ne => uid).and(:title.ne => nil).can_display.is_approved.order_by(:postdate=>'desc').filter_by_widget_categories.filter_by_tags(tags) page = Page.where(:module => "announcement").first rescue nil anns = announcements.collect do |a| statuses = a.statuses_with_classname.collect do |status|