diff --git a/plugins/video/lib/video_gallery_helper.rb b/plugins/video/lib/video_gallery_helper.rb new file mode 100644 index 0000000..f1e472d --- /dev/null +++ b/plugins/video/lib/video_gallery_helper.rb @@ -0,0 +1,18 @@ +module VideoGalleryHelper + + def list_videos(configure={}) + configure[:recursive] ||= false + configure[:list_type] ||= :folder + if !configure[:contents].blank? + configure[:contents] = configure[:contents].paginate( + :order => "updated_at DESC", + :per_page => 16, + :page => params[:npage] + ) + render :file => 'shared/video_list', :locals => configure + else + content_tag('em', _('(empty folder)')) + end + end + +end \ No newline at end of file diff --git a/plugins/video/views/content_viewer/_video_gallery.html.erb b/plugins/video/views/content_viewer/_video_gallery.html.erb index 5cdf88f..26da37e 100644 --- a/plugins/video/views/content_viewer/_video_gallery.html.erb +++ b/plugins/video/views/content_viewer/_video_gallery.html.erb @@ -1,19 +1,5 @@ -<% -def self.list_videos(configure={}) - configure[:recursive] ||= false - configure[:list_type] ||= :folder - if !configure[:contents].blank? - configure[:contents] = configure[:contents].paginate( - :order => "updated_at DESC", - :per_page => 16, - :page => params[:npage] - ) - render :file => 'shared/video_list', :locals => configure - else - content_tag('em', _('(empty folder)')) - end - end -%> +<% extend VideoPlugin::VideoGalleryHelper %> + <% unless video_gallery.body.blank? %>