diff --git a/app/controllers/web_resources_controller.rb b/app/controllers/web_resources_controller.rb index 382e9bc..e5e8e8b 100644 --- a/app/controllers/web_resources_controller.rb +++ b/app/controllers/web_resources_controller.rb @@ -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