rails_admin_dropzone 1.0.4 → 1.0.5

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: ebc34a13c3c8529052327b82812c517342b022a6
4
- data.tar.gz: 69cd9a95f7e178325daa8c5b1c6d1510485608be
3
+ metadata.gz: ef48e5dc825d8542da261ae31b87ba54fc9ecb17
4
+ data.tar.gz: 4c227184ff42784ebb85cc940e2610bee1cd84ce
5
5
  SHA512:
6
- metadata.gz: 64cfab921b9427c2e8ea0f419ac1a28942962dd92108fb82b8117da019f9b2e709554740f9ca3a808ad166556b32170db80fada3a04856409110d2761a83c05c
7
- data.tar.gz: 101804decea81aa3708a295548bd24ca47004d041e3c76b9c8e113eb123bf0d8cbebc7e94db24968887cb6eb5d17fdc7464e23c4dc74d2fd250e8ca4e4128dc4
6
+ metadata.gz: 4be1e57e68ee51db5ea20a9696ac446d671068f44ed5cd4e1e0e4379c7b6b1e98de8185cef41113ed4b51e7024af9f5011dcb3608b9d8f0d552133a154a291af
7
+ data.tar.gz: d30d48925461524c7afb0bf589e924ddb57a09d802a2c9032ee424d55713221ff84251d2900408f370516fd6f89d1dbaa176f2b419b0316cdc07ed857eb2e220
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails_admin_dropzone (1.0.3)
4
+ rails_admin_dropzone (1.0.4)
5
5
  dropzonejs-rails (~> 0.7.3)
6
6
  jquery-rails (>= 3.0, < 5)
7
7
  simple_form (~> 3.2)
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Custom Action to RailsAdmin with Dropzone.js Multiple File Upload
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/rails_admin_dropzone.svg)](https://badge.fury.io/rb/rails_admin_dropzone)
4
+
3
5
  Easy to use integration of drag&amp;drop files upload via dropzone.js for rails_admin
4
6
 
5
7
  # Screenshot
@@ -0,0 +1,28 @@
1
+ //= require dropzone
2
+
3
+ $(document).on('rails_admin.dom_ready', function() {
4
+ // disable auto discover
5
+ Dropzone.autoDiscover = true;
6
+
7
+ if ($(".dropzone").length){
8
+ var dropzone = new Dropzone (".dropzone", {
9
+ maxFilesize: 256, // Set the maximum file size to 256 MB
10
+ paramName: "album[second_attr][]", // Rails expects the file upload to be something like model[field_name]
11
+ addRemoveLinks: false, // Don't show remove links on dropzone itself.
12
+
13
+ // Translations
14
+ dictDefaultMessage: "<%= I18n.t('admin.actions.dropzone.dictDefaultMessage') %>",
15
+ dictFallbackMessage: "<%= I18n.t('admin.actions.dropzone.dictFallbackMessage') %>",
16
+ dictFallbackText: "<%= I18n.t('admin.actions.dropzone.dictFallbackText') %>",
17
+ dictFileTooBig: "<%= I18n.t('admin.actions.dropzone.dictFileTooBig') %>",
18
+ dictInvalidFileType: "<%= I18n.t('admin.actions.dropzone.dictInvalidFileType') %>",
19
+ dictResponseError: "<%= I18n.t('admin.actions.dropzone.dictResponseError') %>",
20
+ dictCancelUpload: "<%= I18n.t('admin.actions.dropzone.dictCancelUpload') %>",
21
+ dictCancelUploadConfirmation: "<%= I18n.t('admin.actions.dropzone.dictCancelUploadConfirmation') %>",
22
+ dictRemoveFile: "<%= I18n.t('admin.actions.dropzone.dictRemoveFile') %>",
23
+ dictMaxFilesExceeded: "<%= I18n.t('admin.actions.dropzone.dictMaxFilesExceeded') %>"
24
+ });
25
+ }
26
+ });
27
+
28
+
@@ -1,2 +1,5 @@
1
+ = stylesheet_link_tag 'rails_admin/rails_admin_dropzone'
2
+ = javascript_include_tag 'rails_admin/rails_admin_dropzone'
3
+
1
4
  = simple_form_for(rails_admin.dropzone_url(@abstract_model.to_param, id: @object.id), html: { class: 'dropzone', multipart: true }) do |f|
2
5
  = f.input :id, :as => :hidden, :input_html => { :name => "id", :value => @object.id }
@@ -4,5 +4,11 @@ require 'jquery-rails'
4
4
 
5
5
  module RailsAdminDropzone
6
6
  class Engine < ::Rails::Engine
7
+ initializer 'rails_admin_dropzone_assets' do |app|
8
+ app.config.assets.precompile += %w(
9
+ rails_admin/rails_admin_dropzone.js
10
+ rails_admin/rails_admin_dropzone.css
11
+ )
12
+ end
7
13
  end
8
14
  end
@@ -1,3 +1,3 @@
1
1
  module RailsAdminDropzone
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_admin_dropzone
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luiz Picolo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-05 00:00:00.000000000 Z
11
+ date: 2016-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simple_form
@@ -136,8 +136,8 @@ files:
136
136
  - MIT-LICENSE
137
137
  - README.md
138
138
  - Rakefile
139
- - app/assets/javascripts/rails_admin/custom/ui.js.erb
140
- - app/assets/stylesheets/rails_admin/custom/theming.scss
139
+ - app/assets/javascripts/rails_admin/rails_admin_dropzone.js.erb
140
+ - app/assets/stylesheets/rails_admin/rails_admin_dropzone.scss
141
141
  - app/views/.gitkeep
142
142
  - app/views/rails_admin/main/dropzone.html.haml
143
143
  - bin/console
@@ -1,26 +0,0 @@
1
- //= require dropzone
2
-
3
- $(document).on('rails_admin.dom_ready', function() {
4
- // disable auto discover
5
- Dropzone.autoDiscover = true;
6
-
7
- if ($(".dropzone").length){
8
- var dropzone = new Dropzone (".dropzone", {
9
- maxFilesize: 256, // Set the maximum file size to 256 MB
10
- paramName: "album[second_attr][]", // Rails expects the file upload to be something like model[field_name]
11
- addRemoveLinks: false, // Don't show remove links on dropzone itself.
12
-
13
- // Translations
14
- dictDefaultMessage: "<%= I18n.t('admin.actions.dropzone.dictDefaultMessage') %>",
15
- dictFallbackMessage: "<%= I18n.t('admin.actions.dropzone.dictFallbackMessage') %>",
16
- dictFallbackText: "<%= I18n.t('admin.actions.dropzone.dictFallbackText') %>",
17
- dictFileTooBig: "<%= I18n.t('admin.actions.dropzone.dictFileTooBig') %>",
18
- dictInvalidFileType: "<%= I18n.t('admin.actions.dropzone.dictInvalidFileType') %>",
19
- dictResponseError: "<%= I18n.t('admin.actions.dropzone.dictResponseError') %>",
20
- dictCancelUpload: "<%= I18n.t('admin.actions.dropzone.dictCancelUpload') %>",
21
- dictCancelUploadConfirmation: "<%= I18n.t('admin.actions.dropzone.dictCancelUploadConfirmation') %>",
22
- dictRemoveFile: "<%= I18n.t('admin.actions.dropzone.dictRemoveFile') %>",
23
- dictMaxFilesExceeded: "<%= I18n.t('admin.actions.dropzone.dictMaxFilesExceeded') %>"
24
- });
25
- }
26
- });