-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
db044ab
commit 5f53ad5
Showing
6 changed files
with
98 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,52 @@ | ||
# Administrate::Field::ActiveStorage | ||
![rails](https://img.shields.io/badge/rails-%3E%3D5.2.0-red.svg) | ||
## Things to do: | ||
|
||
- [ ] upload single file | ||
- [ ] adding image support through url_for to support 3rd party cloud storage | ||
- [ ] use html 5 video element for video files | ||
- [ ] use html audio element for audio files | ||
- [ ] download link to other files | ||
- [ ] preview pdfs and office files as pictures | ||
## Things To Know: | ||
- to preview pdf files you need to install `mupdf` or `Poppler` | ||
- to preview video files you need to install `ffmpeg` | ||
|
||
## How To Use: | ||
Add `administrate-field-active_storage` to your Gemfile: | ||
|
||
```ruby | ||
gem 'administrate-field-active_storage' | ||
``` | ||
|
||
Install: | ||
|
||
``` | ||
$ bundle install | ||
``` | ||
|
||
Use: | ||
assuming your modelname is `Model` and field name is `attachment` | ||
```ruby | ||
class ModelDashboard < Administrate::BaseDashboard | ||
ATTRIBUTE_TYPES = { | ||
attachment: Field::ActiveStorage, | ||
} | ||
# ... | ||
``` | ||
Then add `:attachment` to `FORM_ATTRIBUTES` and `SHOW_PAGE_ATTRIBUTES`. | ||
currently adding `:attachment` `COLLECTION_ATTRIBUTES` will work but will probably look too big. | ||
|
||
## Things To Do: | ||
|
||
- [x] upload single file | ||
- [x] adding image support through url_for to support 3rd party cloud storage | ||
- [x] use html 5 video element for video files | ||
- [x] use html audio element for audio files | ||
- [x] download link to other files | ||
- [x] preview videos | ||
- [x] preview pdfs | ||
- [ ] preview office files as pictures | ||
- [ ] upload multiple files | ||
|
||
## Contribution guide: | ||
1. contributers are welcome (code, suggestions, and bugs). | ||
2. please document your code. | ||
3. add your name to the `contribute.md`. | ||
|
||
please note that this is my first gem :) i might have gotten some stuff wrong PR's are always welcome | ||
--- | ||
Based on the [Administrate::Field::Image](https://github.com/thoughtbot/administrate-field-image) template. | ||
Based on the [Administrate::Field::Image](https://github.com/thoughtbot/administrate-field-image) template, and inspired by [Administrate::Field::Paperclip](https://github.com/picandocodigo/administrate-field-paperclip). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ $:.push File.expand_path("../lib", __FILE__) | |
|
||
Gem::Specification.new do |gem| | ||
gem.name = "administrate-field-active_storage" | ||
gem.version = "0.0.1" | ||
gem.version = "0.0.2" | ||
gem.authors = ["Hamad AlGhanim"] | ||
gem.email = ["[email protected]"] | ||
gem.homepage = "https://github.com/Dreamersoul/administrate-field-active_storage" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters