diff --git a/app/controllers/hps_learnings_controller.rb b/app/controllers/hps_learnings_controller.rb index 9b72504..63cf396 100644 --- a/app/controllers/hps_learnings_controller.rb +++ b/app/controllers/hps_learnings_controller.rb @@ -51,4 +51,26 @@ class HpsLearningsController < ApplicationController } } end -end \ No newline at end of file + + def widget + tags = OrbitHelper.widget_tags + classes = HpsClass.filter_by_widget_categories.filter_by_tags(tags).collect do |hpsclass| + thumb = hpsclass.course_pic.thumb.url.nil? ? "http://www.placehold.it/150x150/EFEFEF/AAAAAA" : hpsclass.course_pic.thumb.url + { + "title" => hpsclass.title, + "thumb_url" => thumb, + "link_to_show" => OrbitHelper.url_to_show(hpsclass.to_param), + } + end + { + "classes" => classes, + "extras" => { + "more_url" => OrbitHelper.widget_more_url + } + } + end +end + + + +