thecore_ui_commons 2.3.0 → 2.3.5
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/thecore_ui_commons/thecore.js +9 -0
- data/app/assets/stylesheets/thecore_ui_commons/thecore.scss +9 -0
- data/app/views/devise/sessions/new.html.erb +1 -1
- data/app/views/thecore_utils/_drag_drop_uploader.html.erb +29 -1
- data/db/seeds.rb +3 -0
- data/lib/thecore_ui_commons.rb +2 -1
- data/lib/thecore_ui_commons/engine.rb +3 -0
- metadata +4 -4
- data/db/migrate/20210208142646_add_settings_for_uploader.rb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2eadcb0a11efa653a978b486e42b38aa17442ae5dc949c448467de97361a8918
|
4
|
+
data.tar.gz: 38eb74c925c6ed989658b12a49e4e74d2c17b9b1d05f6e4fcdf5f250d937d098
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aef023c693cf746c2edf73b9aef05614188c06d8c2e616b331853f5f63410866e47a5fae7f8ef09ff384b1a508938d24890b33ff0c5983ef7c5faa25c7a6100f
|
7
|
+
data.tar.gz: 382c936669259c399086a598f89b32bd5d1a553e77b31bcd259e1606bc6853c0846ef4c79817fe41555e3d945b2fa29c87dff115ae92ed4777f9437ec4b99937
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div class="col-md-4 col-md-offset-4">
|
1
|
+
<div class="col-md-4 col-md-offset-4" id="login-form">
|
2
2
|
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
|
3
3
|
<div class="field">
|
4
4
|
<%= f.text_field :login, autofocus: true, :class => "form-control", placeholder: t("devise.sessions.new.login") %>
|
@@ -38,6 +38,12 @@
|
|
38
38
|
background-color: darkred;
|
39
39
|
color: white;
|
40
40
|
}
|
41
|
+
|
42
|
+
.progress-bar {
|
43
|
+
/* Initial width of the progress bar */
|
44
|
+
width: 0%;
|
45
|
+
background-color: lightgrey;
|
46
|
+
}
|
41
47
|
</style>
|
42
48
|
|
43
49
|
<div class="panel panel-default">
|
@@ -54,7 +60,9 @@
|
|
54
60
|
<div class="upload-drop-zone" id="<%=target%>">
|
55
61
|
|
56
62
|
</div>
|
57
|
-
|
63
|
+
<div class="progress">
|
64
|
+
<div class="progress-bar progress-bar-striped" role="progressbar">0%</div>
|
65
|
+
</div>
|
58
66
|
<div id="upload-status">
|
59
67
|
</div>
|
60
68
|
</div>
|
@@ -111,6 +119,26 @@
|
|
111
119
|
error: function () {
|
112
120
|
$("#<%=target%>-upload-drop-zone-feedback").html($('<i class="fa fa-exclamation-circle" aria-hidden="true"></i>').delay(3000).fadeOut(400));
|
113
121
|
fileupload.init();
|
122
|
+
},
|
123
|
+
xhr: function () {
|
124
|
+
// Credit to https://stackoverflow.com/a/57213032
|
125
|
+
var xhr = new XMLHttpRequest();
|
126
|
+
|
127
|
+
xhr.upload.addEventListener('progress', function(e){
|
128
|
+
if(e.lengthComputable){
|
129
|
+
var uploadPercent = e.loaded / e.total;
|
130
|
+
uploadPercent = (uploadPercent * 100);
|
131
|
+
|
132
|
+
$('.progress-bar').text(uploadPercent.toFixed(2) + '%');
|
133
|
+
$('.progress-bar').width(uploadPercent + '%');
|
134
|
+
|
135
|
+
if(uploadPercent == 100){
|
136
|
+
$('.progress-bar').text('Completed');
|
137
|
+
}
|
138
|
+
}
|
139
|
+
}, false);
|
140
|
+
|
141
|
+
return xhr;
|
114
142
|
}
|
115
143
|
});
|
116
144
|
// startUpload(e.dataTransfer.files)
|
data/db/seeds.rb
ADDED
data/lib/thecore_ui_commons.rb
CHANGED
@@ -19,7 +19,7 @@ module ThecoreUiCommons
|
|
19
19
|
# Your code goes here...
|
20
20
|
|
21
21
|
def self.save_files files
|
22
|
-
|
22
|
+
Rails.logger.debug "AAAAAAAAAAA: POST?"
|
23
23
|
files.each do |pic|
|
24
24
|
# Rails.logger.debug "AAAAAAAAAAA: EACH PIC: #{pic.inspect}"
|
25
25
|
upload_dir = Rails.root.join(Settings.ns(:importer).import_from_folder, 'uploads')
|
@@ -27,6 +27,7 @@ module ThecoreUiCommons
|
|
27
27
|
# Rails.logger.debug "AAAAAAAAAAA: Fatto MKDIR di #{upload_dir}"
|
28
28
|
file_to_upload = Rails.root.join(upload_dir, "uploaded-#{Time.now.strftime("%Y%m%d%H%M%S%L")}-#{pic.original_filename}")
|
29
29
|
# Rails.logger.debug "AAAAAAAAAAA: File da uploadare #{file_to_upload}"
|
30
|
+
# Rails.logger.debug "AAAAAAAAAAA: File da uploadare esiste? #{File.exists?(file_to_upload)}"
|
30
31
|
File.open(file_to_upload, 'wb') do |file|
|
31
32
|
# Rails.logger.debug "AAAAAAAAAAAAAAAAAA: Dentro alla scrittura"
|
32
33
|
file.write(pic.read)
|
@@ -1,6 +1,9 @@
|
|
1
1
|
module ThecoreUiCommons
|
2
2
|
class Engine < ::Rails::Engine
|
3
3
|
initializer 'thecore_ui_commons.add_to_migrations' do |app|
|
4
|
+
# Adds the list of Thecore Engines, so to manage seeds loading, i.e.:
|
5
|
+
# Thecore::Base.thecore_engines.each { |engine| engine.load_seed }
|
6
|
+
Thecore::Base.thecore_engines << self.class
|
4
7
|
unless app.root.to_s.match root.to_s
|
5
8
|
# APPEND TO MAIN APP MIGRATIONS FROM THIS GEM
|
6
9
|
config.paths['db/migrate'].expanded.each do |expanded_path|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thecore_ui_commons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thecore_background_jobs
|
@@ -180,7 +180,7 @@ files:
|
|
180
180
|
- config/routes.rb
|
181
181
|
- db/migrate/20200515070620_add_username_to_user.rb
|
182
182
|
- db/migrate/20200515132932_add_rememberable_to_user.rb
|
183
|
-
- db/
|
183
|
+
- db/seeds.rb
|
184
184
|
- lib/concerns/thecore_ui_commons_user.rb
|
185
185
|
- lib/tasks/thecore_ui_commons_tasks.rake
|
186
186
|
- lib/thecore_ui_commons.rb
|
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
206
|
- !ruby/object:Gem::Version
|
207
207
|
version: '0'
|
208
208
|
requirements: []
|
209
|
-
rubygems_version: 3.0.3
|
209
|
+
rubygems_version: 3.0.3.1
|
210
210
|
signing_key:
|
211
211
|
specification_version: 4
|
212
212
|
summary: Common artifacts for the UIs.
|