ui_bibz 3.0.0.beta5 → 3.0.0.beta6

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: 4ccac331a44d9938a4f9ea2787c60f399837b32fa9b841c1b4aa586b67aaa82a
4
- data.tar.gz: a8acf6abd32f1e4c2e878e618a3e31fc56f61d349b7c835ef9c5339563339d23
3
+ metadata.gz: ab074570076dac77f62df00073048e54f4bf3d935a7d3d2c13438000ffdb8506
4
+ data.tar.gz: 91005c842ed00077ecc28ea4fadf1a8d766af041e2c59b573a9a5fbf93b57d46
5
5
  SHA512:
6
- metadata.gz: 398d31ea38d03b1d8c7c5f2a66760fd806752a6a038d43c0a23268e62e888a53a8c4ad90be65c81af6d6ecf203f4d4e3f63953cc79e43dd3a0d6f314daa2dc5a
7
- data.tar.gz: c0da50a80beb20a6368a7e667e8735125db964fc8ca1de5d5fe101237835b7f7e51e1c85c74d6c52f266ae8684122d2b690d194d65cd10fc1a6f6802b51d8bf4
6
+ metadata.gz: c52c51c4e4075e0ad2bcaa0445aa0201b188e961d96c7a46126626f501115fd11bc1c81877be36456c272e2d427592056a51f98844f39809b4315100dbe1624a
7
+ data.tar.gz: 13033afe527ecfb013e00a4772920d41b0ee3880fa795e5ef09c6934f4c51d5fb634240394a243c681091d573ac84ae0691341589cc6a3132881e5018ec9ac0f
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ui_bibz (3.0.0.beta5)
4
+ ui_bibz (3.0.0.beta6)
5
5
  will-paginate-i18n
6
6
  will_paginate (~> 3.3.0)
7
7
  will_paginate-bootstrap4
@@ -12,6 +12,6 @@ module UiBibz
12
12
  REPO = 'git+https://github.com/thooams/ui_bibz.git'
13
13
  EMAIL = 'thomas@hummel.link'
14
14
  AUTHOR = 'Thooams [Thomas HUMMEL]'
15
- VERSION = '3.0.0.beta5'
15
+ VERSION = '3.0.0.beta6'
16
16
  AUTHORS = ['Thooams'].freeze
17
17
  end
@@ -45,19 +45,17 @@ module UiBibz::Ui::Core::Forms::Files
45
45
 
46
46
  # Render html tag
47
47
  def pre_render
48
- content_tag :div, html_options do
49
- concat file_field_tag content, class: 'form-file-input', multiple: options[:multiple], disabled: disabled?
50
- concat label_text_and_button
51
- end
48
+ file_field_tag content, html_options
52
49
  end
53
50
 
54
51
  private
55
52
 
56
- def label_text_and_button
57
- label_tag label_name, class: 'form-file-label' do
58
- concat content_tag(:span, format_value(options[:input_text] || options[:value]), class: 'form-file-text')
59
- concat content_tag(:span, options[:button_text] || 'Browse', class: 'form-file-button')
60
- end
53
+ def component_html_options
54
+ super.merge({
55
+ multiple: options[:multiple],
56
+ disabled: disabled?,
57
+ value: format_value(options[:input_text] || options[:value])
58
+ })
61
59
  end
62
60
 
63
61
  def format_value(value)
@@ -70,12 +68,8 @@ module UiBibz::Ui::Core::Forms::Files
70
68
  value.to_s
71
69
  end
72
70
 
73
- def label_name
74
- html_options[:id] || content
75
- end
76
-
77
71
  def component_html_classes
78
- super << 'form-file'
72
+ super << 'form-control'
79
73
  end
80
74
  end
81
75
  end
@@ -202,7 +202,7 @@ test1</textarea></div></form>"
202
202
  f.input :name_fr, as: :ui_file_field
203
203
  end
204
204
 
205
- expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_file_field optional user_name_fr\"><label class=\"control-label ui_file_field optional\" for=\"user_name_fr\">Name fr</label><div class=\"ui_file_field optional form-file\"><input type=\"file\" name=\"user[name_fr]\" id=\"user_name_fr\" class=\"form-file-input\" /><label class=\"form-file-label\" for=\"user_name_fr\"><span class=\"form-file-text\">test1</span><span class=\"form-file-button\">Browse</span></label></div></div></form>"
205
+ expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_file_field optional user_name_fr\"><label class=\"control-label ui_file_field optional\" for=\"user_name_fr\">Name fr</label><input type=\"file\" name=\"user[name_fr]\" id=\"user_name_fr\" value=\"test1\" class=\"ui_file_field optional form-control\" /></div></form>"
206
206
 
207
207
  assert_equal expected, actual
208
208
  end
@@ -69,7 +69,7 @@ class CardTest < ActionView::TestCase
69
69
  p.body do |b|
70
70
  b.title 'Special title treatment'
71
71
  b.subtitle 'The subtitle'
