rails_admin_multiple_file_upload 0.4.3 → 0.5.0

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: a2a765d2be198c84cb26e18b6288a89b731e36f5
4
- data.tar.gz: 07987f6026a8d1eea9da12f106f34f6f9fa4544a
3
+ metadata.gz: 8121d0d8ec32f7c6a54a21b9541834dfe5d00a46
4
+ data.tar.gz: 5052f93bfb2a1f60c9cad57e1eb4754bc54516a4
5
5
  SHA512:
6
- metadata.gz: f11695f8218aef92861d9526065f764ac9320673aacb9a58424fc3b1776735cfedb146b1c5836b900fc3da0fa00b0586a4c20e303eb7544826a884dd57c11258
7
- data.tar.gz: 6990653615e7178bce343ff624fff94671091700ae8fc6a75bde2a70d862cc3e8f8974ce4ad8da71a10636870bb3a6318d97294a2aa7613ece08827a2f0c43c1
6
+ metadata.gz: ac28d877cdd5a1500264aad9473a6571e6660fe95af47e7856e308615a6d827fc281421b1186e1b3c417fc67305639c0ba3e3f1e788dea94bdf50c56b8376409
7
+ data.tar.gz: 1cf30933e23b542bcea04fa7de70a816f30848923bd763b92d237c8ac699f70c21030338d12312b35290d58b8bfbae70d15b98bda156fb2013f967238a56d413
@@ -1 +1 @@
1
- rails_admin_multiple_file_upload
1
+ rails_admin_multiple_file_upload_rails5
data/README.md CHANGED
@@ -1,12 +1,14 @@
1
1
  # RailsAdminMultipleFileUpload
2
2
 
3
+ ### Rails 5 Support
4
+
3
5
  rails_admin + dropzone.js + mongoid(embedded)
4
6
 
5
7
  ## Installation
6
8
 
7
9
  Add this line to your application's Gemfile:
8
10
 
9
- gem 'rails_admin_multiple_file_upload', '~> 0.4.3'
11
+ gem 'rails_admin_multiple_file_upload', '~> 0.5.0'
10
12
 
11
13
  And then execute:
12
14
 
@@ -47,7 +47,7 @@
47
47
  - if child_objects.respond_to?("ordered") and child_model_ordered_scope.blank?
48
48
  - child_model_ordered_scope = "ordered".freeze
49
49
 
50
- .tab-pane{id="multiple_file_upload_#{child_field}_#{child_model_upload_field}"}
50
+ .tab-pane{id="multiple_file_upload_#{child_field}_#{child_model_upload_field}".freeze}
51
51
  .row-fluid
52
52
  - block_id = "rails_admin_multiple_upload_#{child_field}_#{child_model_upload_field}".freeze
53
53
  - button_id = "rails_admin_multiple_upload_#{child_field}_#{child_model_upload_field}_button".freeze
@@ -59,8 +59,7 @@
59
59
  $("##{block_id} .dropzone").dropzone({
60
60
  paramName: "#{child_field}[#{child_model_upload_field}]",
61
61
  autoProcessQueue: false,
62
- addRemoveLinks: true,
63
- parallelUploads: 1
62
+ addRemoveLinks: true
64
63
  });
