thecore_ui_commons 2.2.6 → 2.3.1

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: '044692e50388d2be1a07d5ecf256cb590bbaa227d78ad32e0885fc8859dac137'
4
- data.tar.gz: 739c924a0eed89d69e51361edd060dee8b0af722565c21b09b3f07d55e18a05e
3
+ metadata.gz: ef99f016b67f373d5083fa6475a1f98dc01d7201273d0b76c5cb977e6057c4a0
4
+ data.tar.gz: b163f9c5037f6b96a54c9eba9a27e16f826c4cd869341a448e39aa992925b98f
5
5
  SHA512:
6
- metadata.gz: bea19b48bc818c37da1df3be6d1d230dc1f20f929e89953c597219f3eb2ded0c5ddc8bb7de724e8f426407f84b0c07c8f63b490eeafc9ef43ce331c9281322af
7
- data.tar.gz: 9ba335b796d5e6fc25d52ab5e1704597b32108f575ae1c6027b31001aea02b0685405dafc75c1705e57c0086f9015218a45992af5dba64ec9c34d089eb28aeb2
6
+ metadata.gz: 014d79daedc5d88bbe8441e7a3199267ca3ba7c37d2ee08c5c63c8f5fb435051cc787934f357f972077df84a9887933895477b8889ef893bf3db971c5028879f
7
+ data.tar.gz: '03800a14b23b6837defc2d65809e7c8338f31ba87a12481be79021c14d6534972a14cccd97e26c007210cb38fa65a44749a7c0521cf5a60fce37dd2a9df45907'
@@ -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,6 +1,7 @@
1
1
  en:
2
2
  file_upload: Upload description, please add a translation for the element called file_upload in your translation file.
3
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.
4
5
  loading: Caricamento
5
6
  please_drag_and_drop_here: Drag and Drop here the files to import
6
7
  import_success: Import Successful!
@@ -1,6 +1,7 @@
1
1
  it:
2
2
  file_upload: Descrizione della procedura, prego aggiungere una traduzione per file_upload al tuo file delle traduzioni.
3
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.
4
5
  loading: Caricamento
5
6
  run_import: Forza l'importazione
6
7
  please_drag_and_drop_here: Trascinare qui i file da importare
data/db/seeds.rb ADDED
@@ -0,0 +1,3 @@
1
+ puts "Loading ThecoreUiCommons seeds"
2
+ Settings.ns(:importer).import_from_folder = "tmp/imports"
3
+ Settings.ns(:importer).extension = "txt"
@@ -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,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|
@@ -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.6
4
+ version: 2.3.1
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-16 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
@@ -138,7 +180,7 @@ files:
138
180
  - config/routes.rb
139
181
  - db/migrate/20200515070620_add_username_to_user.rb
140
182
  - db/migrate/20200515132932_add_rememberable_to_user.rb
141
- - db/migrate/20210208142646_add_settings_for_uploader.rb
183
+ - db/seeds.rb
142
184
  - lib/concerns/thecore_ui_commons_user.rb
143
185
  - lib/tasks/thecore_ui_commons_tasks.rake
144
186
  - lib/thecore_ui_commons.rb
@@ -1,6 +0,0 @@
1
- class AddSettingsForUploader < ActiveRecord::Migration[6.0]
2
- def change
3
- Settings.ns(:importer).import_from_folder = "tmp/imports"
4
- Settings.ns(:importer).extension = "txt"
5
- end
6
- end