remove bulletins_list

This commit is contained in:
unknown 2012-02-20 16:23:54 +08:00
parent c304819d6b
commit e82fd405c9
6 changed files with 6 additions and 18 deletions

View File

@ -4,8 +4,8 @@
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]--> <![endif]-->
<%= stylesheet_link_tag "widget" %> <%#= stylesheet_link_tag "widget" %>
<%= javascript_include_tag "widget" %> <%= javascript_include_tag "module_widget" %>
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
</head> </head>
<body> <body>

View File

@ -7,6 +7,6 @@
"update_info": "Some info", "update_info": "Some info",
"create_date": "11-11-2011", "create_date": "11-11-2011",
"app_pages": ["bulletins"], "app_pages": ["bulletins"],
"widgets": ["bulletins","bulletins_list", "bulletins_and_web_links"], "widgets": ["bulletins", "bulletins_and_web_links"],
"enable_frontend": true "enable_frontend": true
} }

View File

@ -19,17 +19,6 @@ class Panel::Announcement::Widget::BulletinsController < ObitWidgetController
end 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 def bulletins_and_web_links
@tags = AnnouncementTag.all @tags = AnnouncementTag.all
@selected_tag = AnnouncementTag.find(params[:id]) rescue @tags[0] @selected_tag = AnnouncementTag.find(params[:id]) rescue @tags[0]

View File

@ -4,7 +4,7 @@ class AnnouncementTag < Tag
def get_visible_bulletins(sort = :name) 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
end end

View File

@ -6,12 +6,12 @@
<div> <div>
<ul id='bulletins_web_links_bulletins'> <ul id='bulletins_web_links_bulletins'>
<%= render 'bulletins' %> <%= render 'bulletins' if @bulletins %>
</ul> </ul>
</div> </div>
<div> <div>
<ul id='bulletins_web_links_web_links'> <ul id='bulletins_web_links_web_links'>
<%= render 'web_links' %> <%= render 'web_links' if @web_links %>
</ul> </ul>
</div> </div>

View File

@ -15,7 +15,6 @@ Rails.application.routes.draw do
end end
namespace :widget do namespace :widget do
match "bulletins" => "bulletins#index" match "bulletins" => "bulletins#index"
match "bulletins_list" => "bulletins#bulletins_list"
match "bulletins_and_web_links" => "bulletins#bulletins_and_web_links" match "bulletins_and_web_links" => "bulletins#bulletins_and_web_links"
match "reload_bulletins" => "bulletins#reload_bulletins" match "reload_bulletins" => "bulletins#reload_bulletins"
match "reload_web_links" => "bulletins#reload_web_links" match "reload_web_links" => "bulletins#reload_web_links"