65
64
  $("##{block_id} .dropzone")[0].dropzone.on('success', function(){
66
65
  $("##{button_id}").click();
@@ -8,7 +8,7 @@
8
8
  ruby:
9
9
  _escape_tableize = @model.name.tableize.gsub("/", "_")
10
10
  upload_field = "image".freeze
11
- i18n_path = "rails_admin.multiple_file_upload_collection.#{@model.name.tableize}.#{upload_field}".freeze
11
+ i18n_path = "rails_admin.multiple_file_upload_collection.#{@model.name.tableize}.#{upload_field}"v
12
12
  i18n_path_default = "rails_admin.multiple_file_upload_collection.#{@model.name.tableize}".freeze
13
13
 
14
14
  link = "#multiple_file_upload_collection_#{_escape_tableize}_#{upload_field}".freeze
@@ -41,7 +41,7 @@
41
41
  - objects = @model.all.to_a
42
42
 
43
43
  - _escape_tableize = @model.name.tableize.gsub("/", "_").freeze
44
- .tab-pane{id="multiple_file_upload_collection_#{_escape_tableize}_#{upload_field}"}
44
+ .tab-pane{id="multiple_file_upload_collection_#{_escape_tableize}_#{upload_field}".freeze}
45
45
  .row-fluid
46
46
  - block_id = "rails_admin_multiple_upload_collection_#{_escape_tableize}_#{upload_field}".freeze
47
47
  - button_id = "rails_admin_multiple_upload_collection_#{_escape_tableize}_#{upload_field}_button".freeze
@@ -53,8 +53,7 @@
53
53
  $("##{block_id} .dropzone").dropzone({
54
54
  paramName: "#{upload_field}",
55
55
  autoProcessQueue: false,
56
- addRemoveLinks: true,
57
- parallelUploads: 1
56
+ addRemoveLinks: true
58
57
  });
59
58
  $("##{block_id} .dropzone")[0].dropzone.on('success', function(){
60
59
  $("##{button_id}").click();
@@ -74,10 +73,10 @@
74
73
  - objects = @model.sorted.to_a
75
74
  - elsif child_objects.respond_to?("ordered")
76
75
  - objects = @model.ordered.to_a
77
- - else
76
+ -else
78
77
  - objects = @model.all.to_a
79
78
 
80
- .tab-pane{id="multiple_file_upload_collection_#{_escape_tableize}_#{upload_field}"}
79
+ .tab-pane{id="multiple_file_upload_collection_#{_escape_tableize}_#{upload_field}".freeze}
81
80
  .row-fluid
82
81
  - block_id = "rails_admin_multiple_upload_collection_#{_escape_tableize}_#{upload_field}".freeze
83
82
  - button_id = "rails_admin_multiple_upload_collection_#{_escape_tableize}_#{upload_field}_button".freeze
@@ -89,8 +88,7 @@
89
88
  $("##{block_id} .dropzone").dropzone({
90
89
  paramName: "#{upload_field}",
91
90
  autoProcessQueue: false,
92
- addRemoveLinks: true,
93
- parallelUploads: 1
91
+ addRemoveLinks: true
94
92
  });
95
93
  $("##{block_id} .dropzone")[0].dropzone.on('success', function(){
96
94
  $("##{button_id}").click();
@@ -49,25 +49,9 @@ module RailsAdmin
49
49
  end
50
50
 
51
51
  main_obj = @object
52
- child_scope = main_obj.send(child_field)
53
- child = child_scope.new
52
+ child = main_obj.send(child_field).new
54
53
  child.name = File.basename(_file.original_filename, ext) if @conf.options[:name_from_filename]
55
54
  child.send(child_model_upload_field + "=", _file)
56
- if @conf.options[:set_order_as_max_plus_one]
57
- begin
58
- if @conf.options[:set_order_as_max_plus_one].is_a?(Symbol) or @conf.options[:set_order_as_max_plus_one].is_a?(String)
59
- f_name = @conf.options[:set_order_as_max_plus_one]
60
- else
61
- f_name = :order
62
- end
63
- if child.respond_to?(f_name) and child.respond_to?("#{f_name}=") and child_scope.respond_to?(f_name)
64
- current_max = child_scope.max(f_name).to_i
65
- child.send("#{f_name}=", current_max + 1)
66
- end
67
- rescue Exception => ex
68
- puts ex.inspect
69
- end
70
- end
71
55
  if child.save
72
56
  message = "<strong>#{I18n.t('admin.actions.multiple_file_upload.success')}!</strong>".freeze
73
57
  else
@@ -78,7 +62,7 @@ module RailsAdmin
78
62
  message = "<strong>#{I18n.t('admin.actions.multiple_file_upload.error')}</strong>: #{e}".freeze
79
63
  end
80
64
 
81
- render plain: message
65
+ render text: message
82
66
  end
83
67
  end
84
68
  end
@@ -157,7 +141,7 @@ module RailsAdmin
157
141
  message = "<strong>#{I18n.t('admin.actions.multiple_file_upload_collection.error')}</strong>: #{e}"
158
142
  end
159
143
 
160
- render plain: message
144
+ render text: message
161
145
  end
162
146
  end
163
147
  end
@@ -9,8 +9,7 @@ module RailsAdminMultipleFileUpload
9
9
  fields: [{}],
10
10
  thumbnail_size: :thumb,
11
11
  upload_gem: :paperclip,
12
- name_from_filename: true,
13
- set_order_as_max_plus_one: true
12
+ name_from_filename: true
14
13
  }.merge(config || {})
15
14
  end
16
15
 
@@ -1,3 +1,3 @@
1
1
  module RailsAdminMultipleFileUpload
2
- VERSION = "0.4.3".freeze
2
+ VERSION = "0.5.0".freeze
3
3
  end
@@ -21,6 +21,8 @@ Gem::Specification.new do |gem|
21
21
  gem.add_development_dependency "bundler", "~> 1.10"
22
22
  gem.add_development_dependency "rake", "~> 10.0"
23
23
 
24
- gem.add_dependency "rails_admin", "~> 0.8.1"
24
+ gem.add_dependency "rails", '>= 5.0'
25
+
26
+ gem.add_dependency "rails_admin", '>= 1.0.0.rc'
25
27
  gem.add_dependency 'dropzonejs-rails', "~> 0.7.3"
26
28
  end
data/release.sh CHANGED
@@ -2,5 +2,5 @@
2
2
  bundle update
3
3
  git add --all .
4
4
  git commit -am "${*:1}"
5
- git push -u origin master
5
+ git push -u origin rails5
6
6
  rake release
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_admin_multiple_file_upload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kiseliev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-14 00:00:00.000000000 Z
11
+ date: 2016-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,20 +38,34 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '5.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '5.0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rails_admin
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - "~>"
59
+ - - ">="
46
60
  - !ruby/object:Gem::Version
47
- version: 0.8.1
61
+ version: 1.0.0.rc
48
62
  type: :runtime
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - "~>"
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
- version: 0.8.1
68
+ version: 1.0.0.rc
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: dropzonejs-rails
57
71
  requirement: !ruby/object:Gem::Requirement