widget for vlog
This commit is contained in:
parent
c8a8ec1b49
commit
b32bf6527f
|
@ -24,8 +24,15 @@ class VlogsController < ApplicationController
|
|||
end
|
||||
|
||||
def widget
|
||||
video = VLog.all.filter_by_widget_categories.sample(1).first
|
||||
if vlog.type == "upload" && !vlog.v_log_video.nil?
|
||||
video = "<video src='#{vlog.v_log_video.video.url}' controls> Your browser does not support the <code>video</code> element.</video>"
|
||||
elsif vlog.type == "youtube" && !vlog.youtube_link.nil?
|
||||
video = "<iframe src='#{vlog.youtube_link}' allowfullscreen frameborder='0'></iframe>"
|
||||
end
|
||||
{
|
||||
"extras" => {}
|
||||
"video" => video,
|
||||
"extras" => {"widget-title"=>t(:web_resource),"more_url" => OrbitHelper.widget_more_url}
|
||||
}
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue