base_editing_bootstrap 1.0.0 → 1.1.0

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: 92f7fc93b1d2aa476674d85893b5ac441887e2d5b889ce3f6520887dd8915240
4
- data.tar.gz: af0568325773e2ca156be541734afcb3bccf7a214b8de2c98942b741071e2fa1
3
+ metadata.gz: a1e80d543ff93c2a170069bb78b4f78488819804458f1e5a36c87fd7d0975476
4
+ data.tar.gz: b65c0f800fe834ac24794e292c8e09c7e2910e2f5e1b0ba215aadd69ee7ff168
5
5
  SHA512:
6
- metadata.gz: dd1ad3622c616b241a780e46e18ffdb4712d4d7975584e2fb4a0b0162dee9315acfef0d70f95fdf47b8b068436808aba2bcb975edc48c7b4e2744a42186b8140
7
- data.tar.gz: c9b9bebec5692f48f2e283bdca287dc3a045787b54a7414013149c7ca3735c1b3018fbe7fae72ed4d97061c1c772626d8d1f2a821e95cb033e06cc634693adad
6
+ metadata.gz: 776c45e8aab54bb0208bf9b0af8728a2467b9943dec257f6e55527be03c53cfd7996e7f370a63ef29d769fe318a4937435bb7759eabf130c08f070d88c8b0eb8
7
+ data.tar.gz: 749586e54204dab5ad28c227d03fab252a79483e63a7f6cf07cb6ce84aca05aded2408f6092578ce3f39fca61ac4708b4c4692a3fb67c3722a1ca350dada2392
data/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
  All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
3
3
 
4
4
  - - -
5
+ ## 1.1.0 - 2025-01-03
6
+ #### Continuous Integration
7
+ - Add ruby 3.4 - (5658bb0) - Marino Bonetti
8
+ #### Features
9
+ - Boolean switch render right side label - (d448ef7) - Marino Bonetti
10
+ - Add a new layout container for form_field - (77dec9f) - Marino Bonetti
11
+ #### Tests
12
+ - Add help text example for enabled - (efd4aff) - Marino Bonetti
13
+
14
+ - - -
15
+
5
16
  ## 1.0.0 - 2024-11-26
6
17
  #### Bug Fixes
7
18
  - Remove fixed versions - (f8dc4b8) - Marino Bonetti
@@ -5,6 +5,7 @@
5
5
  <div class="card-body">
6
6
  <%= render partial: "form_field_header", local: {form:} %>
7
7
  <%= render collection: form_attributes(form.object),
8
+ layout: "form_field_container",
8
9
  partial: "form_field", locals: {form:} %>
9
10
  </div>
10
11
 
@@ -5,20 +5,25 @@
5
5
  # - form_field -> Array[String]
6
6
  %>
7
7
  <%# locals: (form:, form_field:) -%>
8
- <%= form.label(form_field, class: ["form-label", "form-#{form_field}-label"]) %>
9
-
10
8
  <%
11
- button_group_classes = ["mb-2"]
9
+ button_group_classes = ["mb-1"]
12
10
 
13
11
  content = form_print_field(form, form_field)
14
12
  unless content.match "checkbox"
15
13
  button_group_classes << "input-group"
16
14
  end
17
-
18
15
  button_group_classes << (form.object.validated? ? "has-validation" : "")
19
16
  button_group_classes << "form-#{form_field}-input-group"
20
17
 
18
+ # Non renderizziamo il contenuto del label in questa vista se siamo nello switch
19
+ if content.match "form-switch"
20
+ label_content = nil
21
+ else
22
+ label_content = form.label(form_field, class: ["form-label", "form-#{form_field}-label"])
23
+ end
24
+
21
25
  %>
26
+ <%= label_content %>
22
27
  <%= content_tag :div, class: button_group_classes.join(" ") do %>
23
28
  <%= render partial: "editing_form_measure_unit", locals: {object: form.object, field: form_field} %>
24
29
  <%= content %>
@@ -0,0 +1,3 @@
1
+ <div class="mb-3">
2
+ <%= yield %>
3
+ </div>
@@ -1,2 +1,2 @@
1
1
  <%# locals: (form:, field:) -%>
2
- <%= form.switch_box(field) %>
2
+ <%= form.switch_box(field,label: field) %>
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.1.0
@@ -64,7 +64,7 @@ module BaseEditingBootstrap::Forms
64
64
  end
65
65
 
66
66
  def switch_box(method, options = {}, checked_value = "1", unchecked_value = "0")
67
- options[:class] = (["form-switch"] + (options[:class] || "").split(" ")).join(" ")
67
+ options[:class] = (["form-check form-switch"] + (options[:class] || "").split(" ")).join(" ")
68
68
  self.check_box(method, options, checked_value, unchecked_value)
69
69
  end
70
70
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: base_editing_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marino Bonetti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-26 00:00:00.000000000 Z
11
+ date: 2025-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -317,6 +317,7 @@ files:
317
317
  - app/views/base_editing/_editing_form_measure_unit.html.erb
318
318
  - app/views/base_editing/_form.html.erb
319
319
  - app/views/base_editing/_form_field.html.erb
320
+ - app/views/base_editing/_form_field_container.html.erb
320
321
  - app/views/base_editing/_form_field_header.html.erb
321
322
  - app/views/base_editing/_form_footer.html.erb
322
323
  - app/views/base_editing/_index_body.html.erb