thecore_ui_commons 2.2.5 → 2.3.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
  SHA256:
3
- metadata.gz: f96a230065dcec5fdb22b7959137e33b030af287152f1ef142f30830475908be
4
- data.tar.gz: 5a01e066cb48e721f83a208a0cf5570140a02babf5dd14d730019198bef95e4b
3
+ metadata.gz: 03d1a89997f19015363818b765abead88599d37202e14d2595683bb89eec2da9
4
+ data.tar.gz: c5f39edc2f974aa2ab8961c1d35483d0df0d31d619845584b01933c64c30ec3f
5
5
  SHA512:
6
- metadata.gz: 1aa2e381eb398e0b3fb29fc38ad3de5d2be9930afe486ac47352a45d76677a00317e883380bcb203c226351a409c60f4b4368bc6ce2ec6af95c272e122e5edb2
7
- data.tar.gz: 14e72ad93387dd2600bcbb09cf54440c60857ae55c62b393b77a2a240ad3a1f9ccb271cacf42b3f94ae7591f08114665025c1d35b6352f1ea64cc92929f9bdf3
6
+ metadata.gz: 5570885cde77bb6df53798bd0e1b5ddee4640546bec226cf7c66c6e6b1fa64a2ffc0404aa353864ae9111495c5dc73342127acecee3f572e0718238e9a2be9ba
7
+ data.tar.gz: 5273adc7dc79d7b3055676b92c188480977b353b8b84b84e0ce356b528d086c6754fdf9b3347fe30bdf71e22665ed7a55536ce9c773ea9e12c0dd81c41afaca6
@@ -31,7 +31,7 @@
31
31
  <div class="col-md-4 col-md-offset-4 text-center">
32
32
  <img class="main-menu-app-logo" style="width: 25%; max-width: 152px" src="<%= image_url('logo.png') %>"/>
33
33
  </div>
34
- <%- unless flash.empty? %>
34
+ <%- unless flash.blank? %>
35
35
  <div class="col-md-4 col-md-offset-4" style="margin-top: 1em;">
36
36
  <%= render partial: 'shared/flash' %>
37
37
  </div>
@@ -12,26 +12,32 @@
12
12
  =end%>
13
13
 
14
14
  <style>
15
- /* layout.css Style */
16
15
  .upload-drop-zone {
16
+ display: flex;
17
+ align-items: center;
18
+ justify-content: center;
17
19
  height: 200px;
18
20
  border-width: 2px;
19
- margin-bottom: 20px;
20
- }
21
-
22
- /* skin.css Style*/
23
- .upload-drop-zone {
24
- color: #ccc;
21
+ /* margin-bottom: 20px; */
22
+ color: #bbb;
25
23
  border-style: dashed;
26
24
  border-color: #ccc;
27
- line-height: 200px;
28
- text-align: center
25
+ /* line-height: 200px; */
26
+ text-align: center
27
+ }
28
+ .upload-drop-zone i {
29
+ font-size: 8em
29
30
  }
30
31
 
31
32
  .upload-drop-zone.drop {
32
33
  color: #222;
33
34
  border-color: #222;
34
35
  }
36
+
37
+ .upload-drop-zone.disabledDnD {
38
+ background-color: darkred;
39
+ color: white;
40
+ }
35
41
  </style>
36
42
 
37
43
  <div class="panel panel-default">
@@ -46,7 +52,7 @@
46
52
 
47
53
  <!-- Drop Zone -->
48
54
  <div class="upload-drop-zone" id="<%=target%>">
49
- <%=I18n.t :please_drag_and_drop_here%>
55
+
50
56
  </div>
51
57
 
52
58
  <div id="upload-status">
@@ -55,12 +61,24 @@
55
61
  </div>
56
62
 
57
63
  <script>
