2014-05-05 11:33:35 +00:00
|
|
|
class WebResourcesController < ApplicationController
|
|
|
|
|
|
|
|
def index
|
|
|
|
links = WebLink.order_by(:created_at=>'desc')
|
|
|
|
web_link = links.collect do |link|
|
2014-06-06 09:33:53 +00:00
|
|
|
statuses = link.statuses.collect do |status|
|
|
|
|
{
|
|
|
|
"status" => status,
|
|
|
|
"status-class" => "status-#{status.downcase}"
|
|
|
|
}
|
|
|
|
end
|
2014-05-05 11:33:35 +00:00
|
|
|
{
|
|
|
|
"title" => link.title,
|
2014-06-06 09:33:53 +00:00
|
|
|
"context" => link.context,
|
|
|
|
"statuses" => statuses,
|
2014-05-05 11:33:35 +00:00
|
|
|
"link_to_show" => link.url
|
|
|
|
}
|
|
|
|
end
|
|
|
|
{
|
2014-05-26 03:05:29 +00:00
|
|
|
"web_link" => web_link,
|
|
|
|
"extras" => {"widget-title"=>t(:web_resource)}
|
2014-05-05 11:33:35 +00:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
def widget
|
|
|
|
links = WebLink.order_by(:created_at=>'desc')
|
|
|
|
web_link = links.collect do |link|
|
|
|
|
{
|
|
|
|
"title" => link.title,
|
|
|
|
"link_to_show" => link.url
|
|
|
|
}
|
|
|
|
end
|
|
|
|
{
|
2014-05-26 03:05:29 +00:00
|
|
|
"web_link" => web_link,
|
|
|
|
"extras" => {"widget-title"=>t(:web_resource),"more_url" => OrbitHelper.widget_more_url}
|
2014-05-05 11:33:35 +00:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|