formnestic 1.0.5 → 1.0.6
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/formnestic.gemspec +1 -1
- data/lib/formnestic/form_builder/list_form_builder.rb +12 -13
- data/lib/formnestic/formtastic_extensions.rb +6 -5
- 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: e3c38a85b6a041d9a1a3c8f1e185d57bac16d745
|
4
|
+
data.tar.gz: 67ecd9c9346934ab650e320d076bcc7387c77f75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da9b01137798419af20cfc91c912643aa186cd780f5fb56801c5b397db306c7edd9faee35254896d0841d49cb9e25e8e7ac66fae0e88a28720607ceb280492f2
|
7
|
+
data.tar.gz: ee6eddc214eb3dbd9b8046c7e160803e7fe4a3ca12e0be8cbdff376a2a82ff7a2ab424c972c6603ffc2683658946b5e236b30432d06e450cdd2ff19045b51ef5
|
data/formnestic.gemspec
CHANGED
@@ -4,27 +4,26 @@ module Formnestic
|
|
4
4
|
include Formnestic::FormBuilder::BaseBuilder
|
5
5
|
def formnestic_list_semantic_fields_for(record_or_name_or_array, *args, &block)
|
6
6
|
options = args.dup.extract_options!
|
7
|
-
|
7
|
+
|
8
8
|
formnestic_add_rows_counter_related_attributes
|
9
9
|
existing_rows = formtastic_semantic_fields_for(record_or_name_or_array, *args, &block)
|
10
|
-
contents = [template.content_tag(:div, existing_rows, class:
|
11
|
-
|
10
|
+
contents = [template.content_tag(:div, existing_rows, class: 'formnestic-list-entries-container')]
|
11
|
+
|
12
12
|
options[:min_entry] ||= -1
|
13
13
|
options[:max_entry] ||= -1
|
14
|
-
|
14
|
+
|
15
15
|
options[:min_entry_alert_message] = formnestic_min_entry_alert_message(record_or_name_or_array, options[:min_entry])
|
16
16
|
contents.push(formnestic_add_new_record_button_row_for_list_form(record_or_name_or_array, *args, &block)) if options[:row_addable]
|
17
|
-
options[:class] = [options[:class],
|
18
|
-
|
17
|
+
options[:class] = [options[:class], 'formnestic-nested-model-container'].compact.join
|
18
|
+
|
19
19
|
template.content_tag(:div,
|
20
|
-
|
21
|
-
|
22
|
-
)
|
20
|
+
contents.join.html_safe,
|
21
|
+
options.except(:builder, :parent, :name, :parent_builder, :display_type, :row_removable, :new_record_link_label, :child_index))
|
23
22
|
end
|
24
|
-
|
23
|
+
|
25
24
|
def formnestic_add_new_record_button_row_for_list_form(record_or_name_or_array, *args, &block)
|
26
|
-
template.content_tag(:div, formnestic_link_to_add_fields_with_content(record_or_name_or_array, *args, &block), class:
|
27
|
-
end
|
25
|
+
template.content_tag(:div, formnestic_link_to_add_fields_with_content(record_or_name_or_array, *args, &block), class: 'formnestic-list-new-entry-link-container')
|
26
|
+
end
|
28
27
|
end
|
29
28
|
end
|
30
|
-
end
|
29
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# rubocop:disable MethodLength, Documentation
|
1
2
|
module Formnestic
|
2
3
|
module FormtasticExtensions
|
3
4
|
def extend_form_builder
|
@@ -45,17 +46,17 @@ module Formnestic
|
|
45
46
|
:formtastic_render_label?,
|
46
47
|
:render_label?
|
47
48
|
)
|
48
|
-
# Formtastic::Inputs::BooleanInput.send(
|
49
|
-
# :alias_method,
|
50
|
-
# :formtastic_label_text_with_embedded_checkbox,
|
51
|
-
# :label_text_with_embedded_checkbox
|
52
|
-
# )
|
53
49
|
Formtastic::Inputs::Base.send(
|
54
50
|
:include, Formnestic::Inputs::Base::Wrapping
|
55
51
|
)
|
56
52
|
Formtastic::Inputs::Base.send(
|
57
53
|
:include, Formnestic::Inputs::Base::Labelling
|
58
54
|
)
|
55
|
+
Formtastic::Inputs::BooleanInput.send(
|
56
|
+
:alias_method,
|
57
|
+
:formtastic_label_text_with_embedded_checkbox,
|
58
|
+
:label_text_with_embedded_checkbox
|
59
|
+
)
|
59
60
|
end
|
60
61
|
|
61
62
|
def extend_datetime_related_inputs
|