72
- b.text _('With supporting text below as a natural lead-in to additional content.')
72
+ b.text 'With supporting text below as a natural lead-in to additional content.'
73
73
  b.link 'Go somewhere', url: '#go-somewhere', class: 'btn btn-primary'
74
74
  end
75
75
  end
@@ -5,7 +5,7 @@ require 'test_helper'
5
5
  class FileFieldTest < ActionView::TestCase
6
6
  test 'file_field' do
7
7
  actual = UiBibz::Ui::Core::Forms::Files::FileField.new('test').render
8
- expected = "<div class=\"form-file\"><input type=\"file\" name=\"test\" id=\"test\" class=\"form-file-input\" /><label class=\"form-file-label\" for=\"test\"><span class=\"form-file-text\"></span><span class=\"form-file-button\">Browse</span></label></div>"
8
+ expected = "<input type=\"file\" name=\"test\" id=\"test\" value=\"\" class=\"form-control\" />"
9
9
 
10
10
  assert_equal expected, actual
11
11
  end
@@ -4,14 +4,14 @@ require 'test_helper'
4
4
  class NavbarTest < ActionView::TestCase
5
5
  test 'Navbar' do
6
6
  actual = UiBibz::Ui::Core::Navigations::Navbar.new
7
- expected = "<nav class=\"navbar navbar-light navbar-expand-lg\"><div class=\"container\"><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-target=\"##{actual.id}\">☰</button><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"></div></div></nav>"
7
+ expected = "<nav class=\"navbar navbar-light navbar-expand-lg\"><div class=\"container\"><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"##{actual.id}\">☰</button><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"></div></div></nav>"
8
8
 
9
9
  assert_equal expected, actual.render
10
10
  end
11
11
 
12
12
  test 'Navbar with options' do
13
13
  actual = UiBibz::Ui::Core::Navigations::Navbar.new(title: 'Brand', expand_size: :xs, status: :primary, position: :top, brand_position: :right)
14
- expected = "<nav class=\"bg-primary navbar navbar-light fixed-top navbar-expand-xs\"><div class=\"container\"><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-target=\"##{actual.id}\">☰</button><span class=\"navbar-brand\">Brand</span><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"></div></div></nav>"
14
+ expected = "<nav class=\"bg-primary navbar navbar-light fixed-top navbar-expand-xs\"><div class=\"container\"><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"##{actual.id}\">☰</button><span class=\"navbar-brand\">Brand</span><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"></div></div></nav>"
15
15
 
16
16
  assert_equal expected, actual.render
17
17
  end
@@ -30,7 +30,7 @@ class NavbarTest < ActionView::TestCase
30
30
  end
31
31
  nb.text 'test'
32
32
  end
33
- expected = "<nav class=\"navbar navbar-light navbar-expand-lg\"><div class=\"container\"><span class=\"navbar-brand\">Brand</span><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-target=\"##{actual.id}\">☰</button><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"><ul class=\"navbar-nav\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"nav-link\">Messages</a></li></ul><form type=\"form_tag\" position=\"right\" class=\"d-flex\" action=\"#\" accept-charset=\"UTF-8\" method=\"post\"><button class=\"btn-secondary btn\">Search</button></form><span class=\"navbar-text\">test</span></div></div></nav>"
33
+ expected = "<nav class=\"navbar navbar-light navbar-expand-lg\"><div class=\"container\"><span class=\"navbar-brand\">Brand</span><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"##{actual.id}\">☰</button><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"><ul class=\"navbar-nav\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"nav-link\">Messages</a></li></ul><form type=\"form_tag\" position=\"right\" class=\"d-flex\" action=\"#\" accept-charset=\"UTF-8\" method=\"post\"><button class=\"btn-secondary btn\">Search</button></form><span class=\"navbar-text\">test</span></div></div></nav>"
34
34
 
35
35
  assert_equal expected, actual.render
36
36
  end
@@ -43,7 +43,7 @@ class NavbarTest < ActionView::TestCase
43
43
  end
44
44
  end
45
45
  expected =
46
- "<nav class=\"bg-dark navbar navbar-dark navbar-expand-lg\"><div class=\"container\"><span class=\"navbar-brand\"><img src=\"/images/ruby-white\" /></span><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-target=\"##{actual.id}\">☰</button><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"><ul class=\"navbar-nav\"><li class=\"nav-item\"><a href=\"#link\" class=\"nav-link\">Link</a></li></ul></div></div></nav>"
46
+ "<nav class=\"bg-dark navbar navbar-dark navbar-expand-lg\"><div class=\"container\"><span class=\"navbar-brand\"><img src=\"/images/ruby-white\" /></span><button class=\"navbar-toggler hidden-sm-up\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"##{actual.id}\">☰</button><div class=\"navbar-collapse collapse\" id=\"#{actual.id}\"><ul class=\"navbar-nav\"><li class=\"nav-item\"><a href=\"#link\" class=\"nav-link\">Link</a></li></ul></div></div></nav>"
47
47
 
48
48
  assert_equal expected, actual.render
49
49
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ui_bibz
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.beta5
4
+ version: 3.0.0.beta6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thooams [Thomas HUMMEL]