administrate-field-active_storage 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.ruby-version +1 -0
- data/administrate-field-active_storage.gemspec +2 -2
- data/app/views/fields/active_storage/_form.html.erb +1 -1
- data/app/views/fields/active_storage/_index.html.erb +1 -1
- data/app/views/fields/active_storage/_item.html.erb +4 -4
- data/contribute.md +3 -1
- data/lib/administrate/field/active_storage.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5a1843a0c5df0b671282ec4c77f631d13449509a6cec6cf045080969a020b5eb
|
4
|
+
data.tar.gz: acbc64571121abbf5da1f154e7c104a657aa21c1ecee607f9c183616fa4723c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35d06be4c51b39db656b97560c9a4b62fb058927f376c44bc8eb931d2ba23d9e309342c358905f34aa0a45617bece357376f7d076bc84386068afa396e337b9a
|
7
|
+
data.tar.gz: f99b2d49769516204e9ce38a290abcfb50365a59f3a1df00a33b3753cbd9853894458fc58dac3991e10377c6bf26eb1ba2917d7d063847fc2cb9106ddbf2f525
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.6.3
|
@@ -2,7 +2,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = "administrate-field-active_storage"
|
5
|
-
gem.version = "0.2.
|
5
|
+
gem.version = "0.2.1"
|
6
6
|
gem.authors = ["Hamad AlGhanim"]
|
7
7
|
gem.email = ["hamadyalghanim@gmail.com"]
|
8
8
|
gem.homepage = "https://github.com/Dreamersoul/administrate-field-active_storage"
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.files = `git ls-files`.split("\n")
|
15
15
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
16
|
|
17
|
-
gem.add_dependency "administrate", ">= 0.2.
|
17
|
+
gem.add_dependency "administrate", ">= 0.2.2"
|
18
18
|
gem.add_dependency "rails", ">= 6.0"
|
19
19
|
|
20
20
|
gem.add_development_dependency "rspec", "~> 3.4"
|
@@ -20,7 +20,7 @@ By default, the input is a text field for the image's URL.
|
|
20
20
|
</div>
|
21
21
|
|
22
22
|
<div class="field-unit__field">
|
23
|
-
<% if field.attached? %>
|
23
|
+
<% if field.data.present? && field.attached? %>
|
24
24
|
<%= render partial: 'fields/active_storage/items', locals: { field: field, removable: field.destroyable? } %>
|
25
25
|
<br />
|
26
26
|
Add:
|
@@ -24,7 +24,7 @@ By default, the attribute is rendered as an image tag.
|
|
24
24
|
%>
|
25
25
|
<% if field.attached? %>
|
26
26
|
<% if field.show_in_index? %>
|
27
|
-
<%= render partial: 'fields/active_storage/item', locals: { field: field, attachment: attachments[0], image_size:
|
27
|
+
<%= render partial: 'fields/active_storage/item', locals: { field: field, attachment: attachments[0], image_size: [250, 250] } %>
|
28
28
|
<% end %>
|
29
29
|
<%= pluralize(attachments.count, 'Attached file') %>
|
30
30
|
<% else %>
|
@@ -24,19 +24,19 @@ controlled via a boolean local variable.
|
|
24
24
|
<%
|
25
25
|
# By default we don't allow attachment removal
|
26
26
|
removable = local_assigns.fetch(:removable, false)
|
27
|
-
image_size = local_assigns.fetch(:image_size,
|
27
|
+
image_size = local_assigns.fetch(:image_size, [1920, 1080])
|
28
28
|
%>
|
29
29
|
|
30
30
|
<% if attachment.image? and !field.url_only? %>
|
31
|
-
<%= image_tag(field.variant(attachment,
|
31
|
+
<%= image_tag(field.variant(attachment, resize_to_limit: image_size)) %>
|
32
32
|
<% elsif attachment.video? and attachment.previewable? and !field.url_only? %> <%# if ffmpeg is installed %>
|
33
|
-
<%= video_tag(field.url(attachment), poster: field.preview(attachment,
|
33
|
+
<%= video_tag(field.url(attachment), poster: field.preview(attachment, resize_to_limit: image_size), controls: true, autobuffer: true, style: "width: 100%; height: auto;") %>
|
34
34
|
<% elsif attachment.video? and !field.url_only? %>
|
35
35
|
<%= video_tag(field.url(attachment), controls: true, autobuffer: true, style: "width: 100%; height: auto;") %>
|
36
36
|
<% elsif attachment.audio? and !field.url_only? %>
|
37
37
|
<%= audio_tag(field.url(attachment), autoplay: false, controls: true) %>
|
38
38
|
<% elsif attachment.previewable? and !field.url_only? %>
|
39
|
-
<%= image_tag(field.preview(attachment,
|
39
|
+
<%= image_tag(field.preview(attachment, resize_to_limit: [595, 842])) %>
|
40
40
|
<br/>
|
41
41
|
Download: <%= link_to(attachment.filename, field.blob_url(attachment)) %>
|
42
42
|
<% else %>
|
data/contribute.md
CHANGED
@@ -6,4 +6,6 @@
|
|
6
6
|
- Kadu Diógenes [@cerdiogenes](https://github.com/cerdiogenes)
|
7
7
|
- Peter Bhat Harkins [@pushcx](https://github.com/pushcx)
|
8
8
|
- Delta Purna Widyangga [@deltapurna](https://github.com/deltapurna)
|
9
|
-
- Joé Dupuis [@twistedjoe](https://github.com/twistedjoe)
|
9
|
+
- Joé Dupuis [@twistedjoe](https://github.com/twistedjoe)
|
10
|
+
- Eugeny Khlopin [@evgeniy-khlopin](https://github.com/evgeniy-khlopin)
|
11
|
+
- Daniel Tinoco [@0urobor0s](https://github.com/0urobor0s)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: administrate-field-active_storage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hamad AlGhanim
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: administrate
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.2.
|
19
|
+
version: 0.2.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.2.
|
26
|
+
version: 0.2.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,6 +60,7 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
|
+
- ".ruby-version"
|
63
64
|
- Gemfile
|
64
65
|
- LICENSE
|
65
66
|
- README.md
|
@@ -181,8 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
182
|
- !ruby/object:Gem::Version
|
182
183
|
version: '0'
|
183
184
|
requirements: []
|
184
|
-
|
185
|
-
rubygems_version: 2.6.11
|
185
|
+
rubygems_version: 3.0.3
|
186
186
|
signing_key:
|
187
187
|
specification_version: 4
|
188
188
|
summary: Administrate fields for active storage
|