viniBaxter-field-active_storage 7.0.0 → 11.0.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: 73dfc5dceefddd6a09069187c61ad591562dd5ff78ccd0d91c818fbb1e227896
4
- data.tar.gz: fe2be8a93954216af8d6435bf7250090a86ce8750ddd3eae67ffa25af1fe4615
3
+ metadata.gz: a9ab0725b912eb2b8c7071ed6be16afffe917111c784e82123d1e9f59a6a3313
4
+ data.tar.gz: 8f8fe66bf80e58071898a73f3c51d03e2b61f1019aee9d166a3f36d44f1111e3
5
5
  SHA512:
6
- metadata.gz: 72e96d3be372cf61c2a297005f201411bd36f958daad239bbe0de83afeee0442361188f3ccde712f83fbd9328e51410d0f8dded44a68f6e10a6898483a135266
7
- data.tar.gz: 981a00e8e41c6fe00cc3500305de74e994e6194d177c2037c5ddacd40a098de94b233491cdcf1f945f4277f9e2238b11f7f7c3c277be1946f71dd6f9b0c18a09
6
+ metadata.gz: 3755ab73298b1a5d380ec75a681b3957d9da9b4f6ba84a8e0c401b26966820a090360a750ddb984137a35b40281ba34b6dce7326b9dea83d152d7a682f9e8678
7
+ data.tar.gz: 6bcc224531d945f5b29c2c51579fff19d397e0a06ab54fda44290559b89e9faa616fe0386195b1d53ae6d994e473a74cc7ef52c7905d804885418ff1241c21c7
@@ -8,11 +8,12 @@
8
8
  data-dropzonegem-add-remove-links="hello">
9
9
  <%= f.file_field field.attribute, multiple: field.many?, direct_upload: field.direct?, data: { target: 'dropzonegem.inputdropzonegem' } %>
10
10
  <div class="dropzone-msg dz-message needsclick text-gray-600">
11
- <h3 class="dropzone-msg-title">Drag & Drop here to upload or click here to browse</h3>
11
+ <h3 class="dropzone-msg-title">Drag & Drop ici ou cliquer pour selectionner</h3>
12
12
  <span class="dropzone-msg-desc text-sm">
13
13
  <%= field.drop_max_file_size? %>
14
14
  MB par fichier. Les fichiers autorisés :
15
- <%= field.drop_accepted_files? %>. Un maximum de
15
+ <%= field.drop_accepted_files? %>. <br>
16
+ Un maximum de
16
17
  <%= field.drop_max_file? %> fichiers autorisés.
17
18
  </span>
18
19
  </div>
@@ -11,7 +11,8 @@
11
11
  %>
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
- <%= image_tag(field.variant(attachment, resize_to_limit: image_size),class:'avatar-img rounded delete_on_click') %>
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
16
  <% end %>
16
17
  <% elsif attachment.image? and !field.url_only? %>
17
18
  <%= link_to(field.blob_url(attachment), title: attachment.filename) do %>
@@ -28,7 +28,7 @@ By default, the attribute is rendered as an image tag.
28
28
  <%= render partial: 'fields/active_storage/item',
29
29
  locals: {
30
30
  field: field,
31
- attachment: attachments[0],
31
+ attachment: field.data,
32
32
  image_size: [50, 50]
33
33
  } %>
34
34
  <% end %>
@@ -1,62 +1,35 @@
1
- <%#
2
- # Item Partial
3
-
4
- This partial renders attached items.
5
-
6
- Attachments of type image, video and audio are emedded. For all other types
7
- we try use it's preview. If all else fails we simply link to the attached file.
8
-
9
- This partial will optionally show a `remove` link next to each attachment which is
10
- controlled via a boolean local variable.
11
-
12
- ## Local variables:
13
-
14
- - `field`:
15
- An instance of [Administrate::Field::Image].
16
- A wrapper around the image url pulled from the database.
17
- - `attachment`:
18
- Reference to the file
19
- - `removable`:
20
- A boolean used to control the display of a `Remove` link which
21
- is used to destroy a single attachment. Defaults to `false`
22
- %>
23
- <%
24
- # By default we don't allow attachment removal
25
- removable = local_assigns.fetch(:removable, false)
26
- image_size = local_assigns.fetch(:image_size, [1920, 1080])
27
- %>
1
+ <% removable = local_assigns.fetch(:removable, false)
2
+ image_size = local_assigns.fetch(:image_size, [1920, 1080]) %>
28
3
  <% if attachment.image? and attachment.variable? and !field.url_only? %>
