ecm_videos 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11544491916d30e349719ce696c719b59c0d63f9
4
- data.tar.gz: 2da66738e3dc0337dc8a423fb6de077be1f2b725
3
+ metadata.gz: c3cb05eb0a9cca8dd93f461415abb5c651c10097
4
+ data.tar.gz: ce691af323597514e4f59d7721f27595c96c8ffd
5
5
  SHA512:
6
- metadata.gz: 251fb6438accc05425b5ce969d2a54c1b34d17f3885dac4dac7aeb95d7d0bdff732c1a5e0a250a7ee7026e9df08a73fa91a78aee7974ffb546d0109037f734b4
7
- data.tar.gz: b3f4e08c4d43a27f9f247471aa37f32de6c5d5e00fbf51335a4e364567119a40fe3717b56d65955c642ac7d24f56e15808e8dd7ef192cd0decba1dcde800410b
6
+ metadata.gz: b9eeaee4a1bf69870923c9c828b557de76fc1a5127d1e25d9bcae70c93e369a2083922c9557e15d08aaeca5eaad92960050220eb75643c18fef4a206c95e8214
7
+ data.tar.gz: fea6e3595c47816b3b9d66e874445ad6662276731a2b1bc13b22ccbb9453750405c96d0d142717acbd18988a4b2e87c86937c4e5a16ed37e24376e82ebcc74c7
data/Rakefile CHANGED
@@ -1,17 +1,17 @@
1
1
  begin
2
- require "bundler/setup"
2
+ require 'bundler/setup'
3
3
  rescue LoadError
4
- puts "You must `gem install bundler` and `bundle install` to run rake tasks"
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
5
  end
6
6
 
7
- require "rdoc/task"
7
+ require 'rdoc/task'
8
8
 
9
9
  RDoc::Task.new(:rdoc) do |rdoc|
10
- rdoc.rdoc_dir = "rdoc"
11
- rdoc.title = "Ecm::Videos"
12
- rdoc.options << "--line-numbers"
13
- rdoc.rdoc_files.include("README.rdoc")
14
- rdoc.rdoc_files.include("lib/**/*.rb")
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Ecm::Videos'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
15
  end
16
16
 
17
17
  Bundler::GemHelper.install_tasks
@@ -21,4 +21,4 @@ module Models::MarkupConcern
21
21
  end
22
22
  end
23
23
  end
24
- end
24
+ end
@@ -3,7 +3,7 @@ module Ecm::Videos
3
3
  # markup support
4
4
  include Models::MarkupConcern
5
5
  markup :description
6
-
6
+
7
7
  # acts as published
8
8
  include ActsAsPublished::ActiveRecord
9
9
  acts_as_published
@@ -18,6 +18,11 @@ module Ecm::Videos
18
18
  videos.first.try(:preview_image)
19
19
  end
20
20
 
21
+ def published_preview_image_url(style)
22
+ return unless video = videos.published.first
23
+ video.clip.url(style)
24
+ end
25
+
21
26
  def videos_count
22
27
  videos.count
23
28
  end
@@ -11,7 +11,7 @@ module Ecm::Videos
11
11
  # acts as list
12
12
  acts_as_list scope: :category
13
13
  default_scope { order(position: :asc) }
14
-
14
+
15
15
  belongs_to :category
16
16
 
17
17
  has_attached_file :clip, Configuration.paperclip_options.call(self)
@@ -1,7 +1,7 @@
1
1
  %h1= t('.title', inflections)
2
2
 
3
3
  = render_collection(@collection, Ecm::Videos::Category, as: :bootstrap_media_object) do |list|
4
- = list.media_object(title_method: :name, body: list.resource.description(:html), image_url: list.resource.videos.first.clip.url(:default_thumb))
4
+ = list.media_object(title_method: :name, body: list.resource.description(:html), image_url: list.resource.published_preview_image_url(:default_thumb))
5
5
 
6
6
  .well.page-actions
7
7
  = link_to(t('.back'), main_app.root_path, class: 'btn btn-default')
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
  #video-category-videos
8
- = render_collection(@resource.videos, Ecm::Videos::Video, as: :bootstrap_media_object) do |list|
8
+ = render_collection(@resource.videos.published, Ecm::Videos::Video, as: :bootstrap_media_object) do |list|
9
9
  = list.media_object(title_method: :name, body: list.resource.description(:html), image_url: list.resource.clip.url(:default_thumb))
10
10
 
11
11
  .well.page-actions
@@ -16,6 +16,7 @@ de:
16
16
  locale: Sprache
17
17
  markup_language: Markup Sprache
18
18
  name: Name
19
+ preview_image: Vorschau
19
20
  published: Veröffentlicht
20
21
  published_at: Veröffentlicht am
21
22
  videos_count: Videos
@@ -30,6 +31,7 @@ de:
30
31
  description: Beschreibung
31
32
  markup_language: Markup Sprache
32
33
  name: Name
34
+ preview_image: Vorschau
33
35
  published: Veröffentlicht
34
36
  published_at: Veröffentlicht am
35
37
  ecm:
@@ -12,7 +12,7 @@ module Ecm
12
12
  mattr_accessor(:default_markup_language) { 'textile' }
13
13
  mattr_accessor(:base_controller) { 'FrontendController' }
14
14
  mattr_accessor(:paperclip_options) do
15
- Proc.new { {} }
15
+ proc { {} }
16
16
  end
17
17
  end
18
18
  end
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module Videos
3
- VERSION = "1.0.0".freeze
3
+ VERSION = '1.0.1'.freeze
4
4
  end
5
5
  end
data/lib/ecm_videos.rb CHANGED
@@ -6,5 +6,5 @@ require 'paperclip/av/transcoder'
6
6
  require 'rails_rad'
7
7
  require 'resource_renderer'
8
8
 
9
- require "ecm/videos"
10
- require "ecm/videos/engine"
9
+ require 'ecm/videos'
10
+ require 'ecm/videos/engine'
@@ -28,8 +28,8 @@ Ecm::Videos.configure do |config|
28
28
  # }
29
29
  # end
30
30
  #
31
- config.paperclip_options = Proc.new do |model|
32
- {
31
+ config.paperclip_options = proc do |_model|
32
+ {
33
33
  styles: {
34
34
  small_thumb: '80x60',
35
35
  medium_thumb: '160x120',
@@ -37,4 +37,4 @@ Ecm::Videos.configure do |config|
37
37
  }
38
38
  }
39
39
  end
40
- end
40
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_videos
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel