class Panel::Announcement::FrontEnd::BulletinsController < ObitWidgetController
  
  def initialize
    super
    @app_title = NewBlog::MOUDLEAPP_TITLE
  end
  
  # GET /bulletins
  # GET /bulletins.xml
  
  def index
  
	date_now = Time.now
	
    @bulletins = Bulletin.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(1)

	get_categorys
  end
  
  def show
    @bulletin = Bulletin.find(params[:id])
	get_categorys
  end
  
  
  protected
  
  def get_categorys
    @bulletin_categorys = BulletinCategory.excludes('disabled' => true)
  end
  
end
