activeadmin_file_input_on_steroids 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/README.md +18 -2
- data/app/admin/inputs/file_input.rb +6 -2
- data/lib/activeadmin_file_input_on_steroids/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MWM5NTEyOTk0MWYzZjZkY2M4OTg5MGViOTQyYzE1NzExMTlhZTYxMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZWZmNTFhMGU4ODc2Yzg1Nzg4NDdjMGQ3MTc4NWNkOTFhOTBkMjI5OQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjUzYWQ3YTJhZDRhYWY2YjdhNmMzMjM4MjVhMGJlZjBhZGE2OWZlNmZlOGQz
|
10
|
+
ODI2MjM1ZDZiMTBiNTczNzIwOTNiY2ZmZTBlYjlkMmY0MTEzNDJkZGQxZjU0
|
11
|
+
ZTY3ZmFmNDdlNzgyZjA4MWQ2OTMzZTgzYTBiMzM3NjhkZDE4ODg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTUxOTgzNGIxOWU4OTE4MWE1NmJhY2I0ZGNjMDEyOGE5OGVjZTc2NGZiMWJl
|
14
|
+
Yzg3YWVjMDhkZDQyZDBjYTMxN2M4MzBmZTMyODEzZDc5OTgxMmYxYmJjMTlh
|
15
|
+
ZmVmYTgwOTc5NWYzYThlNDdkNGJmZTUwN2IzZjhlZjIwMjhiMjQ=
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# ActiveadminFileInputOnSteroids
|
2
2
|
|
3
|
-
|
3
|
+
This gem adds 2 functionalities to the file input field. Image preview and a size hint based on paperclip styles.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -18,7 +18,23 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
Include javascript to your active_admin.js file.
|
22
|
+
|
23
|
+
```javascript
|
24
|
+
//= require activeadmin_file_input_on_steroids
|
25
|
+
```
|
26
|
+
|
27
|
+
Include the css to your active_admin.css.scss
|
28
|
+
```css
|
29
|
+
@import "activeadmin_file_input_on_steroids";
|
30
|
+
```
|
31
|
+
|
32
|
+
Now, when in your forms, when you create a file input, you have 2 new options, image_preview and size_hint.
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
f.input :photo, image_preview: true, size_hint: true
|
36
|
+
```
|
37
|
+
|
22
38
|
|
23
39
|
## Contributing
|
24
40
|
|
@@ -39,7 +39,11 @@ class FileInput < Formtastic::Inputs::FileInput
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def size_hint_html
|
42
|
-
|
43
|
-
|
42
|
+
if size_hint?
|
43
|
+
template.content_tag(:p, 'Tamanhos gerados automaticamente (redimensiona, centraliza e corta) através da imagem selecionada:', class: 'size-hint-text inline-hints') +
|
44
|
+
template.content_tag(:p, size_hint_text, class: 'size-hint-text inline-hints')
|
45
|
+
else
|
46
|
+
nil
|
47
|
+
end
|
44
48
|
end
|
45
49
|
end
|