From 93403758c27e323ad74b0f9a230db6c37635132e Mon Sep 17 00:00:00 2001 From: Evandro Jr Date: Mon, 4 Jan 2016 15:48:46 -0300 Subject: [PATCH] Fixes new video for gallery --- plugins/video/lib/video_plugin.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/video/lib/video_plugin.rb b/plugins/video/lib/video_plugin.rb index 71b6b50..a6d669a 100644 --- a/plugins/video/lib/video_plugin.rb +++ b/plugins/video/lib/video_plugin.rb @@ -33,10 +33,14 @@ class VideoPlugin < Noosfero::Plugin end def article_extra_toolbar_buttons(content) - if content.kind_of?(VideoPlugin::VideoGallery) - url = url_for(:action => 'new', :type=>'VideoPlugin::Video', :controller=>'cms', :parent_id => content.id) - {:title => _('New Video'), :url => url, :icon => 'button with-text icon-new'} - end + return [] if !content.kind_of?(VideoPlugin::VideoGallery) + { + :id=>"new-video-btn", + :class=>"button with-text icon-new", + :url=> {:action => 'new', :type=>'VideoPlugin::Video', :controller=>'cms', :parent_id => content.id}, + :title=>_("New Video"), + :icon => :new + } end end -- libgit2 0.21.2