pollen_app/app/controllers/public/video_files_controller.rb
Nicolas Bally 120e9803eb initial
2020-04-28 14:51:42 +02:00

32 lines
580 B
Ruby

# -*- encoding : utf-8 -*-
class Public::VideoFilesController < ApplicationController
layout :get_public_layout
def index
@video_folders = VideoFolder.publics.all
end
def show
if @video_file_lang = VideoFileLang.where(:slug => params[:slug], :lang_site_id => LangSite.find_by_slug(params[:lang]).id).first
elsif @video_file_lang = VideoFileLang.where(:slug => params[:slug]).first
end
@video_file = @video_file_lang.video_file
if @video_file.public? or current_admin
else
redirect_to "/"
end
end
end