spree_multi_slideshow 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
data/app/models/spree/slide.rb
CHANGED
@@ -2,11 +2,8 @@ module Spree
|
|
2
2
|
class Slide < ActiveRecord::Base
|
3
3
|
belongs_to :slideshow_type
|
4
4
|
|
5
|
-
attr_accessible :title, :url, :content, :attachment, :position
|
6
|
-
|
7
|
-
validates_presence_of :slideshow_type_id
|
8
|
-
|
9
5
|
attr_accessor :attachment_width, :attachment_height
|
6
|
+
attr_accessible :title, :url, :content, :attachment, :position, :attachment_width, :attachment_height
|
10
7
|
|
11
8
|
has_attached_file :attachment,
|
12
9
|
:url => "/spree/slides/:id/:style_:basename.:extension",
|
@@ -16,7 +13,7 @@ module Spree
|
|
16
13
|
:small => "300x100#",
|
17
14
|
:medium => "600x200#",
|
18
15
|
:slide => "900x300#",
|
19
|
-
:custom =>
|
16
|
+
:custom => Proc.new {|instance| "#{instance.attachment_width}x#{instance.attachment_height}#"}
|
20
17
|
},
|
21
18
|
:convert_options => {
|
22
19
|
:thumbnail => "-gravity center",
|
@@ -26,7 +23,9 @@ module Spree
|
|
26
23
|
:custom => "-gravity center"
|
27
24
|
}
|
28
25
|
|
29
|
-
|
26
|
+
validates_presence_of :slideshow_type_id
|
27
|
+
validates_attachment_presence :attachment
|
28
|
+
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"
|
30
29
|
|
31
30
|
# Load S3 settings
|
32
31
|
if (!YAML.load_file(Rails.root.join('config', 's3.yml'))[Rails.env].blank?)
|
@@ -4,7 +4,7 @@ class CreateSlides < ActiveRecord::Migration
|
|
4
4
|
t.string :title, :url
|
5
5
|
t.text :content
|
6
6
|
|
7
|
-
t.string :attachment_content_type, :attachment_file_name
|
7
|
+
t.string :attachment_content_type, :attachment_file_name
|
8
8
|
t.datetime :attachment_updated_at
|
9
9
|
t.integer :attachment_size, :position
|
10
10
|
t.string :type, :limit => 75
|
@@ -1,7 +1,16 @@
|
|
1
1
|
module SpreeMultiSlideshow
|
2
2
|
module Generators
|
3
3
|
class InstallGenerator < Rails::Generators::Base
|
4
|
-
|
4
|
+
|
5
|
+
def add_formtastic
|
6
|
+
res = ask "Would you like to run the formtastic install now? [Y/n]"
|
7
|
+
if res == "" || res.downcase == "y"
|
8
|
+
run 'rails generate formtastic:install'
|
9
|
+
else
|
10
|
+
puts "Skiping rails generate formtastic:install, don't forget to run it!"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
5
14
|
def add_javascripts
|
6
15
|
append_file "app/assets/javascripts/store/all.js", "//= require store/spree_multi_slideshow\n"
|
7
16
|
#append_file "app/assets/javascripts/admin/all.js", "//= require admin/spree_multi_slideshow\n"
|
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.
|
4
|
+
version: 1.0.3
|
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-
|
12
|
+
date: 2012-07-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: spree_core
|
@@ -27,22 +27,6 @@ dependencies:
|
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '0'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: spree_auth
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
38
|
-
type: :runtime
|
39
|
-
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
46
30
|
- !ruby/object:Gem::Dependency
|
47
31
|
name: aws-sdk
|
48
32
|
requirement: !ruby/object:Gem::Requirement
|