viniBaxter-field-active_storage 300.0.10 → 300.0.18

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: e63d258f0c53f550669d2af609eea38905f5af1dfca2999dd71897e8b6b8d34a
4
- data.tar.gz: a6bcec3a78f1d85cfc26d8402dbacf4eba40be0309de8866d61c93654ca7a63e
3
+ metadata.gz: 7c2863b8f09940374a116dd3c17d9b4cf77fc4866307f5dc67c34b8982caf024
4
+ data.tar.gz: ca56b4b45b5f9afce31310eacdbcf0a5161baec9ecbbf821669c9bc3a24b996c
5
5
  SHA512:
6
- metadata.gz: 32516db1d0223677ad4e8d11dfd832de9c043b41babe102afac8cfe2cf3846a6805b9f02e04203b65983a2074f9d3187f02791836013a9aeab7e75a74d844bdd
7
- data.tar.gz: bbacb43a6930195174c7908530155461d6d9cdf66cf71e45b038cc189f7bb240f850af8ddbbed48ccb4f3ae8e6eadd5077e89bb690ce6cfaf0bd0a1be92a9ad6
6
+ metadata.gz: d7a688affd89e5d5abf97aee1695abd28376d17fd07b884a8ad62b4c218bd8e9a637ca0b0b917251f1ab42d6cd480c062962458cd496f169a027caa2194fb482
7
+ data.tar.gz: 559aa4007c4b6746fd513355d96cc58fc0fec2a1e8a9d7a7f9b3a9ea1b1ff7fbd532d66094ca9284dbbdffcec50efa94fa89a52ae9ebcf08d3952c00048dfb0b
@@ -1,9 +1,6 @@
1
1
  <% if field.attached? %>
2
2
  <style type="text/css" nonce="<%= content_security_policy_nonce %>">
3
3
  <%# figure out a way to remove this %>
4
- td img {
5
- max-height: unset !important;
6
- }
7
4
  </style>
8
5
  <% if field.index_display_preview? %>
9
6
  <% if field.many? %>
@@ -12,8 +12,8 @@
12
12
  <div class="list-group-item">
13
13
  <div class="row align-items-center">
14
14
  <% attachments.each do |attachment| %>
15
- <div>
16
- <div class="" id="<%= @page.class %>_picture_<%= attachment.id %>">
15
+ <div class="mr-3">
16
+ <div class="mb-2" id="<%= @page.class %>_picture_<%= attachment.id %>">
17
17
  <%= render partial: 'fields/active_storage/drop_js/dropjs_list_edit', locals: {
18
18
  field: field,
19
19
  attachment: attachment,
@@ -21,27 +21,48 @@
21
21
  image_size: field.show_preview_size
22
22
  }%>
23
23
  </div>
24
- <div class="col ml-n2">
24
+ <div class="">
25
25
  <small class="text-muted">
26
- <div class="mb-1 dz-size" data-dz-size="">
27
- <strong>
28
- SEO: <%= alt_method(attachment) %>
29
- </strong>
26
+ <div class="">
27
+ SEO: <%= alt_method(attachment) %>
30
28
  </div>
31
29
  </small>
32
30
  <div class="dz-error-message"><span data-dz-errormessage=""></span></div>
33
31
  <!-- Text -->
34
32
  <small class="text-muted">
35
- <div class="mb-1 dz-size" data-dz-size="">
36
- <strong>
37
- full name : <%= attachment.filename %> |
38
- </strong></div>
33
+ <div class="">
34
+ full name : <%= attachment.filename %>
35
+ </div>
36
+ </small>
37
+ <small class="text-muted">
38
+ <div class="">
39
+ Width: <%= attachment.blob.metadata[:width]%>px
40
+ </div>
41
+ </small>
42
+ <small class="text-muted">
43
+ <div class="">
44
+ Height: <%= attachment.blob.metadata[:height]%>px
45
+ </div>
46
+ </small>
47
+ <small class="text-muted">
48
+ <div class="">
49
+ Aspect ratio - Width/Height : <%#= ((attachment.blob.metadata[:width]).to_f / (attachment.blob.metadata[:height]).to_f).round(2).to_s.to_r%>
50
+ </div>
51
+ </small>
52
+ <small class="text-muted">
53
+ <div class="">
54
+ Aspect ratio - Height/Width : <%#= (( (attachment.blob.metadata[:height]).to_f / attachment.blob.metadata[:width]).to_f).round(2).to_s.to_r%>
55
+ </div>
56
+ </small>
57
+ <small class="text-muted">
58
+ <div class="">
59
+ Vertical Padding : <%#= (attachment.blob.metadata[:height].to_f / attachment.blob.metadata[:width].to_f ).to_f.round(8)*100 %> (in percent %)
60
+ </div>
39
61
  </small>
