hellobase-formtastic 0.2.0 → 0.3.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23204b79fccf4dbacbe9826a220766e0604923a959673771c8fc38bc6240997e
|
4
|
+
data.tar.gz: f13d31c76387f8646d180dcf65482b85c38cf742de6297b4dcb07a1b0b4fe5a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9561afc8619c56078637790305dc024d0a19e39e58a4b25942ae76ef3a09cd434c1bbe8d3389068dc276709254d1a79fa820973ab911cdc65bfb0318a31a5b8
|
7
|
+
data.tar.gz: 2e5725f7722d104c5ddecdb173614b7457338eb2030802521045842dcea08adcbaac3c27062bf4dcb2fc49b55040d231624712a9fa0e9d5206aad33393738498
|
@@ -7,7 +7,7 @@ module Hellobase
|
|
7
7
|
include ::Formtastic::Inputs::Base
|
8
8
|
|
9
9
|
def self.virtual_attributes(base)
|
10
|
-
[:"_dpwt_#{base}_d", :"_dpwt_#{base}_h", :"_dpwt_#{base}_m"]
|
10
|
+
[:"_dpwt_#{base}_d", :"_dpwt_#{base}_h", :"_dpwt_#{base}_m", :"_dpwt_#{base}_z"]
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.define_virtual_attributes(klass, base)
|
@@ -28,6 +28,10 @@ module Hellobase
|
|
28
28
|
send(base)&.strftime('%M')
|
29
29
|
end
|
30
30
|
|
31
|
+
define_method attrs[3] do
|
32
|
+
send(base)&.strftime('%Z')
|
33
|
+
end
|
34
|
+
|
31
35
|
attrs.each_with_index do |a, i|
|
32
36
|
define_method :"#{a}=" do |val|
|
33
37
|
instance_variable_set ivars[i], val
|
@@ -46,7 +50,8 @@ module Hellobase
|
|
46
50
|
[
|
47
51
|
instance_variable_get(ivars[1]),
|
48
52
|
instance_variable_get(ivars[2])
|
49
|
-
].join(':')
|
53
|
+
].join(':'),
|
54
|
+
instance_variable_get(ivars[3]),
|
50
55
|
].join(' ')
|
51
56
|
end
|
52
57
|
|
@@ -58,13 +63,17 @@ module Hellobase
|
|
58
63
|
datepicker_html = ::ActiveAdmin::Inputs::DatepickerInput.new(builder, template, object, object_name, :"_dpwt_#{method}_d", datepicker_options).to_html
|
59
64
|
hour_select_html = ::Formtastic::Inputs::SelectInput.new(builder, template, object, object_name, :"_dpwt_#{method}_h", hour_select_options).to_html
|
60
65
|
minute_select_html = ::Formtastic::Inputs::SelectInput.new(builder, template, object, object_name, :"_dpwt_#{method}_m", minute_select_options).to_html
|
61
|
-
|
66
|
+
|
67
|
+
timezone = options[:timezone] || 'UTC'
|
68
|
+
timezone_span_html = template.content_tag(:span, timezone, id: "#{object_name}__dpwt_#{method}_timezone")
|
69
|
+
timezone_hidden_input_html = template.hidden_field_tag("#{object_name}[_dpwt_#{method}_z]", timezone, :id => "#{object_name}__dpwt_#{method}_z")
|
62
70
|
|
63
71
|
wrapper_contents = [
|
64
72
|
replace_li_tag(datepicker_html),
|
65
73
|
replace_li_tag(hour_select_html),
|
66
74
|
replace_li_tag(minute_select_html),
|
67
|
-
|
75
|
+
timezone_span_html,
|
76
|
+
timezone_hidden_input_html,
|
68
77
|
error_html,
|
69
78
|
hint_html,
|
70
79
|
].compact.join("\n").html_safe
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hellobase-formtastic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anthony Wang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeadmin
|
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
|
-
rubygems_version: 3.
|
161
|
+
rubygems_version: 3.1.6
|
162
162
|
signing_key:
|
163
163
|
specification_version: 4
|
164
164
|
summary: Custom Formtastic inputs
|