flexa_lib 0.1.21 → 0.2.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.
- data/Gemfile +2 -0
- data/flexa_lib.gemspec +6 -3
- data/lib/action_view/helpers/text_field_date_helper.rb +166 -0
- data/lib/flexa_formtastic_bootstrap/engine.rb +4 -0
- data/lib/flexa_formtastic_bootstrap/form_builder.rb +38 -0
- data/lib/flexa_formtastic_bootstrap/helpers/buttons_helper.rb +52 -0
- data/lib/flexa_formtastic_bootstrap/helpers/fieldset_wrapper.rb +37 -0
- data/lib/flexa_formtastic_bootstrap/helpers/input_helper.rb +12 -0
- data/lib/flexa_formtastic_bootstrap/helpers/inputs_helper.rb +36 -0
- data/lib/flexa_formtastic_bootstrap/helpers.rb +19 -0
- data/lib/flexa_formtastic_bootstrap/inputs/base/choices.rb +49 -0
- data/lib/flexa_formtastic_bootstrap/inputs/base/errors.rb +48 -0
- data/lib/flexa_formtastic_bootstrap/inputs/base/hints.rb +27 -0
- data/lib/flexa_formtastic_bootstrap/inputs/base/html.rb +21 -0
- data/lib/flexa_formtastic_bootstrap/inputs/base/labelling.rb +18 -0
- data/lib/flexa_formtastic_bootstrap/inputs/base/stringish.rb +18 -0
- data/lib/flexa_formtastic_bootstrap/inputs/base/timeish.rb +35 -0
- data/lib/flexa_formtastic_bootstrap/inputs/base/wrapping.rb +67 -0
- data/lib/flexa_formtastic_bootstrap/inputs/base.rb +22 -0
- data/lib/flexa_formtastic_bootstrap/inputs/boolean_input.rb +33 -0
- data/lib/flexa_formtastic_bootstrap/inputs/check_boxes_input.rb +35 -0
- data/lib/flexa_formtastic_bootstrap/inputs/date_input.rb +16 -0
- data/lib/flexa_formtastic_bootstrap/inputs/datetime_input.rb +19 -0
- data/lib/flexa_formtastic_bootstrap/inputs/email_input.rb +15 -0
- data/lib/flexa_formtastic_bootstrap/inputs/file_input.rb +14 -0
- data/lib/flexa_formtastic_bootstrap/inputs/hidden_input.rb +12 -0
- data/lib/flexa_formtastic_bootstrap/inputs/number_input.rb +15 -0
- data/lib/flexa_formtastic_bootstrap/inputs/password_input.rb +15 -0
- data/lib/flexa_formtastic_bootstrap/inputs/phone_input.rb +15 -0
- data/lib/flexa_formtastic_bootstrap/inputs/radio_input.rb +32 -0
- data/lib/flexa_formtastic_bootstrap/inputs/range_input.rb +15 -0
- data/lib/flexa_formtastic_bootstrap/inputs/search_input.rb +15 -0
- data/lib/flexa_formtastic_bootstrap/inputs/select_input.rb +14 -0
- data/lib/flexa_formtastic_bootstrap/inputs/string_input.rb +15 -0
- data/lib/flexa_formtastic_bootstrap/inputs/text_input.rb +14 -0
- data/lib/flexa_formtastic_bootstrap/inputs/time_input.rb +16 -0
- data/lib/flexa_formtastic_bootstrap/inputs/time_zone_input.rb +14 -0
- data/lib/flexa_formtastic_bootstrap/inputs/url_input.rb +14 -0
- data/lib/flexa_formtastic_bootstrap/inputs.rb +29 -0
- data/lib/flexa_formtastic_bootstrap.rb +6 -0
- data/lib/flexa_lib/inputs/boolean_input.rb +37 -0
- data/lib/flexa_lib/inputs/lookup_input.rb +8 -16
- data/lib/flexa_lib/inputs.rb +1 -0
- data/lib/flexa_lib.rb +3 -3
- data/vendor/assets/javascripts/flexa-themejs.js +8 -3
- data/vendor/assets/stylesheets/flexa-theme.css.scss +5 -1
- metadata +50 -27
@@ -0,0 +1,67 @@
|
|
1
|
+
module FlexaFormtasticBootstrap
|
2
|
+
module Inputs
|
3
|
+
module Base
|
4
|
+
module Wrapping
|
5
|
+
|
6
|
+
include Formtastic::Inputs::Base::Wrapping
|
7
|
+
|
8
|
+
def generic_input_wrapping(&block)
|
9
|
+
clearfix_div_wrapping do
|
10
|
+
label_html <<
|
11
|
+
input_div_wrapping do
|
12
|
+
if options[:prepend]
|
13
|
+
prepended_input_wrapping do
|
14
|
+
[template.content_tag(:span, options[:prepend], :class => 'add-on'), yield].join("\n").html_safe
|
15
|
+
end
|
16
|
+
else
|
17
|
+
yield
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def clearfix_div_wrapping(&block)
|
24
|
+
template.content_tag(:div, wrapper_html_options) do
|
25
|
+
yield
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def input_div_wrapping(inline_or_block_errors = :inline)
|
30
|
+
template.content_tag(:div, :class => "input") do
|
31
|
+
[yield, error_html(inline_or_block_errors), hint_html(inline_or_block_errors)].join("\n").html_safe
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def inline_inputs_div_wrapping(&block)
|
36
|
+
template.content_tag(:div, :class => "inline-inputs") do
|
37
|
+
yield
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def wrapper_html_options
|
42
|
+
opts = options[:wrapper_html] || {}
|
43
|
+
opts[:class] ||= []
|
44
|
+
opts[:class] = [opts[:class].to_s] unless opts[:class].is_a?(Array)
|
45
|
+
opts[:class] << as
|
46
|
+
opts[:class] << "clearfix"
|
47
|
+
# opts[:class] << "input"
|
48
|
+
opts[:class] << "error" if errors?
|
49
|
+
opts[:class] << "optional" if optional?
|
50
|
+
opts[:class] << "required" if required?
|
51
|
+
opts[:class] << "autofocus" if autofocus?
|
52
|
+
opts[:class] = opts[:class].join(' ')
|
53
|
+
|
54
|
+
opts[:id] ||= wrapper_dom_id
|
55
|
+
|
56
|
+
opts
|
57
|
+
end
|
58
|
+
|
59
|
+
def prepended_input_wrapping(&block)
|
60
|
+
template.content_tag(:div, :class => 'input-prepend') do
|
61
|
+
yield
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require "flexa_formtastic_bootstrap/inputs/base/choices"
|
2
|
+
require "flexa_formtastic_bootstrap/inputs/base/errors"
|
3
|
+
require "flexa_formtastic_bootstrap/inputs/base/hints"
|
4
|
+
require "flexa_formtastic_bootstrap/inputs/base/html"
|
5
|
+
require "flexa_formtastic_bootstrap/inputs/base/labelling"
|
6
|
+
require "flexa_formtastic_bootstrap/inputs/base/stringish"
|
7
|
+
require "flexa_formtastic_bootstrap/inputs/base/timeish"
|
8
|
+
require "flexa_formtastic_bootstrap/inputs/base/wrapping"
|
9
|
+
|
10
|
+
module FlexaFormtasticBootstrap
|
11
|
+
module Inputs
|
12
|
+
module Base
|
13
|
+
|
14
|
+
include Errors
|
15
|
+
include Hints
|
16
|
+
include Html
|
17
|
+
include Labelling
|
18
|
+
include Wrapping
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# TODO See if this can be refactored to make use of some of the Choices code.
|
2
|
+
module FlexaFormtasticBootstrap
|
3
|
+
module Inputs
|
4
|
+
class BooleanInput < Formtastic::Inputs::BooleanInput
|
5
|
+
include Base
|
6
|
+
|
7
|
+
def to_html
|
8
|
+
clearfix_div_wrapping do
|
9
|
+
empty_label <<
|
10
|
+
hidden_field_html <<
|
11
|
+
input_div_wrapping(:block) do
|
12
|
+
template.content_tag(:ul, :class => "inputs-list") do
|
13
|
+
template.content_tag(:li) do
|
14
|
+
label_with_nested_checkbox
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def label_text_with_embedded_checkbox
|
22
|
+
# That newline matters! Why, I do no not know.
|
23
|
+
check_box_html << "\n" << template.content_tag(:span) do label_text end
|
24
|
+
end
|
25
|
+
|
26
|
+
# Need this for formatting to work.
|
27
|
+
def empty_label
|
28
|
+
template.content_tag(:label) do end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module FlexaFormtasticBootstrap
|
2
|
+
module Inputs
|
3
|
+
class CheckBoxesInput < Formtastic::Inputs::CheckBoxesInput
|
4
|
+
include Base
|
5
|
+
include Base::Choices
|
6
|
+
|
7
|
+
def to_html
|
8
|
+
clearfix_div_wrapping do
|
9
|
+
legend_html <<
|
10
|
+
hidden_field_for_all <<
|
11
|
+
input_div_wrapping do
|
12
|
+
choices_group_wrapping do
|
13
|
+
collection.map { |choice|
|
14
|
+
choice_wrapping(choice_wrapping_html_options(choice)) do
|
15
|
+
choice_html(choice)
|
16
|
+
end
|
17
|
+
}.join("\n").html_safe
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def choice_html(choice)
|
24
|
+
template.content_tag(:label,
|
25
|
+
hidden_fields? ?
|
26
|
+
check_box_with_hidden_input(choice) :
|
27
|
+
check_box_without_hidden_input(choice) <<
|
28
|
+
choice_label(choice),
|
29
|
+
label_html_options.merge(:for => choice_input_dom_id(choice), :class => nil)
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module FlexaFormtasticBootstrap
|
2
|
+
module Inputs
|
3
|
+
class DateInput < Formtastic::Inputs::DateInput
|
4
|
+
include Base
|
5
|
+
include Base::Stringish
|
6
|
+
include Base::Timeish
|
7
|
+
|
8
|
+
def to_html
|
9
|
+
generic_input_wrapping do
|
10
|
+
date_input_html
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module FlexaFormtasticBootstrap
|
2
|
+
module Inputs
|
3
|
+
class DatetimeInput < Formtastic::Inputs::DatetimeInput
|
4
|
+
include Base
|
5
|
+
include Base::Stringish
|
6
|
+
include Base::Timeish
|
7
|
+
|
8
|
+
def to_html
|
9
|
+
generic_input_wrapping do
|
10
|
+
inline_inputs_div_wrapping do
|
11
|
+
# This newline matters.
|
12
|
+
date_input_html << "\n".html_safe << time_input_html
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module FlexaFormtasticBootstrap
|
2
|
+
module Inputs
|
3
|
+
class EmailInput < Formtastic::Inputs::EmailInput
|
4
|
+
include Base
|
5
|
+
include Base::Stringish
|
6
|
+
|
7
|
+
def to_html
|
8
|
+
generic_input_wrapping do
|
9
|
+
builder.email_field(method, input_html_options)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module FlexaFormtasticBootstrap
|
2
|
+
module Inputs
|
3
|
+
class NumberInput < Formtastic::Inputs::NumberInput
|
4
|
+
include Base
|
5
|
+
include Base::Stringish
|
6
|
+
|
7
|
+
def to_html
|
8
|
+
generic_input_wrapping do
|
9
|
+
builder.number_field(method, input_html_options)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module FlexaFormtasticBootstrap
|
2
|
+
module Inputs
|
3
|
+
class PasswordInput < Formtastic::Inputs::PasswordInput
|
4
|
+
include Base
|
5
|
+
include Base::Stringish
|
6
|
+
|
7
|
+
def to_html
|
8
|
+
generic_input_wrapping do
|
9
|
+
builder.password_field(method, input_html_options)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module FlexaFormtasticBootstrap
|
2
|
+
module Inputs
|
3
|
+
class PhoneInput < Formtastic::Inputs::PhoneInput
|
4
|
+
include Base
|
5
|
+
include Base::Stringish
|
6
|
+
|
7
|
+
def to_html
|
8
|
+
generic_input_wrapping do
|
9
|
+
builder.phone_field(method, input_html_options)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module FlexaFormtasticBootstrap
|
2
|
+
module Inputs
|
3
|
+
class RadioInput < Formtastic::Inputs::RadioInput
|
4
|
+
include Base
|
5
|
+
include Base::Choices
|
6
|
+
|
7
|
+
def to_html
|
8
|
+
clearfix_div_wrapping do
|
9
|
+
legend_html <<
|
10
|
+
input_div_wrapping do
|
11
|
+
choices_group_wrapping do
|
12
|
+
collection.map { |choice|
|
13
|
+
choice_wrapping(choice_wrapping_html_options(choice)) do
|
14
|
+
choice_html(choice)
|
15
|
+
end
|
16
|
+
}.join("\n").html_safe
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def choice_html(choice)
|
23
|
+
template.content_tag(:label, label_html_options.merge(:for => choice_input_dom_id(choice), :class => nil)) do
|
24
|
+
builder.radio_button(input_name, choice_value(choice), input_html_options.merge(choice_html_options(choice)).merge(:required => false)) <<
|
25
|
+
|
26
|
+
choice_label(choice)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module FlexaFormtasticBootstrap
|
2
|
+
module Inputs
|
3
|
+
class RangeInput < Formtastic::Inputs::RangeInput
|
4
|
+
include Base
|
5
|
+
include Base::Stringish
|
6
|
+
|
7
|
+
def to_html
|
8
|
+
generic_input_wrapping do
|
9
|
+
builder.range_field(method, input_html_options)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module FlexaFormtasticBootstrap
|
2
|
+
module Inputs
|
3
|
+
class SearchInput < Formtastic::Inputs::SearchInput
|
4
|
+
include Base
|
5
|
+
include Base::Stringish
|
6
|
+
|
7
|
+
def to_html
|
8
|
+
generic_input_wrapping do
|
9
|
+
builder.search_field(method, input_html_options)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module FlexaFormtasticBootstrap
|
2
|
+
module Inputs
|
3
|
+
class SelectInput < Formtastic::Inputs::SelectInput
|
4
|
+
include Base
|
5
|
+
|
6
|
+
def to_html
|
7
|
+
generic_input_wrapping do
|
8
|
+
options[:group_by] ? grouped_select_html : select_html
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module FlexaFormtasticBootstrap
|
2
|
+
module Inputs
|
3
|
+
class StringInput < Formtastic::Inputs::StringInput
|
4
|
+
include Base
|
5
|
+
include Base::Stringish
|
6
|
+
|
7
|
+
def to_html
|
8
|
+
generic_input_wrapping do
|
9
|
+
builder.text_field(method, input_html_options)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module FlexaFormtasticBootstrap
|
2
|
+
module Inputs
|
3
|
+
class TimeInput < Formtastic::Inputs::TimeInput
|
4
|
+
include Base
|
5
|
+
include Base::Stringish
|
6
|
+
include Base::Timeish
|
7
|
+
|
8
|
+
def to_html
|
9
|
+
generic_input_wrapping do
|
10
|
+
time_input_html
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module FlexaFormtasticBootstrap
|
2
|
+
module Inputs
|
3
|
+
class TimeZoneInput < Formtastic::Inputs::TimeZoneInput
|
4
|
+
include Base
|
5
|
+
|
6
|
+
def to_html
|
7
|
+
generic_input_wrapping do
|
8
|
+
builder.time_zone_select(method, priority_zones, input_options, input_html_options)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module FlexaFormtasticBootstrap
|
2
|
+
module Inputs
|
3
|
+
class UrlInput < Formtastic::Inputs::UrlInput
|
4
|
+
include Base
|
5
|
+
include Base::Stringish
|
6
|
+
|
7
|
+
def to_html
|
8
|
+
generic_input_wrapping do
|
9
|
+
builder.url_field(method, input_html_options)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require "flexa_formtastic_bootstrap/inputs/base"
|
2
|
+
require "flexa_formtastic_bootstrap/inputs/boolean_input"
|
3
|
+
require "flexa_formtastic_bootstrap/inputs/check_boxes_input"
|
4
|
+
require "flexa_formtastic_bootstrap/inputs/date_input"
|
5
|
+
require "flexa_formtastic_bootstrap/inputs/datetime_input"
|
6
|
+
require "flexa_formtastic_bootstrap/inputs/email_input"
|
7
|
+
require "flexa_formtastic_bootstrap/inputs/file_input"
|
8
|
+
require "flexa_formtastic_bootstrap/inputs/hidden_input"
|
9
|
+
require "flexa_formtastic_bootstrap/inputs/number_input"
|
10
|
+
require "flexa_formtastic_bootstrap/inputs/password_input"
|
11
|
+
require "flexa_formtastic_bootstrap/inputs/phone_input"
|
12
|
+
require "flexa_formtastic_bootstrap/inputs/radio_input"
|
13
|
+
require "flexa_formtastic_bootstrap/inputs/range_input"
|
14
|
+
require "flexa_formtastic_bootstrap/inputs/search_input"
|
15
|
+
require "flexa_formtastic_bootstrap/inputs/select_input"
|
16
|
+
require "flexa_formtastic_bootstrap/inputs/string_input"
|
17
|
+
require "flexa_formtastic_bootstrap/inputs/text_input"
|
18
|
+
require "flexa_formtastic_bootstrap/inputs/time_input"
|
19
|
+
require "flexa_formtastic_bootstrap/inputs/time_zone_input"
|
20
|
+
require "flexa_formtastic_bootstrap/inputs/url_input"
|
21
|
+
|
22
|
+
module FlexaFormtasticBootstrap
|
23
|
+
module Inputs
|
24
|
+
|
25
|
+
include Base
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
@@ -0,0 +1,6 @@
|
|
1
|
+
require "formtastic"
|
2
|
+
require "flexa_formtastic_bootstrap/engine" if defined?(::Rails) # For tests
|
3
|
+
require "flexa_formtastic_bootstrap/helpers"
|
4
|
+
require "flexa_formtastic_bootstrap/inputs"
|
5
|
+
require "flexa_formtastic_bootstrap/form_builder"
|
6
|
+
require "action_view/helpers/text_field_date_helper"
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module FlexaFormtasticBootstrap
|
2
|
+
module Inputs
|
3
|
+
class BooleanInput < Formtastic::Inputs::BooleanInput
|
4
|
+
include Base
|
5
|
+
|
6
|
+
def to_html
|
7
|
+
|
8
|
+
#options[:boolean][:class] = 'checkbox'
|
9
|
+
|
10
|
+
#label_html_options
|
11
|
+
|
12
|
+
clearfix_div_wrapping do
|
13
|
+
#empty_label <<
|
14
|
+
hidden_field_html <<
|
15
|
+
input_div_wrapping(:block) do
|
16
|
+
#template.content_tag(:ul, :class => "inputs-list") do
|
17
|
+
#template.content_tag(:li) do
|
18
|
+
label_with_nested_checkbox
|
19
|
+
#end
|
20
|
+
#end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def label_text_with_embedded_checkbox
|
26
|
+
# That newline matters! Why, I do no not know.
|
27
|
+
check_box_html << "\n" << template.content_tag(:span) do label_text end
|
28
|
+
end
|
29
|
+
|
30
|
+
# Need this for formatting to work.
|
31
|
+
def empty_label
|
32
|
+
template.content_tag(:label) do end
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
module
|
1
|
+
module FlexaFormtasticBootstrap
|
2
2
|
module Inputs
|
3
|
-
class LookupInput <
|
3
|
+
class LookupInput < FlexaFormtasticBootstrap::Inputs::StringInput
|
4
4
|
|
5
5
|
def to_html
|
6
6
|
lookup_feedback_fields = Array.new
|
@@ -8,9 +8,8 @@ module FormtasticBootstrap
|
|
8
8
|
lookup_feedback_fields<<options[:lookup][:display]
|
9
9
|
lookup_feedback_fields = lookup_feedback_fields+options[:lookup][:fill].to_a if (options[:lookup][:fill].present?&&options[:lookup][:fill].count>0)
|
10
10
|
lookup_url = options[:lookup][:route]+"?fill="+lookup_feedback_fields.join(",")
|
11
|
-
|
12
|
-
|
13
|
-
#ihtml_display = input_html_options
|
11
|
+
|
12
|
+
generic_input_wrapping do
|
14
13
|
ihtml_display = input_html_options
|
15
14
|
ihtml_display[:readonly]=true
|
16
15
|
ihtml_display[:style]="background-color: white;border: 1px solid #CCC;" if !input_html_options[:readonly]
|
@@ -20,10 +19,11 @@ module FormtasticBootstrap
|
|
20
19
|
builder.hidden_field(method, {:id=>method})
|
21
20
|
|
22
21
|
iframe = template.content_tag(:iframe,"",:src=>lookup_url,:marginheight=>0,:height=>"350",:width=>"100%",:frameborder=>"0")
|
23
|
-
str
|
24
|
-
|
22
|
+
str << template.content_tag(:div,iframe,:id=>'div_'+method.to_s,:class=>"modal hide fade",:style=>"display: none; ")
|
25
23
|
|
26
|
-
|
24
|
+
#se for usar sem o Bootstrap voltar para a linha abaixo
|
25
|
+
#label_html << template.content_tag(:div,str,:style=>"margin:0;padding:0;display:inline")
|
26
|
+
template.content_tag(:div,str,:style=>"margin:0;padding:0;display:inline")
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -34,17 +34,9 @@ module FormtasticBootstrap
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
#def input_html_options
|
38
|
-
# super.reject { |k, v| [:min, :max, :step].include?(k) }
|
39
|
-
#end
|
40
|
-
|
41
37
|
def wrapper_html_options
|
42
38
|
super.merge(:class => "#{super[:class]}" )
|
43
39
|
end
|
44
|
-
|
45
|
-
#def input_html_options
|
46
|
-
#super.merge(:class => "datePicker")
|
47
|
-
#end
|
48
40
|
|
49
41
|
end
|
50
42
|
end
|
data/lib/flexa_lib/inputs.rb
CHANGED
data/lib/flexa_lib.rb
CHANGED
@@ -58,7 +58,7 @@ require 'will_paginate_twitter_bootstrap'
|
|
58
58
|
require 'table_for_collection'
|
59
59
|
|
60
60
|
#FORMTASTIC
|
61
|
-
require '
|
61
|
+
require 'flexa_formtastic_bootstrap'
|
62
62
|
|
63
63
|
|
64
64
|
########################################
|
@@ -83,10 +83,10 @@ end
|
|
83
83
|
|
84
84
|
|
85
85
|
####################################
|
86
|
-
#### Definir o
|
86
|
+
#### Definir o flexa_formtastic_bootstrap
|
87
87
|
#### como FormBuilder Padrão
|
88
88
|
###################################
|
89
|
-
Formtastic::Helpers::FormHelper.builder =
|
89
|
+
Formtastic::Helpers::FormHelper.builder = FlexaFormtasticBootstrap::FormBuilder
|
90
90
|
|
91
91
|
|
92
92
|
#validacoes de CPF e CNPJ
|
@@ -24,14 +24,11 @@ $(document).ready(function(){
|
|
24
24
|
});
|
25
25
|
|
26
26
|
|
27
|
-
$('input.ui-datepicker').datepicker();
|
28
|
-
$('.datePicker').datepicker();
|
29
27
|
|
30
28
|
if ($("input:text:visible:first").get(0).tagName) {
|
31
29
|
$("input:text:visible:first").focus();
|
32
30
|
} else {
|
33
31
|
$(document).focus();
|
34
|
-
alert('a');
|
35
32
|
}
|
36
33
|
var pressedCtrl = false;
|
37
34
|
$(document).keyup(function (e) {
|
@@ -64,5 +61,13 @@ $(document).ready(function(){
|
|
64
61
|
$("#search").closest('form').submit()
|
65
62
|
}
|
66
63
|
});
|
64
|
+
|
65
|
+
try {
|
66
|
+
$('input.ui-datepicker').datepicker();
|
67
|
+
$('.datePicker').datepicker();
|
68
|
+
} catch(err) {
|
69
|
+
nil;
|
70
|
+
}
|
71
|
+
|
67
72
|
});
|
68
73
|
|
@@ -3,7 +3,6 @@
|
|
3
3
|
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
4
|
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
5
|
*= require_self
|
6
|
-
*= require formtastic-bootstrap
|
7
6
|
*/
|
8
7
|
|
9
8
|
@import "bootstrap/variables"; // Modify this for custom colors, font-sizes, etc
|
@@ -30,3 +29,8 @@
|
|
30
29
|
//Inclui os CSS personalizados
|
31
30
|
@import "override";
|
32
31
|
|
32
|
+
|
33
|
+
//CSS para FormtasticBootstrap
|
34
|
+
.hidden {
|
35
|
+
display: none;
|
36
|
+
}
|