base_editing_bootstrap 1.0.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/app/views/base_editing/_form.html.erb +1 -0
- data/app/views/base_editing/_form_field.html.erb +9 -4
- data/app/views/base_editing/_form_field_container.html.erb +3 -0
- data/app/views/base_editing/form_field/_boolean.html.erb +1 -1
- data/lib/base_editing_bootstrap/VERSION +1 -1
- data/lib/base_editing_bootstrap/forms/base.rb +1 -1
- data/lib/base_editing_bootstrap/searches/field.rb +9 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8975be7d400651326b997d9d7650bd12c9145233c753e326ddb945c8a84816a
|
4
|
+
data.tar.gz: 97a6eaaa243d8d3320c3093fdc5a650c6d9cc5b20641680cb91f7985bf50f8fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48733c1f94d354afb34528998fce967e9b22d1bdf2b418eb8fb4444fea4bac157d4a0a79168c365675e3ca864d23eba0b046b54bbc8babb397f42e449e69f736
|
7
|
+
data.tar.gz: 5de0164ea3ae7de687816ec721117b66bde4c309ac3806ce1e812e266eb847a61c859dd185bf0755a496bf42e76b5b820c936e76b39849321b75481d8009e3f5
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,25 @@
|
|
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.2.0 - 2025-01-09
|
6
|
+
#### Features
|
7
|
+
- Add new method to get label from search field - (ace5fa0) - Marino Bonetti
|
8
|
+
#### Tests
|
9
|
+
- Add Menu for navigation in dummy - (2b2a9a6) - Marino Bonetti
|
10
|
+
|
11
|
+
- - -
|
12
|
+
|
13
|
+
## 1.1.0 - 2025-01-03
|
14
|
+
#### Continuous Integration
|
15
|
+
- Add ruby 3.4 - (5658bb0) - Marino Bonetti
|
16
|
+
#### Features
|
17
|
+
- Boolean switch render right side label - (d448ef7) - Marino Bonetti
|
18
|
+
- Add a new layout container for form_field - (77dec9f) - Marino Bonetti
|
19
|
+
#### Tests
|
20
|
+
- Add help text example for enabled - (efd4aff) - Marino Bonetti
|
21
|
+
|
22
|
+
- - -
|
23
|
+
|
5
24
|
## 1.0.0 - 2024-11-26
|
6
25
|
#### Bug Fixes
|
7
26
|
- Remove fixed versions - (f8dc4b8) - Marino Bonetti
|
@@ -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-
|
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 %>
|
@@ -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.
|
1
|
+
1.2.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
|
|
@@ -6,6 +6,8 @@ module BaseEditingBootstrap::Searches
|
|
6
6
|
class Field
|
7
7
|
attr_reader :search_base, :name
|
8
8
|
|
9
|
+
# @param [BaseEditingBootstrap::Searches::Base] search_base
|
10
|
+
# @param [Symbol] name
|
9
11
|
def initialize(search_base, name)
|
10
12
|
@search_base = search_base
|
11
13
|
@name = name
|
@@ -14,5 +16,12 @@ module BaseEditingBootstrap::Searches
|
|
14
16
|
def to_partial_path
|
15
17
|
"search_field"
|
16
18
|
end
|
19
|
+
|
20
|
+
##
|
21
|
+
# Helper per estrapolare la label del campo
|
22
|
+
# @return [String]
|
23
|
+
def label
|
24
|
+
@search_base.ransack_query.translate(name)
|
25
|
+
end
|
17
26
|
end
|
18
27
|
end
|
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.
|
4
|
+
version: 1.2.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:
|
11
|
+
date: 2025-01-09 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
|