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