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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/app/assets/javascripts/rails_admin/rails_admin_dropzone.js.erb +28 -0
- data/app/assets/stylesheets/rails_admin/{custom/theming.scss → rails_admin_dropzone.scss} +0 -0
- data/app/views/rails_admin/main/dropzone.html.haml +3 -0
- data/lib/rails_admin_dropzone/engine.rb +6 -0
- data/lib/rails_admin_dropzone/version.rb +1 -1
- metadata +4 -4
- data/app/assets/javascripts/rails_admin/custom/ui.js.erb +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef48e5dc825d8542da261ae31b87ba54fc9ecb17
|
4
|
+
data.tar.gz: 4c227184ff42784ebb85cc940e2610bee1cd84ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4be1e57e68ee51db5ea20a9696ac446d671068f44ed5cd4e1e0e4379c7b6b1e98de8185cef41113ed4b51e7024af9f5011dcb3608b9d8f0d552133a154a291af
|
7
|
+
data.tar.gz: d30d48925461524c7afb0bf589e924ddb57a09d802a2c9032ee424d55713221ff84251d2900408f370516fd6f89d1dbaa176f2b419b0316cdc07ed857eb2e220
|
data/Gemfile.lock
CHANGED
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&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
|
+
|
File without changes
|
@@ -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
|
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
|
+
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-
|
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/
|
140
|
-
- app/assets/stylesheets/rails_admin/
|
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
|
-
});
|