viniBaxter-field-active_storage 10.0.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4018cea70716ea34f35730034c9241b9b257c761a470d8f14ea2652119ccac56
|
|
4
|
+
data.tar.gz: '0210695e00450cf472c4c5f8801de08edb2f5c9c3e9b87ee31f4cbce1fb6bb0d'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: db186bd01fbc1247df46398df490eeef8dcb437c8bde7c70f1e07e155cf32c501187182ad732c78b46572e14739e33c82a01787d3c3dca4e1abb7eb5db042151
|
|
7
|
+
data.tar.gz: 15c1883a254ef214cce4c05092462a8f810ea6f144995e709744f90a7ac8ded3e197ac7c1b280bfbbb667a0281ba42411c8d95354f332eeba23557e7a7b183ae
|
|
@@ -1,69 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<%= image_tag(field.preview(attachment, resize_to_limit: [595, 842])) %>
|
|
55
|
-
<% else %>
|
|
56
|
-
<%= attachment.filename %>
|
|
57
|
-
<% end %>
|
|
58
|
-
<% end %>
|
|
59
|
-
<% end %>
|
|
60
|
-
<% if removable %>
|
|
61
|
-
<%#= link_to 'Remove', field.destroy_path(field, attachment), method: :delete, class: 'remove-attachment-link' %>
|
|
62
|
-
<%= link_to 'Remove', destroy_url,
|
|
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 %>
|
|
23
|
+
<% end %>
|
|
24
|
+
<% end %>
|
|
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,
|
|
63
29
|
method: :delete,
|
|
64
30
|
# data: { confirm: t("administrate.actions.confirm") },
|
|
65
31
|
remote: true,
|
|
66
32
|
class: 'remove-attachment-link'
|
|
67
33
|
%>
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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 %>
|
|
@@ -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 = "
|
|
5
|
+
gem.version = "11.0.0"
|
|
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:
|
|
4
|
+
version: 11.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- viny baxter
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-03-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: administrate
|