added statuses to widget
This commit is contained in:
parent
4a50726150
commit
176d338ed2
|
@ -1,7 +1,7 @@
|
|||
class WebResourcesController < ApplicationController
|
||||
|
||||
def index
|
||||
links = WebLink.order_by(:created_at=>'desc')
|
||||
links = WebLink.order_by(:created_at=>'desc').filter_by_categories
|
||||
web_link = links.collect do |link|
|
||||
statuses = link.statuses.collect do |status|
|
||||
{
|
||||
|
@ -23,10 +23,18 @@ class WebResourcesController < ApplicationController
|
|||
end
|
||||
|
||||
def widget
|
||||
links = WebLink.order_by(:created_at=>'desc')
|
||||
links = WebLink.order_by(:created_at=>'desc').filter_by_widget_categories
|
||||
web_link = links.collect do |link|
|
||||
statuses = link.statuses.collect do |status|
|
||||
{
|
||||
"status" => status,
|
||||
"status-class" => "status-#{status.downcase}"
|
||||
}
|
||||
end
|
||||
{
|
||||
"title" => link.title,
|
||||
"context" => link.context,
|
||||
"statuses" => statuses,
|
||||
"link_to_show" => link.url
|
||||
}
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue