lockaz_app/app/controllers/public/video_files_controller.rb
Nicolas Bally f20fe482c6 initial
2020-04-06 10:38:07 +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