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 @@ + + +
+ <%= text_field_tag 'block[url]', @block.url, :class => 'video-url', :maxlength => 255 %> +
+
+ + <%= text_field_tag 'block[width]', @block.width, :size => 7, :class => 'video-width', :maxlength => 5 %> + + <%= text_field_tag 'block[height]', @block.height, :size => 7, :class => 'video-height', :maxlength => 5 %> +
diff --git a/plugins/video/views/box_organizer/video_plugin/_html5_video_block.html.erb b/plugins/video/views/box_organizer/video_plugin/_html5_video_block.html.erb deleted file mode 100644 index a120a21..0000000 --- a/plugins/video/views/box_organizer/video_plugin/_html5_video_block.html.erb +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/plugins/video/views/box_organizer/video_plugin/_iframe_video_block.html.erb b/plugins/video/views/box_organizer/video_plugin/_iframe_video_block.html.erb deleted file mode 100644 index efd2994..0000000 --- a/plugins/video/views/box_organizer/video_plugin/_iframe_video_block.html.erb +++ /dev/null @@ -1 +0,0 @@ - diff --git a/plugins/video/views/box_organizer/video_plugin/_video_block.html.erb b/plugins/video/views/box_organizer/video_plugin/_video_block.html.erb deleted file mode 100644 index c19d4b6..0000000 --- a/plugins/video/views/box_organizer/video_plugin/_video_block.html.erb +++ /dev/null @@ -1,11 +0,0 @@ - - -
- <%= text_field_tag 'block[url]', @block.url, :class => 'video-url', :maxlength => 255 %> -
-
- - <%= text_field_tag 'block[width]', @block.width, :size => 7, :class => 'video-width', :maxlength => 5 %> - - <%= text_field_tag 'block[height]', @block.height, :size => 7, :class => 'video-height', :maxlength => 5 %> -
diff --git a/plugins/video/views/cms/video_plugin/_video_video.html.erb b/plugins/video/views/cms/video_plugin/_video_video.html.erb deleted file mode 100644 index c7fe2f6..0000000 --- a/plugins/video/views/cms/video_plugin/_video_video.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<%= required_fields_message %> - -
-<%= required f.text_field('name', :size => '64', :maxlength => 150) %> -<%= required labelled_form_field _('URL of the video'), text_field(:article, :video_url, :size => 300) %> -<%= labelled_form_field(_('Description:'), text_area(:article, :body, :rows => 3, :cols => 64)) %> -<%= render :partial => 'general_fields' %> -<%= render :partial => 'translatable' %> -
- - - diff --git a/plugins/video/views/cms/video_plugin/_video_video_gallery.html.erb b/plugins/video/views/cms/video_plugin/_video_video_gallery.html.erb deleted file mode 100644 index ce95bd1..0000000 --- a/plugins/video/views/cms/video_plugin/_video_video_gallery.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -<%= required_fields_message %> - -<%= required f.text_field('name', :size => '64', :maxlength => 150) %> -<%= render :partial => 'general_fields' %> - -<%= labelled_form_field(_('Description:'), text_area(:article, :body, :rows => 3, :cols => 64)) %> diff --git a/plugins/video/views/shared/video_list.html.erb b/plugins/video/views/shared/video_list.html.erb index 7233d63..9783b62 100644 --- a/plugins/video/views/shared/video_list.html.erb +++ b/plugins/video/views/shared/video_list.html.erb @@ -5,17 +5,14 @@ <% end %> <% end %>

<%= pagination_links contents, :param_name => 'npage', :page_links => true %>

- \ No newline at end of file + -- libgit2 0.21.2