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]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<%= stylesheet_link_tag "widget" %>
<%= javascript_include_tag "widget" %>
<%#= stylesheet_link_tag "widget" %>
<%= javascript_include_tag "module_widget" %>
<%= csrf_meta_tag %>
</head>
<body>

View File

@ -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
}

View File

@ -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]

View File

@ -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

View File

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

View File

@ -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"