added widget to this module
This commit is contained in:
parent
5afc74cb83
commit
59e2fef80a
|
@ -51,4 +51,26 @@ class HpsLearningsController < ApplicationController
|
|||
}
|
||||
}
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue