simple_form_bs5_file_input 0.0.5 → 0.0.6
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b00aca895432b5130fad571666763a588ed10615d80319ae50a797eac704031
|
4
|
+
data.tar.gz: 167cc07867256c4b1bf2043578b9cd158a4b9356982eef823e54c7cf48e39d3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06acfb0828ebe32f582004073ca34c8d9a136d7dad56f1da3ea22909fd591d70184a6e05415313bb12c8b7fcffe84033700d14906ccfe06044afe384dce17dcb
|
7
|
+
data.tar.gz: 6d243229507b7e0fdee145b2c3d156c7d6aaefb3b3628b51d7a4537a5ba76fd113c2bfd4b47222a8e451a08242925966d7639a8b623778aa9f2c28f364b4a70c
|
data/Gemfile.lock
CHANGED
@@ -52,9 +52,7 @@ class SingleDeletableFileInput < SimpleForm::Inputs::Base
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def existing_file_name_or_default_text
|
55
|
-
if should_display_file?
|
56
|
-
"#{file_attachment.filename}"
|
57
|
-
end
|
55
|
+
"#{file_attachment.filename}" if should_display_file?
|
58
56
|
end
|
59
57
|
|
60
58
|
def input_delete_name
|
@@ -122,7 +120,10 @@ class SingleDeletableFileInput < SimpleForm::Inputs::Base
|
|
122
120
|
end
|
123
121
|
|
124
122
|
def preview_image_tag
|
125
|
-
|
123
|
+
# Pas de fichier, pas de chocolat
|
124
|
+
return unless should_display_file?
|
125
|
+
# Fichier invariable, pas de chocolat non plus
|
126
|
+
return unless file_attachment&.variable?
|
126
127
|
variant = file_attachment.variant(resize: "#{preview_image_width}x")
|
127
128
|
path = url_helpers.polymorphic_url variant, only_path: true
|
128
129
|
image_tag path, class: 'img-fluid img-thumbnail', width: preview_image_width
|