effective_bootstrap 0.1.4 → 0.1.5
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/app/assets/javascripts/effective_datetime/overrides.js.coffee +3 -0
- data/app/assets/stylesheets/effective_datetime/overrides.scss +3 -0
- data/app/models/effective/form_input.rb +7 -3
- data/app/models/effective/form_inputs/checks.rb +8 -1
- data/app/models/effective/form_inputs/date_field.rb +1 -1
- data/app/models/effective/form_inputs/datetime_field.rb +1 -1
- data/app/models/effective/form_inputs/radios.rb +7 -1
- data/app/models/effective/form_inputs/time_field.rb +1 -1
- data/lib/effective_bootstrap/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d7f86a0d2683a7ba00bec65b642d7d68a5381a4
|
4
|
+
data.tar.gz: f0ce7680a8e5ff6df8a9e31bda7d3bb10fc789e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b9cafa5062102c1b1eb947c569a94f7c53826892e778c359fefe56b730a84dbd9565f165a924912157b2408e8d58e4a8bd25604d680c087b6b738deea34c747
|
7
|
+
data.tar.gz: e934a6fac03621ee5789aa05ea607c225a1ebf5040fa68ae16b4d6deb24a462a1202f7a514cd71bfe7651638f615e14e8a5f27faf29d561abd632c9ca58e780f
|
@@ -40,3 +40,6 @@ $(document).on 'dp.end_date_initialized', (event) ->
|
|
40
40
|
try
|
41
41
|
date = $start_date.data('DateTimePicker').date()
|
42
42
|
$end_date.data('DateTimePicker').minDate(date) if date
|
43
|
+
|
44
|
+
$(document).on 'click', '.effective_date_time_picker_input_group', (event) ->
|
45
|
+
$(event.currentTarget).children('input').data('DateTimePicker').show()
|
@@ -302,7 +302,7 @@ module Effective
|
|
302
302
|
options[:input][:required] = 'required'
|
303
303
|
end
|
304
304
|
|
305
|
-
if
|
305
|
+
if readonly?
|
306
306
|
options[:input][:readonly] = 'readonly'
|
307
307
|
|
308
308
|
unless options[:input][:class].to_s.include?('form-control-plaintext')
|
@@ -310,7 +310,7 @@ module Effective
|
|
310
310
|
end
|
311
311
|
end
|
312
312
|
|
313
|
-
if disabled?
|
313
|
+
if disabled?
|
314
314
|
options[:input][:disabled] = 'disabled'
|
315
315
|
end
|
316
316
|
|
@@ -359,8 +359,12 @@ module Effective
|
|
359
359
|
@builder.readonly
|
360
360
|
end
|
361
361
|
|
362
|
+
def readonly?
|
363
|
+
options.dig(:input, :readonly).present? || form_readonly?
|
364
|
+
end
|
365
|
+
|
362
366
|
def disabled?
|
363
|
-
options.dig(:input, :disabled).present?
|
367
|
+
options.dig(:input, :disabled).present? || form_disabled?
|
364
368
|
end
|
365
369
|
|
366
370
|
def form_disabled?
|
@@ -1,9 +1,16 @@
|
|
1
1
|
module Effective
|
2
|
+
|
2
3
|
module FormInputs
|
3
4
|
class Checks < CollectionInput
|
4
5
|
|
5
6
|
def build_input(&block)
|
6
|
-
@builder.collection_check_boxes(name, options_collection, value_method, label_method, collection_options, item_input_options) { |builder| build_item(builder) }
|
7
|
+
html = @builder.collection_check_boxes(name, options_collection, value_method, label_method, collection_options, item_input_options) { |builder| build_item(builder) }
|
8
|
+
|
9
|
+
if disabled? # collection_check_boxes doesn't correctly disable the input type hidden, but does on the build_items
|
10
|
+
html = html.sub('<input type="hidden"', '<input type="hidden" disabled="disabled"').html_safe
|
11
|
+
end
|
12
|
+
|
13
|
+
html
|
7
14
|
end
|
8
15
|
|
9
16
|
def build_wrapper(&block)
|
@@ -14,7 +14,7 @@ module Effective
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def input_group_options
|
17
|
-
{ input_group: { class: 'input-group' }, prepend: content_tag(:span, icon('calendar'), class: 'input-group-text') }
|
17
|
+
{ input_group: { class: 'input-group effective_date_time_picker_input_group' }, prepend: content_tag(:span, icon('calendar'), class: 'input-group-text') }
|
18
18
|
end
|
19
19
|
|
20
20
|
def datetime_to_s
|
@@ -14,7 +14,7 @@ module Effective
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def input_group_options
|
17
|
-
{ input_group: { class: 'input-group' }, prepend: content_tag(:span, icon('calendar'), class: 'input-group-text') }
|
17
|
+
{ input_group: { class: 'input-group effective_date_time_picker_input_group' }, prepend: content_tag(:span, icon('calendar'), class: 'input-group-text') }
|
18
18
|
end
|
19
19
|
|
20
20
|
def build_input(&block)
|
@@ -20,7 +20,13 @@ module Effective
|
|
20
20
|
|
21
21
|
def build_input(&block)
|
22
22
|
build_button_group do
|
23
|
-
@builder.collection_radio_buttons(name, options_collection, value_method, label_method, collection_options, item_input_options) { |builder| build_item(builder) }
|
23
|
+
html = @builder.collection_radio_buttons(name, options_collection, value_method, label_method, collection_options, item_input_options) { |builder| build_item(builder) }
|
24
|
+
|
25
|
+
if disabled? # collection_check_boxes doesn't correctly disable the input type hidden, but does on the build_items
|
26
|
+
html = html.sub('<input type="hidden"', '<input type="hidden" disabled="disabled"').html_safe
|
27
|
+
end
|
28
|
+
|
29
|
+
html
|
24
30
|
end
|
25
31
|
end
|
26
32
|
|
@@ -14,7 +14,7 @@ module Effective
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def input_group_options
|
17
|
-
{ input_group: { class: 'input-group' }, prepend: content_tag(:span, icon('clock'), class: 'input-group-text') }
|
17
|
+
{ input_group: { class: 'input-group effective_date_time_picker_input_group' }, prepend: content_tag(:span, icon('clock'), class: 'input-group-text') }
|
18
18
|
end
|
19
19
|
|
20
20
|
def datetime_to_s
|