modify widget display in announcement show page

This commit is contained in:
Ruling-Mac 2015-09-30 16:27:10 +08:00
parent dc4496fedd
commit 8e0a539c04
1 changed files with 2 additions and 1 deletions

View File

@ -90,8 +90,9 @@ class AnnouncementsController < ApplicationController
end end
def widget def widget
uid = OrbitHelper.params[:uid] rescue ""
tags = ["all"] if OrbitHelper.widget_tags.empty? 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 page = Page.where(:module => "announcement").first rescue nil
anns = announcements.collect do |a| anns = announcements.collect do |a|
statuses = a.statuses_with_classname.collect do |status| statuses = a.statuses_with_classname.collect do |status|