trestle-active_storage 2.1.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -3
- data/app/views/trestle/active_storage/_has_many_field.html.erb +10 -12
- data/app/views/trestle/active_storage/_has_one_field.html.erb +1 -1
- data/lib/trestle/active_storage.rb +7 -6
- data/lib/trestle/active_storage/engine.rb +4 -1
- data/lib/trestle/active_storage/version.rb +1 -1
- metadata +13 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 659e5f87dc5831589e18e8f1720f615a2449d6e41a5a68a9355dc15049683bb4
|
4
|
+
data.tar.gz: 77bb915b65b473bdf8696e49518c15fe5d6e4806983015ae2336c83de5d225e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf8a035c55e8354891799b1d349798f551e59ff2d00f89e8471ec4c2d733befcaf7a0a288b1f60aa9cee203d303062545558963e21681c9cde7390dc2e0acdc2
|
7
|
+
data.tar.gz: 98878aeb47816a6ed4e311bf9e0bd0dc76fda5fecf4504c9c5d2c0ca2b4cbb9b5f5db41cd3a870ffaeecfe0ef58240049a2df430e405bdd0422a3724f3594254
|
data/README.md
CHANGED
@@ -50,9 +50,25 @@ If you'd like to get up and running on Heroku, check out their [documentation on
|
|
50
50
|
|
51
51
|
## Contributors
|
52
52
|
|
53
|
-
|
54
|
-
|
55
|
-
|
53
|
+
Thanks goes out to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
54
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
55
|
+
<!-- prettier-ignore-start -->
|
56
|
+
<!-- markdownlint-disable -->
|
57
|
+
<table>
|
58
|
+
<tr>
|
59
|
+
<td align="center"><a href="https://www.cityspotters.com"><img src="https://avatars1.githubusercontent.com/u/75705?v=4" width="100px;" alt=""/><br /><sub><b>Richard Venneman</b></sub></a><br /><a href="#ideas-richardvenneman" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/richardvenneman/trestle-active_storage/commits?author=richardvenneman" title="Code">💻</a> <a href="https://github.com/richardvenneman/trestle-active_storage/commits?author=richardvenneman" title="Documentation">📖</a> <a href="#question-richardvenneman" title="Answering Questions">💬</a> <a href="https://github.com/richardvenneman/trestle-active_storage/pulls?q=is%3Apr+reviewed-by%3Arichardvenneman" title="Reviewed Pull Requests">👀</a></td>
|
60
|
+
<td align="center"><a href="http://aboobacker.in"><img src="https://avatars1.githubusercontent.com/u/3112976?v=4" width="100px;" alt=""/><br /><sub><b>Aboobacker MK</b></sub></a><br /><a href="#ideas-tachyons" title="Ideas, Planning, & Feedback">🤔</a></td>
|
61
|
+
<td align="center"><a href="http://euodeiovoce.com.br"><img src="https://avatars2.githubusercontent.com/u/1027961?v=4" width="100px;" alt=""/><br /><sub><b>Rafael Porto</b></sub></a><br /><a href="https://github.com/richardvenneman/trestle-active_storage/commits?author=PunkMaldito" title="Code">💻</a></td>
|
62
|
+
<td align="center"><a href="https://github.com/hoenth"><img src="https://avatars2.githubusercontent.com/u/62977?v=4" width="100px;" alt=""/><br /><sub><b>Tom Hoen</b></sub></a><br /><a href="https://github.com/richardvenneman/trestle-active_storage/issues?q=author%3Ahoenth" title="Bug reports">🐛</a> <a href="https://github.com/richardvenneman/trestle-active_storage/commits?author=hoenth" title="Code">💻</a></td>
|
63
|
+
<td align="center"><a href="https://github.com/basharabdullah"><img src="https://avatars3.githubusercontent.com/u/167290?v=4" width="100px;" alt=""/><br /><sub><b>Bashar Abdullah</b></sub></a><br /><a href="https://github.com/richardvenneman/trestle-active_storage/issues?q=author%3Abasharabdullah" title="Bug reports">🐛</a></td>
|
64
|
+
<td align="center"><a href="https://github.com/McRipper"><img src="https://avatars2.githubusercontent.com/u/58031?v=4" width="100px;" alt=""/><br /><sub><b>Emanuele Barban</b></sub></a><br /><a href="https://github.com/richardvenneman/trestle-active_storage/commits?author=McRipper" title="Code">💻</a></td>
|
65
|
+
<td align="center"><a href="https://github.com/oleg-kiviljov"><img src="https://avatars3.githubusercontent.com/u/10065250?v=4" width="100px;" alt=""/><br /><sub><b>Oleg Kiviljov</b></sub></a><br /><a href="https://github.com/richardvenneman/trestle-active_storage/issues?q=author%3Aoleg-kiviljov" title="Bug reports">🐛</a> <a href="https://github.com/richardvenneman/trestle-active_storage/commits?author=oleg-kiviljov" title="Code">💻</a></td>
|
66
|
+
</tr>
|
67
|
+
</table>
|
68
|
+
|
69
|
+
<!-- markdownlint-enable -->
|
70
|
+
<!-- prettier-ignore-end -->
|
71
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
56
72
|
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification.
|
57
73
|
|
58
74
|
## License
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<div class='nested-fields-container'>
|
2
|
-
<%= builder.fields_for
|
2
|
+
<%= builder.fields_for field_name do %>
|
3
3
|
<div class="active-storage">
|
4
|
-
<% if attachments.attached? %>
|
4
|
+
<% if attachments.attached? && builder.object.persisted? %>
|
5
5
|
<% attachments.each do |attachment| %>
|
6
6
|
<div class="active-storage__preview">
|
7
7
|
<% if attachment.previewable? %>
|
@@ -10,17 +10,18 @@
|
|
10
10
|
<% elsif attachment.variable? %>
|
11
11
|
<%= link_to image_tag(main_app.url_for(attachment.variant(resize: "300x300>")), class: "active-storage__image"),
|
12
12
|
main_app.rails_blob_path(attachment, disposition: "attachment") %>
|
13
|
-
<%
|
13
|
+
<% elsif attachment.persisted? %>
|
14
14
|
<%= link_to main_app.rails_blob_path(attachment, disposition: "attachment"), class: "btn btn-info" do %>
|
15
15
|
<i class="fa fa-download"></i>
|
16
16
|
<span class="btn-label">Download <%= field_name %></span>
|
17
17
|
<% end %>
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
<div>
|
19
|
+
<small><%= attachment.blob.filename %></small>
|
20
|
+
<%= builder.check_box("delete_#{field_name}_#{attachment.blob_id}", label: "Delete this #{field_name.to_s.singularize}") %>
|
21
|
+
</div>
|
22
|
+
<% else %>
|
21
23
|
<small><%= attachment.blob.filename %></small>
|
22
|
-
|
23
|
-
</div>
|
24
|
+
<% end %>
|
24
25
|
</div>
|
25
26
|
<hr>
|
26
27
|
<% end %>
|
@@ -29,7 +30,4 @@
|
|
29
30
|
|
30
31
|
<%= builder.raw_file_field(field_name, class: 'active-storage__field', multiple: true, direct_upload: true) %>
|
31
32
|
<% end %>
|
32
|
-
</div>
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
</div>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div class="active-storage">
|
2
|
-
<% if attachment.attached? %>
|
2
|
+
<% if attachment.attached? && builder.object.persisted? %>
|
3
3
|
<div class="active-storage__preview">
|
4
4
|
<% if attachment.previewable? %>
|
5
5
|
<%= link_to image_tag(main_app.url_for(attachment.preview(resize: "300x300>")), class: "active-storage__image"),
|
@@ -1,14 +1,15 @@
|
|
1
|
-
|
1
|
+
require_relative 'active_storage/version'
|
2
|
+
|
2
3
|
require 'trestle'
|
3
4
|
|
4
5
|
module Trestle
|
5
6
|
module ActiveStorage
|
6
|
-
extend ActiveSupport::Autoload
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
require_relative "active_storage/builder"
|
9
|
+
require_relative "active_storage/resource"
|
10
|
+
require_relative "active_storage/controller_concern"
|
11
|
+
|
11
12
|
end
|
12
13
|
end
|
13
14
|
|
14
|
-
|
15
|
+
require_relative 'active_storage/engine' if defined?(Rails)
|
@@ -3,10 +3,13 @@ module Trestle
|
|
3
3
|
class Engine < Rails::Engine
|
4
4
|
config.assets.precompile << 'activestorage.js' << 'trestle/active_storage_fields.js'
|
5
5
|
|
6
|
+
config.to_prepare do
|
7
|
+
Trestle::ResourceController.send(:include, Trestle::ActiveStorage::ControllerConcern)
|
8
|
+
end
|
9
|
+
|
6
10
|
initializer :extensions do
|
7
11
|
Trestle::Resource.send(:include, Trestle::ActiveStorage::Resource)
|
8
12
|
Trestle::Resource::Builder.send(:include, Trestle::ActiveStorage::Builder)
|
9
|
-
Trestle::Resource::Controller.send(:include, Trestle::ActiveStorage::ControllerConcern)
|
10
13
|
end
|
11
14
|
end
|
12
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trestle-active_storage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Venneman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '5.2'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '7'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,21 +29,27 @@ dependencies:
|
|
29
29
|
version: '5.2'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '7'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: trestle
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
39
|
+
version: 0.9.0
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 0.9.3
|
40
43
|
type: :runtime
|
41
44
|
prerelease: false
|
42
45
|
version_requirements: !ruby/object:Gem::Requirement
|
43
46
|
requirements:
|
44
47
|
- - "~>"
|
45
48
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
49
|
+
version: 0.9.0
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 0.9.3
|
47
53
|
description: ActiveStorage integration plugin for the Trestle admin framework.
|
48
54
|
email:
|
49
55
|
- richardvenneman@me.com
|
@@ -85,8 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
91
|
- !ruby/object:Gem::Version
|
86
92
|
version: '0'
|
87
93
|
requirements: []
|
88
|
-
|
89
|
-
rubygems_version: 2.7.3
|
94
|
+
rubygems_version: 3.1.2
|
90
95
|
signing_key:
|
91
96
|
specification_version: 4
|
92
97
|
summary: ActiveStorage integration plugin for the Trestle admin framework
|