widget for vlog
This commit is contained in:
parent
c8a8ec1b49
commit
b32bf6527f
|
@ -24,9 +24,16 @@ class VlogsController < ApplicationController
|
|||
end
|
||||
|
||||
def widget
|
||||
{
|
||||
"extras" => {}
|
||||
}
|
||||
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
|
||||
{
|
||||
"video" => video,
|
||||
"extras" => {"widget-title"=>t(:web_resource),"more_url" => OrbitHelper.widget_more_url}
|
||||
}
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
Loading…
Reference in New Issue