diff --git a/plugins/video/lib/video.rb b/plugins/video/lib/video.rb index e9eed07..5579faa 100644 --- a/plugins/video/lib/video.rb +++ b/plugins/video/lib/video.rb @@ -2,7 +2,6 @@ require 'noosfero/translatable_content' require 'application_helper' require 'net/http' -# a base class for all text article types. class Video < Article settings_items :video_url, :type => :string, :default => 'http://' @@ -13,14 +12,14 @@ class Video < Article settings_items :video_format, :type => :string settings_items :video_id, :type => :string settings_items :video_thumbnail_url, :type => :string, :default => '/plugins/video/images/video_generic_thumbnail.jpg' - settings_items :video_thumbnail_width, :type=> :integer + settings_items :video_thumbnail_width, :type=> :integer settings_items :video_thumbnail_height, :type=> :integer settings_items :video_duration, :type=> :integer, :default => 0 - + attr_accessible :video_url before_save :detect_video - + def self.type_name _('Video') end @@ -28,7 +27,7 @@ class Video < Article def can_display_versions? true end - + def self.short_description _('Embedded Video') end @@ -41,10 +40,10 @@ class Video < Article def to_html(options={}) article = self proc do - render :file => 'content_viewer/video', :locals => {:article => article} + render :partial => 'content_viewer/video', :locals => {:article => article} end - end - + end + def fitted_width 499 end @@ -165,4 +164,4 @@ end # } # # return hr + ':' + min + ':' + sec; -#} \ No newline at end of file +#} diff --git a/plugins/video/lib/video_gallery.rb b/plugins/video/lib/video_gallery.rb index f97db5a..e1dd855 100644 --- a/plugins/video/lib/video_gallery.rb +++ b/plugins/video/lib/video_gallery.rb @@ -3,11 +3,11 @@ class VideoGallery < Folder def self.type_name _('Video Gallery') end - + settings_items :thumbnail_width, :type => :integer, :default => 50 settings_items :thumbnail_height, :type => :integer, :default => 50 settings_items :videos_per_row, :type => :integer, :default => 5 - + validate :not_belong_to_blog def not_belong_to_blog @@ -22,7 +22,7 @@ class VideoGallery < Folder filter_iframes :body def iframe_whitelist profile && profile.environment && profile.environment.trusted_sites_for_iframe - end + end def self.short_description _('Video Gallery') @@ -31,19 +31,19 @@ class VideoGallery < Folder def self.description _('A gallery of link to videos that are hosted elsewhere.') end - + include ActionView::Helpers::TagHelper def to_html(options = {}) video_gallery = self proc do - render :file => 'content_viewer/video_gallery', :locals => {:video_gallery => video_gallery} + render :partial => 'content_viewer/video_gallery', :locals => {:video_gallery => video_gallery} end - end + end def video_gallery? true end - + def can_display_hits? false end @@ -58,6 +58,6 @@ class VideoGallery < Folder def news(limit = 30, highlight = false) profile.recent_documents(limit, ["articles.type != ? AND articles.highlighted = ? AND articles.parent_id = ?", 'Folder', highlight, id]) - end - + end + end diff --git a/plugins/video/lib/video_plugin.rb b/plugins/video/lib/video_plugin.rb index 1c40743..a394da0 100644 --- a/plugins/video/lib/video_plugin.rb +++ b/plugins/video/lib/video_plugin.rb @@ -44,7 +44,7 @@ class VideoPlugin < Noosfero::Plugin content_tag('a', _("New Video"), { :id=>"new-video-btn", :class=>"button with-text icon-new", - :href=>url_for(:action => 'new', :type=>'Video', :controller=>'cms'), + :href=>url_for(:action => 'new', :type=>'Video', :controller=>'cms', :parent_id => content.id), :title=>_("New Video") }) end diff --git a/plugins/video/views/box_organizer/_html5_video_block.html.erb b/plugins/video/views/box_organizer/_html5_video_block.html.erb new file mode 100644 index 0000000..a120a21 --- /dev/null +++ b/plugins/video/views/box_organizer/_html5_video_block.html.erb @@ -0,0 +1,3 @@ + diff --git a/plugins/video/views/box_organizer/_iframe_video_block.html.erb b/plugins/video/views/box_organizer/_iframe_video_block.html.erb new file mode 100644 index 0000000..efd2994 --- /dev/null +++ b/plugins/video/views/box_organizer/_iframe_video_block.html.erb @@ -0,0 +1 @@ + diff --git a/plugins/video/views/box_organizer/_video_block.html.erb b/plugins/video/views/box_organizer/_video_block.html.erb new file mode 100644 index 0000000..c19d4b6 --- /dev/null +++ b/plugins/video/views/box_organizer/_video_block.html.erb @@ -0,0 +1,11 @@ + + +
<%= pagination_links contents, :param_name => 'npage', :page_links => true %>
- \ No newline at end of file + -- libgit2 0.21.2