64
+ // Enable D&D beahviour
65
+ function dndOn() {
66
+ $('#<%=target%>').on("drop", this.ondrop);
67
+ $('#<%=target%>').on("dragover", this.ondragover);
68
+ $('#<%=target%>').on("dragleave", this.ondragleave);
69
+ $('#<%=target%>').removeClass('disabledDnD');
70
+ $('#<%=target%>').html('<div><i class="fa fa-cloud-upload"></i><br/><span><%=I18n.t :please_drag_and_drop_here%></span></div>')
71
+ }
72
+ // Disable D&D beahviour
73
+ function dndOff() {
74
+ $('#<%=target%>').addClass('disabledDnD');
75
+ $('#<%=target%>').html('<div><i class="fa fa-ban"></i><br/><span><%=I18n.t :dont_leve_or_drag_here%></span></div>')
76
+ $('#<%=target%>').off("drop", this.ondrop);
77
+ $('#<%=target%>').off("dragover", this.ondragover);
78
+ $('#<%=target%>').off("dragleave", this.ondragleave);
79
+ }
58
80
  var fileupload = {
59
- init: function () {
60
- $('#<%=target%>').on("drop", this.ondrop);
61
- $('#<%=target%>').on("dragover", this.ondragover);
62
- $('#<%=target%>').on("dragleave", this.ondragleave);
63
- },
81
+ init: dndOn,
64
82
 
65
83
  beforeSuccess: function(){
66
84
  console.log("beforeSuccess");
@@ -69,6 +87,7 @@
69
87
  ondrop: function (e) {
70
88
  // console.log(e)
71
89
  e.preventDefault();
90
+ dndOff();
72
91
  $('#<%=target%>').removeClass('drop');
73
92
  $("#<%=target%>-upload-drop-zone-feedback").html("<i class='fa fa-spinner fa-spin '></i>");
74
93
 
@@ -87,9 +106,11 @@
87
106
  success: function () {
88
107
  fileupload.beforeSuccess();
89
108
  $("#<%=target%>-upload-drop-zone-feedback").html($('<i class="fa fa-check-square-o" aria-hidden="true"></i>').delay(3000).fadeOut(400));
109
+ fileupload.init();
90
110
  },
91
111
  error: function () {
92
112
  $("#<%=target%>-upload-drop-zone-feedback").html($('<i class="fa fa-exclamation-circle" aria-hidden="true"></i>').delay(3000).fadeOut(400));
113
+ fileupload.init();
93
114
  }
94
115
  });
95
116
  // startUpload(e.dataTransfer.files)
@@ -1,4 +1,10 @@
1
1
  en:
2
+ file_upload: Upload description, please add a translation for the element called file_upload in your translation file.
3
+ file_upload_subtitle: Descrizione aggiuntiva, prego aggiungere una traduzione per file_upload_subtitle al tuo file delle traduzioni.
4
+ dont_leve_or_drag_here: Uploading, please don't leave this page or Drag & Drop other files.
5
+ loading: Caricamento
6
+ please_drag_and_drop_here: Drag and Drop here the files to import
7
+ import_success: Import Successful!
2
8
  current_user: Current User
3
9
  devise:
4
10
  sessions:
@@ -1,4 +1,10 @@
1
1
  it:
2
+ file_upload: Descrizione della procedura, prego aggiungere una traduzione per file_upload al tuo file delle traduzioni.
3
+ file_upload_subtitle: Descrizione aggiuntiva, prego aggiungere una traduzione per file_upload_subtitle al tuo file delle traduzioni.
4
+ dont_leve_or_drag_here: Upload in corso, si prega di non lasciare la pagina o trascinare qui altri file.
5
+ loading: Caricamento
6
+ run_import: Forza l'importazione
7
+ please_drag_and_drop_here: Trascinare qui i file da importare
2
8
  import_success: Importazione completata con successo
3
9
  current_user: Utente corrente
4
10
  hello: "Ciao Mondo"
@@ -11,7 +11,7 @@ module ThecoreUiCommonsUser
11
11
  attr_writer :login
12
12
 
13
13
  def login
14
- @login || self.username || self.email
14
+ @login || (self.username rescue self.email)
15
15
  end
16
16
  # Use login
17
17
  def self.find_first_by_auth_conditions(warden_conditions)
@@ -3,6 +3,10 @@ require 'thecore_background_jobs' # This brings backend commons also.
3
3
  require 'serviceworker-rails'
4
4
  require "groupdate"
5
5
  require "apexcharts"
6
+ # require "gtk3"
7
+ require "cairo"
8
+ require "poppler"
9
+ require "image_processing"
6
10
 
7
11
  require 'concerns/thecore_ui_commons_user'
8
12
 
@@ -1,3 +1,3 @@
1
1
  module ThecoreUiCommons
2
- VERSION = "#{`git describe --tags $(git rev-list --tags --max-count=1)`}"
2
+ VERSION = "#{`git describe --tags $(git rev-list --tags --max-count=1)`.chomp}"
3
3
  end
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.2.5
4
+ version: 2.3.0
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-02-08 00:00:00.000000000 Z
11
+ date: 2021-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore_background_jobs
@@ -66,6 +66,48 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: cairo
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.17'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.17'
83
+ - !ruby/object:Gem::Dependency
84
+ name: poppler
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.4'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.4'
97
+ - !ruby/object:Gem::Dependency
98
+ name: image_processing
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.2'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.2'
69
111
  description: Engine to serve configurations and rails module useful for all the UIs.
70
112
  email:
71
113
  - gabriele.tassoni@gmail.com