40
62
  <small class="text-muted">
41
- <div class="mb-1 dz-size" data-dz-size="">
42
- <strong>
43
- <%= attachment.byte_size.fdiv(1000).round(1) %>
44
- </strong> KB</div>
63
+ <div class="" data-dz-size="">
64
+ Size : <%= attachment.byte_size.fdiv(1000000).round(4) %>
65
+ MB</div>
45
66
  </small>
46
67
  </div>
47
68
  </div>
@@ -18,12 +18,45 @@
18
18
  <div class="row align-items-center">
19
19
  <% attachments.each do |attachment| %>
20
20
  <div class="" id="<%= @page.class %>_picture_<%= attachment.id %>">
21
- <%= render partial: 'fields/active_storage/drop_js/dropjs_list_edit', locals: {
22
- field: field,
23
- attachment: attachment,
24
- removable: removable,
25
- image_size: field.show_preview_size
26
- }%>
21
+ <div class='mt-4 list-group list-group-flush'>
22
+ <div class="dz-preview dz-file-preview bibi">
23
+ <div class="row align-items-center">
24
+ <div class="col-auto">
25
+ <div class="mx-1 my-1 avatar thumbnail-picture">
26
+ <%
27
+ # By default we don't allow attachment removal
28
+ removable = local_assigns.fetch(:removable, false)
29
+ image_size = local_assigns.fetch(:image_size, [200, 200])
30
+ %>
31
+ <% if attachment.image? and attachment.variable? and !field.url_only? %>
32
+ <%= link_to(field.blob_url(attachment), title: attachment.filename, class:'rounded avatar-img') do %>
33
+ <%#= image_tag(field.variant(attachment, resize_to_limit: image_size),class:'avatar-img rounded delete_on_click') %>
34
+ <%= image_tag attachment.variant(resize_to_limit: image_size), class:"rounded thumbnail-picture-img delete_on_click" %>
35
+ <% end %>
36
+ <% elsif attachment.image? and !field.url_only? %>
37
+ <%= link_to(field.blob_url(attachment), title: attachment.filename) do %>
38
+ <%= image_tag(field.url(attachment)) %>
39
+ <% end %>
40
+ <% elsif attachment.video? and attachment.previewable? and !field.url_only? %> <%# if ffmpeg is installed %>
41
+ <%= video_tag(field.url(attachment), poster: field.preview(attachment, resize_to_limit: image_size), controls: true, autobuffer: true, style: "width: 100%; height: auto;") %>
42
+ <% elsif attachment.video? and !field.url_only? %>
43
+ <%= video_tag(field.url(attachment), controls: true, autobuffer: true, style: "width: 100%; height: auto;") %>
44
+ <% elsif attachment.audio? and !field.url_only? %>
45
+ <%= audio_tag(field.url(attachment), autoplay: false, controls: true) %>
46
+ <% else %>
47
+ <%= link_to(field.blob_url(attachment), title: attachment.filename) do %>
48
+ <% if attachment.previewable? and !field.url_only? %>
49
+ <%= image_tag(field.preview(attachment, resize_to_limit: [595, 842])) %>
50
+ <% else %>
51
+ <%= attachment.filename %>
52
+ <% end %>
53
+ <% end %>
54
+ <% end %>
55
+ </div>
56
+ </div>
57
+ </div>
58
+ </div>
59
+ </div>
27
60
  </div>
28
61
  <% end %>
29
62
  </div>
@@ -13,8 +13,13 @@
13
13
  <%= field.drop_max_file_size? %>
14
14
  MB par fichier. Les fichiers autorisés :
15
15
  <%= field.drop_accepted_files? %>. <br>
16
- A maximum of <%= field.drop_max_file? %> files allowed when creating or updating. <br>
17
- Want more assets? Save it and edit it again and add <%= field.drop_max_file? %> extras assets.
16
+ <% if field.many? %>
17
+ A maximum of <%= field.drop_max_file? %> files allowed for eacch creatiion or edition. <br>
18
+ Want more assets? Save it and edit it again and add <%= field.drop_max_file? %> extras assets.
19
+ <% else %>
20
+ A maximum of <%= field.drop_max_file? %> files allowed for eacch creatiion or edition. <br>
21
+ I case of edition, the previous asset will be deleted only <%= field.drop_max_file? %> allowed.
22
+ <% end %>
18
23
  </span>
