dsfr-form_builder 0.0.5 → 0.0.7
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 +4 -4
- data/lib/dsfr-form_builder.rb +12 -10
- metadata +9 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4e816709049a90277c9e2b5483c9dba3151de298cbe31e31c82c2726b27498d
|
4
|
+
data.tar.gz: 9f0079eeca19ecc0379603d01388cf6b73235a3aaab2c540e782f89742745692
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27a89a0ce90dfe65b2c69bec7f62bf5b499b2093427fd2bf381b8b30a83107fdfbea4a6f5639e46f10a86918edc6d8a22d11ba72bc1e4154b56eba22beea94dc
|
7
|
+
data.tar.gz: '00187f9758bdb49d5a70a7a506fea6423a86325076fdde5b3ce6c9123f9eef3e8cebe7b7deb564fce890fec7f1924596f218c21e51209e2221935bc1b43d6b03'
|
data/lib/dsfr-form_builder.rb
CHANGED
@@ -55,13 +55,15 @@ module Dsfr
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def dsfr_check_box(attribute, opts = {}, checked_value = "1", unchecked_value = "0")
|
58
|
-
@template.content_tag(:div, class: "fr-
|
59
|
-
@template.
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
58
|
+
@template.content_tag(:div, class: "fr-fieldset__element") do
|
59
|
+
@template.content_tag(:div, class: "fr-checkbox-group") do
|
60
|
+
@template.safe_join(
|
61
|
+
[
|
62
|
+
check_box(attribute, opts, checked_value, unchecked_value),
|
63
|
+
dsfr_label_with_hint(attribute, opts)
|
64
|
+
]
|
65
|
+
)
|
66
|
+
end
|
65
67
|
end
|
66
68
|
end
|
67
69
|
|
@@ -90,19 +92,19 @@ module Dsfr
|
|
90
92
|
@template.safe_join(
|
91
93
|
[
|
92
94
|
@template.content_tag(:legend, legend_content, class: "fr-fieldset__legend--regular fr-fieldset__legend"),
|
93
|
-
choices.map { |c| dsfr_radio_option(attribute, value: c[:value], label_text: c[:label], hint: c[:hint], **opts) }
|
95
|
+
choices.map { |c| dsfr_radio_option(attribute, value: c[:value], label_text: c[:label], hint: c[:hint], checked: c[:checked], **opts) }
|
94
96
|
]
|
95
97
|
)
|
96
98
|
end
|
97
99
|
end
|
98
100
|
|
99
|
-
def dsfr_radio_option(attribute, value:, label_text:, hint:, rich: false, **opts)
|
101
|
+
def dsfr_radio_option(attribute, value:, label_text:, hint:, checked:, rich: false, **opts)
|
100
102
|
@template.content_tag(:div, class: "fr-fieldset__element") do
|
101
103
|
classes = rich ? "fr-radio-group fr-radio-rich" : "fr-radio-group"
|
102
104
|
@template.content_tag(:div, class: classes) do
|
103
105
|
@template.safe_join(
|
104
106
|
[
|
105
|
-
radio_button(attribute, value, **opts),
|
107
|
+
radio_button(attribute, value, checked:, **opts),
|
106
108
|
label([ attribute, value ].join("_").to_sym) do
|
107
109
|
@template.safe_join(
|
108
110
|
[
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dsfr-form_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BetaGouv developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -83,7 +83,12 @@ files:
|
|
83
83
|
homepage: https://github.com/betagouv/dsfr-form-builder
|
84
84
|
licenses:
|
85
85
|
- MIT
|
86
|
-
metadata:
|
86
|
+
metadata:
|
87
|
+
bug_tracker_uri: https://github.com/betagouv/dsfr-form-builder/issues
|
88
|
+
changelog_uri: https://github.com/betagouv/dsfr-form-builder/releases
|
89
|
+
documentation_uri: https://www.rubydoc.info/gems/dsfr-form-builder/
|
90
|
+
homepage_uri: https://github.com/betagouv/dsfr-form-builder
|
91
|
+
source_code_uri: https://github.com/betagouv/dsfr-form-builder
|
87
92
|
post_install_message:
|
88
93
|
rdoc_options: []
|
89
94
|
require_paths:
|
@@ -99,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
104
|
- !ruby/object:Gem::Version
|
100
105
|
version: '0'
|
101
106
|
requirements: []
|
102
|
-
rubygems_version: 3.5.
|
107
|
+
rubygems_version: 3.5.22
|
103
108
|
signing_key:
|
104
109
|
specification_version: 4
|
105
110
|
summary: Ruby on Rails form builder pour le Système de Design de l'État (DSFR)
|