viniBaxter-field-active_storage 11.0.1 → 11.0.2

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: a9ab0725b912eb2b8c7071ed6be16afffe917111c784e82123d1e9f59a6a3313
4
- data.tar.gz: 8f8fe66bf80e58071898a73f3c51d03e2b61f1019aee9d166a3f36d44f1111e3
3
+ metadata.gz: 802bc905eb3764bf6a6381745b04f0b923a5d2d0046811c77a66dad259b608c3
4
+ data.tar.gz: bae49a6ab1189985d0124fafba1a25c8c1bc937ca8fcda179f028b8bf7ad00e8
5
5
  SHA512:
6
- metadata.gz: 3755ab73298b1a5d380ec75a681b3957d9da9b4f6ba84a8e0c401b26966820a090360a750ddb984137a35b40281ba34b6dce7326b9dea83d152d7a682f9e8678
7
- data.tar.gz: 6bcc224531d945f5b29c2c51579fff19d397e0a06ab54fda44290559b89e9faa616fe0386195b1d53ae6d994e473a74cc7ef52c7905d804885418ff1241c21c7
6
+ metadata.gz: 6d3d74cceae9dc38f8d572920a9366b1ef849967bc5f3000322b2802d4e45d798fc39929499bb27a96e0e11275296fea3bfb4bc9df5b687a74a236d15caf689b
7
+ data.tar.gz: 9b000bd4799f1ca4cf16a14c5670fe2d1e06f3c88f5da19ee83b5658c6943f77336ff43be7b4e5d8d64c44946418c5f86eff793a9596f48f1cac011f2dccb889
@@ -7,7 +7,7 @@
7
7
  <%
8
8
  # By default we don't allow attachment removal
9
9
  removable = local_assigns.fetch(:removable, false)
10
- image_size = local_assigns.fetch(:image_size, [1920, 1080])
10
+ image_size = local_assigns.fetch(:image_size, [200, 200])
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 %>
@@ -29,7 +29,7 @@ By default, the attribute is rendered as an image tag.
29
29
  locals: {
30
30
  field: field,
31
31
  attachment: field.data,
32
- image_size: [50, 50]
32
+ image_size: [200, 200]
33
33
  } %>
34
34
  <% end %>
35
35
  <% if field.index_display_count? %>
@@ -1,8 +1,8 @@
1
1
  <% removable = local_assigns.fetch(:removable, false)
2
- image_size = local_assigns.fetch(:image_size, [1920, 1080]) %>
2
+ image_size = local_assigns.fetch(:image_size, [200, 200]) %>
3
3
  <% if attachment.image? and attachment.variable? and !field.url_only? %>
4
4
  <div class="avatar avatar-lg">
5
- <%= image_tag attachment.variant(resize: "400x400"), class:"avatar-img rounded" %>
5
+ <%= image_tag attachment.variant(resize_to_limit: image_size), class:"avatar-img rounded"%>
6
6
  </div>
7
7
  <% elsif attachment.image? and !field.url_only? %>
8
8
  <%= link_to(field.blob_url(attachment), title: attachment.filename) do %>
@@ -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 } %>
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 %>
22
23
  <% end %>
23
- <% end %>
@@ -1,5 +1,5 @@
1
- require 'administrate/field/base'
2
- require 'rails'
1
+ require "administrate/field/base"
2
+ require "rails"
3
3
 
4
4
  module Administrate
5
5
  module Field
@@ -7,6 +7,16 @@ module Administrate
7
7
  class Engine < ::Rails::Engine
8
8
  end
9
9
 
10
+ # def store_variant(attachment,image_size)
11
+ # theVariant = @employee_staff
12
+ # .avatar
13
+ # .attachment
14
+ # .variant(resize: '100x100')
15
+ # .processed # If variant is not processed
16
+
17
+ # theVariant.service.send(:path_for, theVariant.key) # Absolute path to variant file
18
+ # end
19
+
10
20
  def url_only?
11
21
  options.fetch(:url_only, false)
12
22
  end
@@ -46,7 +56,7 @@ module Administrate
46
56
  end
47
57
 
48
58
  def drop_max_file?
49
- options.fetch(:drop_max_file, many? == true ? 10 : 1)
59
+ options.fetch(:drop_max_file, many? == true ? 10 : 1)
50
60
  end
51
61
 
52
62
  def drop_max_file_size?
@@ -96,7 +106,7 @@ module Administrate
96
106
  destroy_path_helper = options.fetch(:destroy_path)
97
107
  record_id = field.data.record.id
98
108
  attachment_id = attachment.id
99
- Rails.application.routes.url_helpers.send(destroy_path_helper, {:record_id => record_id, :attachment_id => attachment_id})
109
+ Rails.application.routes.url_helpers.send(destroy_path_helper, { :record_id => record_id, :attachment_id => attachment_id })
100
110
  end
101
111
 
102
112
  # delegate :attached?, to: :data
@@ -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 = "11.0.1"
5
+ gem.version = "11.0.2"
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: 11.0.1
4
+ version: 11.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - viny baxter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-05 00:00:00.000000000 Z
11
+ date: 2021-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: administrate