26 lines
820 B
Ruby
26 lines
820 B
Ruby
class Panel::Video::FrontEnd::ChannelVideosController < OrbitWidgetController
|
|
def initialize
|
|
super
|
|
@app_title = 'video'
|
|
end
|
|
|
|
def index
|
|
@item = Page.find(params[:page_id]) rescue nil
|
|
if @item
|
|
if @item.frontend_data_count
|
|
@page_num = @item.frontend_data_count
|
|
else
|
|
@page_num = 15
|
|
end
|
|
@frontend_style = @item.frontend_style
|
|
end
|
|
@item = Page.find(params[:page_id]) rescue nil
|
|
@channel_video = ChannelVideo.first rescue nil
|
|
client = YouTubeIt::Client.new(:dev_key => "AI39si5KGPg8rhKLBfmeukit2tCSP_B9lT8igiNICbrbgUXQoAdYGvsyCGCmO1wGnr1OW4bDRv-ESolwk-rdBNIAgVTL9VYaEA")
|
|
@client_videos = client.videos_by(:user => @channel_video.channel_name, :per_page => 5)
|
|
|
|
respond_to do |format|
|
|
format.html # index.html.erb
|
|
end
|
|
end
|
|
end |