29
- <%#= link_to(field.blob_url(attachment), title: attachment.filename) do %>
30
- <%#= image_tag(field.variant(attachment, resize_to_limit: image_size)) %>
31
- <%= link_to(field.blob_url(attachment), title: attachment.filename, class:'avatar avatar-sm mr-2') do %>
32
- <%= image_tag attachment, class:"avatar-img rounded-circle" %>
33
- <% end %>
34
- <% elsif attachment.image? and !field.url_only? %>
35
- <%= link_to(field.blob_url(attachment), title: attachment.filename) do %>
36
- <%= image_tag(field.url(attachment)) %>
37
- <% end %>
38
- <% elsif attachment.video? and attachment.previewable? and !field.url_only? %> <%# if ffmpeg is installed %>
39
- <%= video_tag(field.url(attachment), poster: field.preview(attachment, resize_to_limit: image_size), controls: true, autobuffer: true, style: "width: 100%; height: auto;") %>
40
- <% elsif attachment.video? and !field.url_only? %>
41
- <%= video_tag(field.url(attachment), controls: true, autobuffer: true, style: "width: 100%; height: auto;") %>
42
- <% elsif attachment.audio? and !field.url_only? %>
43
- <%= audio_tag(field.url(attachment), autoplay: false, controls: true) %>
44
- <% else %>
45
- <%= link_to(field.blob_url(attachment), title: attachment.filename) do %>
46
- <% if attachment.previewable? and !field.url_only? %>
47
- <%= image_tag(field.preview(attachment, resize_to_limit: [595, 842])) %>
48
- <% else %>
49
- <%= attachment.filename %>
50
- <% end %>
4
+ <div class="avatar avatar-lg">
5
+ <%= image_tag attachment.variant(resize: "400x400"), class:"avatar-img rounded" %>
6
+ </div>
7
+ <% elsif attachment.image? and !field.url_only? %>
8
+ <%= link_to(field.blob_url(attachment), title: attachment.filename) do %>
9
+ <%= image_tag(field.url(attachment)) %>
10
+ <% end %>
11
+ <% elsif attachment.video? and attachment.previewable? and !field.url_only? %> <%# if ffmpeg is installed %>
12
+ <%= video_tag(field.url(attachment), poster: field.preview(attachment, resize_to_limit: image_size), controls: true, autobuffer: true, style: "width: 100%; height: auto;") %>
13
+ <% elsif attachment.video? and !field.url_only? %>
14
+ <%= video_tag(field.url(attachment), controls: true, autobuffer: true, style: "width: 100%; height: auto;") %>
15
+ <% elsif attachment.audio? and !field.url_only? %>
16
+ <%= audio_tag(field.url(attachment), autoplay: false, controls: true) %>
17
+ <% else %>
18
+ <%= link_to(field.blob_url(attachment), title: attachment.filename) do %>
19
+ <% if attachment.previewable? and !field.url_only? %>
20
+ <%= image_tag(field.preview(attachment, resize_to_limit: [595, 842])) %>
21
+ <% else %>
22
+ <%= attachment.filename %>
51
23
  <% end %>
52
24
  <% end %>
53
- <% if removable %>
54
- <%#= link_to 'Remove', field.destroy_path(field, attachment), method: :delete, class: 'remove-attachment-link' %>
55
- <%= link_to 'Remove', destroy_url,
25
+ <% end %>
26
+ <% if removable %>
27
+ <%#= link_to 'Remove', field.destroy_path(field, attachment), method: :delete, class: 'remove-attachment-link' %>
28
+ <%= link_to 'Remove', destroy_url,
56
29
  method: :delete,
57
30
  # data: { confirm: t("administrate.actions.confirm") },
58
31
  remote: true,
59
32
  class: 'remove-attachment-link'
60
33
  %>
61
- <hr>
62
- <% end %>
34
+ <hr>
35
+ <% end %>
@@ -15,9 +15,9 @@ By default, the attribute is rendered as an image tag.
15
15
  [1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/Image
16
16
  %>
17
17
  <% if field.attached? %>
18
- <% if field.show_drop_js_on_show? %>
19
- <%= render partial: 'fields/active_storage/items', locals: { field: field } %>
20
- <%else %>
21
- <%= render partial: 'fields/active_storage/items_on_show', locals: { field: field } %>
22
- <% end %>
18
+ <% if field.show_drop_js_on_show? %>
19
+ <%= render partial: 'fields/active_storage/items', locals: { field: field } %>
20
+ <%else %>
21
+ <%= render partial: 'fields/active_storage/items_on_show', locals: { field: field } %>
23
22
  <% end %>
23
+ <% end %>
@@ -20,7 +20,7 @@ module Administrate
20
20
  end
21
21
 
22
22
  def index_display_count?
23
- options.fetch(:index_display_count) { attachments.present? && attachments.count != 1 }
23
+ options.fetch(:index_display_count) { attached? && attachments.count != 1 }
24
24
  end
25
25
 
26
26
  def show_preview_size
@@ -2,7 +2,7 @@ $:.push File.expand_path("../lib", __FILE__)
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = "viniBaxter-field-active_storage"
5
- gem.version = "7.0.0"
5
+ gem.version = "11.0.1"
6
6
  gem.authors = ["viny baxter"]
7
7
  gem.email = ["vincent.viricel@gmail.com"]
8
8
  gem.homepage = "https://github.com/Dreamersoul/administrate-field-active_storage"
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: 7.0.0
4
+ version: 11.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - viny baxter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-30 00:00:00.000000000 Z
11
+ date: 2021-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: administrate