spree_multi_slideshow 1.0.5 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -9,7 +9,7 @@ Basic Installation
9
9
 
10
10
  1. Add the following to your Gemfile
11
11
  <pre>
12
- gem 'spree_multi_slideshow', '~> 1.0.5'
12
+ gem 'spree_multi_slideshow', '~> 1.1.0'
13
13
  </pre>
14
14
  2. Run `bundle install`
15
15
  3. To copy and apply migrations run:
@@ -1,19 +1,21 @@
1
1
  module Spree
2
- class Slide < ActiveRecord::Base
2
+ class Slide < ActiveRecord::Base
3
3
  belongs_to :slideshow_type
4
4
 
5
5
  attr_accessor :attachment_width, :attachment_height
6
- attr_accessible :title, :url, :attachment_width, :attachment_height, :content, :slideshow_type_id, :attachment, :position
6
+ attr_accessible :title, :url, :attachment_width, :attachment_height, :content, :slideshow_type_id, :attachment
7
7
 
8
8
  has_attached_file :attachment,
9
9
  :url => "/spree/slides/:id/:style_:basename.:extension",
10
10
  :path => ":rails_root/public/spree/slides/:id/:style_:basename.:extension",
11
- :styles => {
11
+ :styles => lambda {|a|
12
+ {
12
13
  :thumbnail => "100x33#",
13
- :small => "300x100#",
14
+ :small => "300x100#",
14
15
  :medium => "600x200#",
15
- :slide => "900x300#",
16
- :custom => Proc.new {|instance| "#{instance.attachment_width}x#{instance.attachment_height}#"}
16
+ :slide => "900x300#",
17
+ :custom => "#{a.instance.attachment_width}x#{a.instance.attachment_height}#"
18
+ }
17
19
  },
18
20
  :convert_options => {
19
21
  :thumbnail => "-gravity center",
@@ -28,12 +30,12 @@ module Spree
28
30
  validates_attachment_content_type :attachment, :content_type => ['image/jpeg', 'image/png', 'image/gif', 'image/jpg', 'image/x-png', 'image/pjpeg'], :message => "deve essere JPG, JPEG, PNG o GIF"
29
31
 
30
32
  # Load S3 settings
31
- if (FileTest.exist?(Rails.root.join('config', 's3.yml')) && !YAML.load_file(Rails.root.join('config', 's3.yml'))[Rails.env].blank?)
33
+ if ( FileTest.exist?(Rails.root.join('config', 's3.yml')) && !YAML.load_file(Rails.root.join('config', 's3.yml'))[Rails.env].blank?)
32
34
  S3_OPTIONS = {
33
35
  :storage => 's3',
34
36
  :s3_credentials => Rails.root.join('config', 's3.yml')
35
37
  }
36
- elsif (FileTest.exist?(Rails.root.join('config', 's3.yml')) && !ENV['S3_KEY'].blank? && !ENV['S3_SECRET'].blank? && !ENV['S3_BUCKET'].blank?)
38
+ elsif (FileTest.exist?(Rails.root.join('config', 's3.yml')) &&!ENV['S3_KEY'].blank? && !ENV['S3_SECRET'].blank? && !ENV['S3_BUCKET'].blank?)
37
39
  S3_OPTIONS = {
38
40
  :storage => 's3',
39
41
  :s3_credentials => {
@@ -2,8 +2,8 @@ module Spree
2
2
  class SlideshowType < ActiveRecord::Base
3
3
  has_many :slides
4
4
 
5
- attr_accessible :category, :enabled, :slide_height, :slide_width, :slide_number, :enable_navigation
6
-
5
+ attr_accessible :category, :slide_width, :slide_height, :slide_number, :enable_navigation, :enabled
6
+
7
7
  validates :slide_number, :slide_width, :slide_height, :presence => true
8
8
  validates_uniqueness_of :category
9
9
  validates_numericality_of :slide_number, :only_integer => true
@@ -1,4 +1,2 @@
1
1
  require 'spree_core'
2
- require 'ckeditor'
3
- require 'formtastic'
4
2
  require 'spree_multi_slideshow/engine'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_multi_slideshow
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-25 00:00:00.000000000 Z
12
+ date: 2012-07-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spree_core