simple_form_bs5_file_input 0.0.5 → 0.0.6

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: ce2c3270b2eca308b30ab139a6c4c8df318b424f625f8c6960689a2a800bc5d0
4
- data.tar.gz: cd16c846ae93111c0e24b4679300cd01c3fc8dd57b392ac311841f7615f71bd4
3
+ metadata.gz: 9b00aca895432b5130fad571666763a588ed10615d80319ae50a797eac704031
4
+ data.tar.gz: 167cc07867256c4b1bf2043578b9cd158a4b9356982eef823e54c7cf48e39d3a
5
5
  SHA512:
6
- metadata.gz: 29bf87c40cc7d39872d0f0849e5b205dc50853545cbd4bde6b601ae6cae9b874391cc94362e2faaadc509090764a4b4b7a98a73d2a5549ac95ba2840c51ea210
7
- data.tar.gz: 3f626b446645c0ee7f0f82cc97683497d9378ac93b97afc632e62b364e477f13b5af9ca33041088262055389274a5de14fdd47f5df7e47789f64d5ef60a20b26
6
+ metadata.gz: 06acfb0828ebe32f582004073ca34c8d9a136d7dad56f1da3ea22909fd591d70184a6e05415313bb12c8b7fcffe84033700d14906ccfe06044afe384dce17dcb
7
+ data.tar.gz: 6d243229507b7e0fdee145b2c3d156c7d6aaefb3b3628b51d7a4537a5ba76fd113c2bfd4b47222a8e451a08242925966d7639a8b623778aa9f2c28f364b4a70c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_form_bs5_file_input (0.0.5)
4
+ simple_form_bs5_file_input (0.0.6)
5
5
  rails
6
6
  simple_form
7
7
 
@@ -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
- return unless should_display_file? || file_attachment&.variable?
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
@@ -1,3 +1,3 @@
1
1
  module SimpleFormBs5FileInput
2
- VERSION = "0.0.5".freeze
2
+ VERSION = "0.0.6".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_bs5_file_input
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre-andré Boissinot