viniBaxter-field-active_storage 11.0.1 → 11.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/fields/active_storage/_dropjs_list_edit.html.erb +1 -1
- data/app/views/fields/active_storage/_index.html.erb +1 -1
- data/app/views/fields/active_storage/_item.html.erb +2 -2
- data/app/views/fields/active_storage/_show.html.erb +5 -5
- data/lib/viniBaxter/field/active_storage.rb +14 -4
- data/viniBaxter-field-active_storage.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 802bc905eb3764bf6a6381745b04f0b923a5d2d0046811c77a66dad259b608c3
|
4
|
+
data.tar.gz: bae49a6ab1189985d0124fafba1a25c8c1bc937ca8fcda179f028b8bf7ad00e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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, [
|
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 %>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<% removable = local_assigns.fetch(:removable, false)
|
2
|
-
image_size = local_assigns.fetch(:image_size, [
|
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(
|
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
|
2
|
-
require
|
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 ?
|
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.
|
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.
|
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-
|
11
|
+
date: 2021-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: administrate
|