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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 57d53cbf7fd058bc848872af98bc525b48953bb4
4
- data.tar.gz: 6ab055be84a476e663bb5d4bac0d56925c54f757
2
+ SHA256:
3
+ metadata.gz: 5a1843a0c5df0b671282ec4c77f631d13449509a6cec6cf045080969a020b5eb
4
+ data.tar.gz: acbc64571121abbf5da1f154e7c104a657aa21c1ecee607f9c183616fa4723c4
5
5
  SHA512:
6
- metadata.gz: 874a4e1448d5413053290bac0763085fbeb55e023f6c814720916a8c86dffdc78dd72601ebeb8abcd2becb310421f912bd79431c428c743da606831281ee3104
7
- data.tar.gz: c04fe4c6bbd05c8240cb462b8b733b034d689ac2236ae40612e1cf9a89352b91bd279170809c105d09fc86a9623e1224736978b5c69bc998f65f0c909d37302e
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.0"
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.0.rc1"
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: "250x250>" } %>
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, "1920x1080>")
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, resize: image_size)) %>
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, resize: image_size), controls: true, autobuffer: true, style: "width: 100%; height: auto;") %>
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, resize: "595x842>")) %>
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)
@@ -20,7 +20,7 @@ module Administrate
20
20
  end
21
21
 
22
22
  def show_preview_size
23
- options.fetch(:show_preview_size, "1080x1920>")
23
+ options.fetch(:show_preview_size, [1080, 1920])
24
24
  end
25
25
 
26
26
  def many?
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.0
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-09-07 00:00:00.000000000 Z
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.0.rc1
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.0.rc1
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
- rubyforge_project:
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