changed engine settings and added widget
This commit is contained in:
parent
b11f537a67
commit
81abc73163
|
@ -20,17 +20,19 @@ class AnnouncementsController < ApplicationController
|
|||
end
|
||||
|
||||
def widget
|
||||
announcements = Bulletin.can_display.order_by(:created_at=>'desc').filter_by_categories
|
||||
announcements = Bulletin.can_display.order_by(:created_at=>'desc').filter_by_widget_categories
|
||||
anns = announcements.collect do |a|
|
||||
{
|
||||
"title" => a.title,
|
||||
"subtitle" => a.subtitle,
|
||||
"postdate" => a.postdate.strftime("%b %d, %Y at %I:%M %p"),
|
||||
"link_to_show" => OrbitHelper.url_to_show(a.to_param),
|
||||
"more" => "More",
|
||||
"img_src" => a.image.thumb.url || "http://placehold.it/100x100",
|
||||
}
|
||||
end
|
||||
{
|
||||
"data" => anns
|
||||
"announcements" => anns,
|
||||
"extras" => {"widget-title"=>"Announcements"}
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@ module Announcement
|
|||
module_label "announcement.announcement"
|
||||
base_url File.expand_path File.dirname(__FILE__)
|
||||
widget_methods ["widget"]
|
||||
widget_settings [{"data_count"=>10}]
|
||||
|
||||
taggable "Bulletin"
|
||||
categorizable
|
||||
authorizable
|
||||
|
|
Loading…
Reference in New Issue