19
24
  </div>
20
25
  <div id="tpl" style='display:none'>
@@ -2,7 +2,7 @@
2
2
  <div class="dz-preview dz-file-preview bibi">
3
3
  <div class="row align-items-center">
4
4
  <div class="col-auto">
5
- <div class="mx-1 my-1 avatar avatar-xl">
5
+ <div class="mx-1 my-1 avatar thumbnail-picture">
6
6
  <%
7
7
  # By default we don't allow attachment removal
8
8
  removable = local_assigns.fetch(:removable, false)
@@ -11,7 +11,7 @@
11
11
  <% if attachment.image? and attachment.variable? and !field.url_only? %>
12
12
  <%= link_to(field.blob_url(attachment), title: attachment.filename, class:'rounded avatar-img') do %>
13
13
  <%#= image_tag(field.variant(attachment, resize_to_limit: image_size),class:'avatar-img rounded delete_on_click') %>
14
- <%= image_tag attachment.variant(resize_to_limit: image_size), class:"rounded avatar-img delete_on_click" %>
14
+ <%= image_tag attachment.variant(resize_to_limit: image_size), class:"rounded thumbnail-picture-img delete_on_click" %>
15
15
  <% end %>
16
16
  <% elsif attachment.image? and !field.url_only? %>
17
17
  <%= link_to(field.blob_url(attachment), title: attachment.filename) do %>
@@ -38,7 +38,7 @@
38
38
  <%= link_to destroy_url,
39
39
  method: :delete,
40
40
  remote: true do %>
41
- <i class="tim-icons icon-simple-remove text-light"></i>
41
+ <i class="tim-icons active-storage icon-simple-remove text-light"></i>
42
42
  <% end %>
43
43
  </div>
44
44
  <% end %>
@@ -12,7 +12,7 @@
12
12
  <% if attachment.image? and attachment.variable? and !field.url_only? %>
13
13
  <%= link_to(field.blob_url(attachment), title: attachment.filename, class:'avatar') do %>
14
14
  <%#= image_tag(field.variant(attachment, resize_to_limit: image_size),class:'avatar-img rounded delete_on_click') %>
15
- <%= image_tag attachment.variant(resize_to_limit: image_size), class:"avatar-img rounded delete_on_click" %>
15
+ <%= image_tag attachment.variant(resize_to_limit: image_size), class:"thumbnail-picture-img rounded delete_on_click" %>
16
16
  <% end %>
17
17
  <% elsif attachment.image? and !field.url_only? %>
18
18
  <%= link_to(field.blob_url(attachment), title: attachment.filename) do %>
@@ -1,13 +1,13 @@
1
-
2
1
  <div class='mt-4 list-group list-group-flush'>
3
2
  <div class="dz-preview dz-file-preview bibi">
4
3
  <div class="row align-items-center">
5
4
  <div class="col-auto">
6
- <div class="mx-1 my-1 avatar avatar-xl">
7
- <img class="rounded avatar-img" data-dz-thumbnail>
5
+ <div class="mx-1 my-1 avatar thumbnail-picture">
6
+ <img class="rounded thumbnail-picture-img" data-dz-thumbnail>
7
+ <%#<img class="rounded avatar-img" data-dz-thumbnail>%>
8
8
  <div class="position-absolute delete-link d-flex align-items-center justify-content-center">
9
9
  <a rel="nofollow" data-dz-remove>
10
- <i class="tim-icons icon-simple-remove text-light"></i>
10
+ <i class="tim-icons active-storage icon-simple-remove text-light"></i>
11
11
  </a>
12
12
  </div>
13
13
  </div>
@@ -5,7 +5,7 @@ module ViniBaxter
5
5
  module ViniBaxterFieldActiveStorage
6
6
  MAJOR = 300
7
7
  MINOR = 0
8
- TINY = 10
8
+ TINY = 18
9
9
  PRE = "STUDIO"
10
10
 
11
11
  VERSION = [MAJOR, MINOR, TINY].compact.join(".")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: viniBaxter-field-active_storage
3
3
  version: !ruby/object:Gem::Version
4
- version: 300.0.10
4
+ version: 300.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - viny baxter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-06 00:00:00.000000000 Z
11
+ date: 2022-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: administrate