viniBaxter-field-active_storage 300.0.4 → 300.0.11
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
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e735bbcfeb7e7bea423eafdb4982520f4a83c9b80095f6bbadc567ea0835d0fd
|
4
|
+
data.tar.gz: a61da509f009e79fa912bf67b82cd16fc35adbd9acae9650044252b876fae812
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afa17bb2624b562d0ad58a85d86b77b09700c094b2a684c2ddc5872c63cbc6c8ea6ac62c9ef7d6c1dd466a6534bc775f03d64549949cf4d2a4a79d4866d76930
|
7
|
+
data.tar.gz: f3f66ddc74dace8ad052a3259786d264e1dfae45b1683e2bd0e8c938baceb7198a98596d63c76e99f4e8eb404f845056e9c46cfb0259258337ae0fbb170614d4
|
@@ -13,8 +13,13 @@
|
|
13
13
|
<%= field.drop_max_file_size? %>
|
14
14
|
MB par fichier. Les fichiers autorisés :
|
15
15
|
<%= field.drop_accepted_files? %>. <br>
|
16
|
-
|
17
|
-
|
16
|
+
<% if field.many? %>
|
17
|
+
A maximum of <%= field.drop_max_file? %> files allowed for eacch creatiion or edition. <br>
|
18
|
+
Want more assets? Save it and edit it again and add <%= field.drop_max_file? %> extras assets.
|
19
|
+
<% else %>
|
20
|
+
A maximum of <%= field.drop_max_file? %> files allowed for eacch creatiion or edition. <br>
|
21
|
+
I case of edition, the previous asset will be deleted only <%= field.drop_max_file? %> allowed.
|
22
|
+
<% end %>
|
18
23
|
</span>
|
19
24
|
</div>
|
20
25
|
<div id="tpl" style='display:none'>
|
@@ -1,10 +1,3 @@
|
|
1
|
-
<style type="text/css" nonce="<%= content_security_policy_nonce %>">
|
2
|
-
#as-field-<%= attachment.id %> {
|
3
|
-
width: <%=size[0]/2%>px;
|
4
|
-
height: auto;
|
5
|
-
overflow: hidden;
|
6
|
-
}
|
7
|
-
</style>
|
8
1
|
<div id="as-field-<%= attachment.id %>">
|
9
2
|
<% if attachment.image? %>
|
10
3
|
<% if attachment.variable? %>
|
@@ -22,13 +22,17 @@ module Administrate
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def index_preview_size
|
25
|
-
options.fetch(:index_preview_size, [
|
25
|
+
options.fetch(:index_preview_size, [10, 10])
|
26
26
|
end
|
27
27
|
|
28
28
|
def show_display_preview?
|
29
29
|
options.fetch(:show_display_preview, true)
|
30
30
|
end
|
31
31
|
|
32
|
+
def show_preview_size
|
33
|
+
options.fetch(:show_preview_size, [200, 200])
|
34
|
+
end
|
35
|
+
|
32
36
|
def url_only?
|
33
37
|
options.fetch(:url_only, false)
|
34
38
|
end
|
@@ -45,10 +49,6 @@ module Administrate
|
|
45
49
|
options.fetch(:index_display_count) { attached? && attachments.count != 1 }
|
46
50
|
end
|
47
51
|
|
48
|
-
def show_preview_size
|
49
|
-
options.fetch(:show_preview_size, [800, 800])
|
50
|
-
end
|
51
|
-
|
52
52
|
def many?
|
53
53
|
# find a way to use instance_of
|
54
54
|
# data.class.name == 'ActiveStorage::Attached::Many'
|
@@ -59,44 +59,17 @@ module Administrate
|
|
59
59
|
options.fetch(:direct_upload, false)
|
60
60
|
end
|
61
61
|
|
62
|
-
def drop_js?
|
63
|
-
options.fetch(:drop_js, false)
|
64
|
-
end
|
65
|
-
|
66
|
-
def show_drop_js_on_show?
|
67
|
-
options.fetch(:show_drop_js_on_show, false)
|
68
|
-
end
|
69
|
-
|
70
|
-
def sweety_show_drop_js_on_show?
|
71
|
-
options.fetch(:sweety_show_drop_js_on_show, false)
|
72
|
-
end
|
73
|
-
|
74
|
-
def drop_max_file?
|
75
|
-
options.fetch(:drop_max_file, many? == true ? 10 : 1)
|
76
|
-
end
|
77
|
-
|
78
|
-
def drop_max_file_size?
|
79
|
-
options.fetch(:drop_max_file_size, 10)
|
80
|
-
end
|
81
|
-
|
82
|
-
def drop_accepted_files?
|
83
|
-
options.fetch(:drop_accepted_files, ".jpeg,.jpg,.png,.gif,.svg")
|
84
|
-
end
|
85
|
-
|
86
62
|
def destroy_url
|
87
63
|
options.fetch(:destroy_url, nil)
|
88
64
|
end
|
89
65
|
|
90
|
-
# def destroy_path?
|
91
|
-
# options.fetch(:destroy_path, false).present?
|
92
|
-
# end
|
93
|
-
|
94
66
|
# currently we are using Rails.application.routes.url_helpers
|
95
67
|
# without including the namespace because it runs into an
|
96
68
|
# exception
|
97
69
|
|
98
70
|
# work around since calling data.preview(options)
|
99
71
|
# returns "/images/<ActiveStorage::Preview>" which isnt the url
|
72
|
+
|
100
73
|
def preview(attachment, options)
|
101
74
|
Rails.application.routes.url_helpers.rails_representation_path(attachment.preview(options), only_path: true)
|
102
75
|
end
|
@@ -134,6 +107,35 @@ module Administrate
|
|
134
107
|
def attachments
|
135
108
|
data.attachments if attached?
|
136
109
|
end
|
110
|
+
|
111
|
+
# drop js
|
112
|
+
|
113
|
+
def drop_js?
|
114
|
+
options.fetch(:drop_js, false)
|
115
|
+
end
|
116
|
+
|
117
|
+
def show_drop_js_on_show?
|
118
|
+
options.fetch(:show_drop_js_on_show, false)
|
119
|
+
end
|
120
|
+
|
121
|
+
def sweety_show_drop_js_on_show?
|
122
|
+
options.fetch(:sweety_show_drop_js_on_show, false)
|
123
|
+
end
|
124
|
+
|
125
|
+
def drop_max_file?
|
126
|
+
options.fetch(:drop_max_file, many? == true ? 20 : 1)
|
127
|
+
end
|
128
|
+
|
129
|
+
def drop_max_file_size?
|
130
|
+
options.fetch(:drop_max_file_size, 50)
|
131
|
+
end
|
132
|
+
|
133
|
+
def drop_accepted_files?
|
134
|
+
options.fetch(:drop_accepted_files, ".jpeg,.jpg,.png,.svg,.gif,.pdf,.mov")
|
135
|
+
end
|
136
|
+
|
137
|
+
# end of drop js
|
138
|
+
|
137
139
|
end
|
138
140
|
end
|
139
141
|
end
|
data/lib/viniBaxter/version.rb
CHANGED
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: 300.0.
|
4
|
+
version: 300.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- viny baxter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: administrate
|