From e82fd405c976e539ef382354545e5cfab1f04913 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 20 Feb 2012 16:23:54 +0800 Subject: [PATCH] remove bulletins_list --- app/views/layouts/module_widget.html.erb | 4 ++-- .../built_in_modules/announcement/announcement.json | 2 +- .../panel/announcement/widget/bulletins_controller.rb | 11 ----------- .../announcement/app/models/announcement_tag.rb | 2 +- .../widget/bulletins/bulletins_and_web_links.html.erb | 4 ++-- vendor/built_in_modules/announcement/config/routes.rb | 1 - 6 files changed, 6 insertions(+), 18 deletions(-) diff --git a/app/views/layouts/module_widget.html.erb b/app/views/layouts/module_widget.html.erb index e010355e..3cd028aa 100644 --- a/app/views/layouts/module_widget.html.erb +++ b/app/views/layouts/module_widget.html.erb @@ -4,8 +4,8 @@ - <%= stylesheet_link_tag "widget" %> - <%= javascript_include_tag "widget" %> + <%#= stylesheet_link_tag "widget" %> + <%= javascript_include_tag "module_widget" %> <%= csrf_meta_tag %> diff --git a/vendor/built_in_modules/announcement/announcement.json b/vendor/built_in_modules/announcement/announcement.json index 605c912e..0751a0e7 100644 --- a/vendor/built_in_modules/announcement/announcement.json +++ b/vendor/built_in_modules/announcement/announcement.json @@ -7,6 +7,6 @@ "update_info": "Some info", "create_date": "11-11-2011", "app_pages": ["bulletins"], - "widgets": ["bulletins","bulletins_list", "bulletins_and_web_links"], + "widgets": ["bulletins", "bulletins_and_web_links"], "enable_frontend": true } diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb index a8ca336e..db43aa8d 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb @@ -19,17 +19,6 @@ class Panel::Announcement::Widget::BulletinsController < ObitWidgetController end - def bulletins_list - - @bulletins = Bulletin.widget_datas.limit(5) - - # get_categorys - - module_app = ModuleApp.first(:conditions => {:key => 'announcement'}) - @tags = Tag.all(:conditions => {:module_app_id => module_app.id}) - - end - def bulletins_and_web_links @tags = AnnouncementTag.all @selected_tag = AnnouncementTag.find(params[:id]) rescue @tags[0] diff --git a/vendor/built_in_modules/announcement/app/models/announcement_tag.rb b/vendor/built_in_modules/announcement/app/models/announcement_tag.rb index b40ace36..9656db7d 100644 --- a/vendor/built_in_modules/announcement/app/models/announcement_tag.rb +++ b/vendor/built_in_modules/announcement/app/models/announcement_tag.rb @@ -4,7 +4,7 @@ class AnnouncementTag < Tag def get_visible_bulletins(sort = :name) - self.bulletins.where(:is_hidden => false).desc(:is_top, sort) + self.bulletins.where(:is_hidden => false).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc(:is_top, sort) end end \ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/bulletins_and_web_links.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/bulletins_and_web_links.html.erb index 0d1bc047..c8006636 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/bulletins_and_web_links.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/bulletins_and_web_links.html.erb @@ -6,12 +6,12 @@
\ No newline at end of file diff --git a/vendor/built_in_modules/announcement/config/routes.rb b/vendor/built_in_modules/announcement/config/routes.rb index 4a25ad34..c3a60f74 100644 --- a/vendor/built_in_modules/announcement/config/routes.rb +++ b/vendor/built_in_modules/announcement/config/routes.rb @@ -15,7 +15,6 @@ Rails.application.routes.draw do end namespace :widget do match "bulletins" => "bulletins#index" - match "bulletins_list" => "bulletins#bulletins_list" match "bulletins_and_web_links" => "bulletins#bulletins_and_web_links" match "reload_bulletins" => "bulletins#reload_bulletins" match "reload_web_links" => "bulletins#reload_web_links"