thecore_ui_commons 2.3.1 → 2.3.6

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
  SHA256:
3
- metadata.gz: ef99f016b67f373d5083fa6475a1f98dc01d7201273d0b76c5cb977e6057c4a0
4
- data.tar.gz: b163f9c5037f6b96a54c9eba9a27e16f826c4cd869341a448e39aa992925b98f
3
+ metadata.gz: a1fe931815502b3bd3884c4df50f2bd6ee8c22bf1cccbabc6828545caba767d5
4
+ data.tar.gz: 12bc1f502d25f2084805d567fff6bf24a967dc647eacca5deece6e6ecb83bc44
5
5
  SHA512:
6
- metadata.gz: 014d79daedc5d88bbe8441e7a3199267ca3ba7c37d2ee08c5c63c8f5fb435051cc787934f357f972077df84a9887933895477b8889ef893bf3db971c5028879f
7
- data.tar.gz: '03800a14b23b6837defc2d65809e7c8338f31ba87a12481be79021c14d6534972a14cccd97e26c007210cb38fa65a44749a7c0521cf5a60fce37dd2a9df45907'
6
+ metadata.gz: d82e219ae9e3e63a6b898759e3854db59fa2dbcf3199d93ba4347fd8f52427b4cc770b2220d1828faeb4d2033f843e6f28de95da31c35c276d0719babde56d31
7
+ data.tar.gz: 3e1077e269d86899a1f0c00d1fda522247607afa792821dfaf13f13725252505b0ec33b975b98c001d264e7444619eed1f15731237a89f7bb18e3ac980833c93
@@ -6,3 +6,12 @@
6
6
  //= require ie
7
7
  //= require timer
8
8
  //= require apexcharts
9
+
10
+ $(document).ready(function () {
11
+
12
+ window.setTimeout(function() {
13
+ $(".alert").fadeTo(1000, 0).slideUp(1000, function(){
14
+ $(this).remove();
15
+ });
16
+ }, 5000);
17
+ })
@@ -19,4 +19,13 @@
19
19
 
20
20
  #new_user div {
21
21
  margin-bottom: .5em;
22
+ }
23
+
24
+ .alert {
25
+ position:fixed;
26
+ bottom: 1em;
27
+ right: 1em;
28
+ width: 20vw;
29
+ z-index:9999;
30
+ border-radius: 1em;
22
31
  }
@@ -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: darkgray;
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)
@@ -19,7 +19,7 @@ module ThecoreUiCommons
19
19
  # Your code goes here...
20
20
 
21
21
  def self.save_files files
22
- # Rails.logger.debug "AAAAAAAAAAA: POST?"
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)
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.1
4
+ version: 2.3.6
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-03-16 00:00:00.000000000 Z
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
@@ -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.