trestle-active_storage 0.0.1 → 2.0.0
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: d7afe155600a65f0a430762dd74d885234377f3f4587c08813f3a7b8ab2ef9e2
|
4
|
+
data.tar.gz: ac66a74dac13db2f3df90b0c30591d135780f0036c9e9923a194045c5ef8074a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9023b24a2bda93e2441cbce24eea0bfe70dc964b5b0702fabb4b33cc1f0aa45c33d22ceca066ffd0ae152a475a63717d76479085432badd376dd7266662a1c44
|
7
|
+
data.tar.gz: b9472272e26f4b3643830247b3ae5e10037aa83a71143a612877e7aaeca1f7d34489a78a752152eba00020b3171092c0e8261dfa6a52f1e6cf43bc07908624cb
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
# Trestle
|
1
|
+
# Trestle Active Storage Integration (trestle-active_storage)
|
2
2
|
|
3
|
-
> [
|
3
|
+
> [Active Storage](https://guides.rubyonrails.org/active_storage_overview.html) integration plugin for the [Trestle admin framework](https://trestle.io)
|
4
|
+
|
5
|
+
[![Gem](https://img.shields.io/gem/v/trestle-active_storage.svg)](https://rubygems.org/gems/trestle-active_storage)
|
4
6
|
|
5
7
|
## Usage
|
6
8
|
|
@@ -31,10 +33,17 @@ gem 'trestle-active_storage'
|
|
31
33
|
|
32
34
|
Run `bundle install`, and then restart your Rails server.
|
33
35
|
|
34
|
-
|
36
|
+
### Active Storage previews
|
37
|
+
|
38
|
+
This plugin shows previews of uploaded files if your system meets the requirements. For more information please [consult the Ruby on Rails guides](https://edgeguides.rubyonrails.org/active_storage_overview.html#previewing-files).
|
39
|
+
|
40
|
+
If you'd like to get up and running on Heroku, check out their [documentation on Active Storage on Heroku](https://devcenter.heroku.com/articles/active-storage-on-heroku#attachment-previews). The [Ruby on Rails Development Dependencies Install guide](https://edgeguides.rubyonrails.org/development_dependencies_install.html#active-storage-setup) outlines how to install the neccessary dependencies to get previews working locally.
|
41
|
+
|
42
|
+
## TODO / Wishlist
|
35
43
|
|
36
44
|
- [ ] Support for `has_many_attached` attachments
|
37
|
-
- [
|
45
|
+
- [x] Support for Active Storage previews
|
46
|
+
- [ ] Preview of selected local file ([#1](https://github.com/richardvenneman/trestle-active_storage/issues/1))
|
38
47
|
- [ ] Integration tests
|
39
48
|
|
40
49
|
## License
|
@@ -1,12 +1,19 @@
|
|
1
1
|
<div class="active-storage">
|
2
2
|
<% if attachment.attached? %>
|
3
3
|
<div class="active-storage__preview">
|
4
|
-
<% if attachment.
|
5
|
-
<%= link_to image_tag(main_app.
|
6
|
-
|
4
|
+
<% if attachment.previewable? %>
|
5
|
+
<%= link_to image_tag(main_app.url_for(attachment.preview(resize: "300x300>")), class: "active-storage__image"),
|
6
|
+
main_app.rails_blob_path(attachment, disposition: "attachment") %>
|
7
|
+
<% elsif attachment.variable? %>
|
8
|
+
<%= link_to image_tag(main_app.url_for(attachment.variant(resize: "300x300>")), class: "active-storage__image"),
|
9
|
+
main_app.rails_blob_path(attachment, disposition: "attachment") %>
|
7
10
|
<% else %>
|
8
|
-
<%= link_to
|
11
|
+
<%= link_to main_app.rails_blob_path(attachment, disposition: "attachment"), class: "btn btn-info" do %>
|
12
|
+
<i class="fa fa-download"></i>
|
13
|
+
<span class="btn-label">Download <%= field_name %></span>
|
14
|
+
<% end %>
|
9
15
|
<% end %>
|
16
|
+
<div><small><%= attachment.blob.filename %></small></div>
|
10
17
|
</div>
|
11
18
|
|
12
19
|
<%= builder.check_box("delete_#{field_name}", label: "Delete #{field_name}") %>
|
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: 0.0
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Venneman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|