effective_form_inputs 1.2.6 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +5 -5
  2. data/app/assets/config/effective_form_inputs_manifest.js +2 -0
  3. data/app/assets/javascripts/effective_ckeditor_text_area/initialize.js.coffee +5 -2
  4. data/app/assets/stylesheets/effective_select/{bootstrap-theme.css → bootstrap-theme.scss} +0 -0
  5. data/app/assets/stylesheets/effective_select/{select2.css → select2.scss} +0 -0
  6. data/app/helpers/effective_bootstrap3_helper.rb +14 -7
  7. data/app/models/effective/{form_input.rb → form_builder_input.rb} +1 -1
  8. data/app/models/{inputs/effective_date_picker/input.rb → effective/form_builder_inputs/effective_date_picker.rb} +3 -4
  9. data/app/models/{inputs/effective_date_time_picker/input.rb → effective/form_builder_inputs/effective_date_time_picker.rb} +3 -4
  10. data/app/models/{inputs/effective_email/input.rb → effective/form_builder_inputs/effective_email.rb} +3 -4
  11. data/app/models/{inputs/effective_panel_select/input.rb → effective/form_builder_inputs/effective_panel_select.rb} +3 -3
  12. data/app/models/{inputs/effective_price/input.rb → effective/form_builder_inputs/effective_price.rb} +3 -4
  13. data/app/models/{inputs/effective_radio_buttons/input.rb → effective/form_builder_inputs/effective_radio_buttons.rb} +3 -4
  14. data/app/models/{inputs/effective_select/input.rb → effective/form_builder_inputs/effective_select.rb} +3 -3
  15. data/app/models/{inputs/effective_static_control/input.rb → effective/form_builder_inputs/effective_static_control.rb} +3 -4
  16. data/app/models/{inputs/effective_tel/input.rb → effective/form_builder_inputs/effective_tel.rb} +3 -4
  17. data/app/models/{inputs/effective_time_picker/input.rb → effective/form_builder_inputs/effective_time_picker.rb} +3 -4
  18. data/app/models/{inputs/effective_url/input.rb → effective/form_builder_inputs/effective_url.rb} +3 -4
  19. data/lib/effective_form_inputs.rb +1 -0
  20. data/lib/effective_form_inputs/engine.rb +11 -9
  21. data/lib/effective_form_inputs/form_builder_inputs.rb +50 -0
  22. data/{app/models → lib/effective_form_inputs}/inputs/effective_ckeditor_text_area_input.rb +1 -1
  23. data/{app/models → lib/effective_form_inputs}/inputs/effective_date_picker_input.rb +1 -1
  24. data/{app/models → lib/effective_form_inputs}/inputs/effective_date_time_picker_input.rb +1 -1
  25. data/{app/models → lib/effective_form_inputs}/inputs/effective_email_input.rb +1 -1
  26. data/{app/models → lib/effective_form_inputs}/inputs/effective_panel_select_input.rb +1 -1
  27. data/{app/models → lib/effective_form_inputs}/inputs/effective_price_input.rb +1 -1
  28. data/{app/models → lib/effective_form_inputs}/inputs/effective_radio_buttons_input.rb +1 -1
  29. data/lib/effective_form_inputs/inputs/effective_select_input.rb +38 -0
  30. data/{app/models → lib/effective_form_inputs}/inputs/effective_static_control_input.rb +1 -1
  31. data/{app/models → lib/effective_form_inputs}/inputs/effective_tel_input.rb +1 -1
  32. data/{app/models → lib/effective_form_inputs}/inputs/effective_time_picker_input.rb +1 -1
  33. data/{app/models → lib/effective_form_inputs}/inputs/effective_url_input.rb +1 -1
  34. data/lib/effective_form_inputs/version.rb +1 -1
  35. data/{app → lib}/validators/effective_email_validator.rb +0 -0
  36. data/{app → lib}/validators/effective_tel_validator.rb +0 -0
  37. data/{app → lib}/validators/effective_url_validator.rb +0 -0
  38. metadata +51 -38
  39. data/app/models/effective/form_builder_inputs.rb +0 -50
  40. data/app/models/inputs/effective_ckeditor_text_area/input.rb +0 -37
  41. data/app/models/inputs/effective_select_input.rb +0 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f1bc6bc4e4dd8b9f47f184c3084520c675b98048
4
- data.tar.gz: 4622b3fc38c58ebea44de3a4aeb01f92fbe36838
2
+ SHA256:
3
+ metadata.gz: 88550b46987c90edb9bb01a20d3ff521935692a6dd80d7ebeaeb6d0c24f45722
4
+ data.tar.gz: fad585a100bdc29d3a7be5b8030fe715ea922081f1e59fc47f53788c65cbe648
5
5
  SHA512:
6
- metadata.gz: 5eee846f4cc189d5ff1ea06bd3b991fea50bb75312b4cab43fb4a8696664957656c37fa3de06d6c9aac0a7e70b7da9f7cc84206b5661b309d91f9055cff13431
7
- data.tar.gz: f914da9f59d83f0ee60f2fc56a4a295b26bbf18698c8c86b91a597824d7b4689120fa1370f0e34d45a6bee4576aceb7c5219e10702e1d8f66a238963b2df5154
6
+ metadata.gz: 226e750f1e9b3af3dbd3e32b370e07a2d73812fa2a15b464ce8a87031f253a9f00d5e7b5356ad44e4469ac9b433be01693b2e928587d215232383764b7a938f3
7
+ data.tar.gz: 541baa0cb0c066f3f1d55ef17601f05b0981849891341871a812c2c4810bfc90ab8b2ffa023b841d6d843fd4b87e6dc8bf1c62420f3dbc4e0b225c617296ba37
@@ -0,0 +1,2 @@
1
+ //= link_directory ../javascripts .js
2
+ //= link_directory ../stylesheets .css
@@ -63,12 +63,15 @@ initCkeditor = (textarea) ->
63
63
  filebrowserBrowseUrl: '/effective/assets'
64
64
  filebrowserImageBrowseUrl: '/effective/assets?only=images'
65
65
  toolbar_full: [
66
- { name: 'definedstyles', items: ['Format'] },
67
66
  { name: 'html', items: ['ShowBlocks'] },
68
67
  { name: 'justify', items: ['JustifyLeft', 'JustifyCenter', 'JustifyRight']}
69
- { name: 'basicstyles', items: ['Bold', 'Italic', 'Underline'] },
68
+ { name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript'] },
70
69
  { name: 'insert', items: ['Link', 'Table', '-', 'Image', 'oembed', 'EffectiveAssets'] },
71
70
  { name: 'lists', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent'] },
71
+ '/'
72
+ { name: 'definedstyles', items: ['Format'] },
73
+ { name: 'styles', items: ['Styles', 'RemoveFormat'] },
74
+ { name: 'colors', items: ['TextColor', 'BGColor'] }
72
75
  ],
73
76
  toolbar_simple: [
74
77
  { name: 'definedstyles', items: ['Format'] },
@@ -104,18 +104,25 @@ module EffectiveBootstrap3Helper
104
104
  end
105
105
 
106
106
  def glyphicon_tag(icon, options = {})
107
- if icon.to_s.start_with?('glyphicon-')
108
- content_tag(:span, '', {class: "glyphicon #{icon}"}.merge(options))
109
- else
110
- content_tag(:span, '', {class: "glyphicon glyphicon-#{icon}"}.merge(options))
107
+ icon = icon.to_s.sub('glyphicon-', '')
108
+
109
+ icon = case icon
110
+ when 'destroy' then 'trash'
111
+ when 'show' then 'eye-open'
112
+ when 'settings' then 'cog'
113
+ when 'approve' then 'ok'
114
+ when 'decline' then 'remove'
115
+ else icon
111
116
  end
117
+
118
+ content_tag(:span, '', {class: "glyphicon glyphicon-#{icon}"}.merge(options))
112
119
  end
113
120
 
121
+
114
122
  def glyphicon_to(icon, path, options = {})
115
- content_tag(:a, options.merge(href: path)) do
116
- glyphicon_tag(icon)
117
- end
123
+ content_tag(:a, glyphicon_tag(icon), options.merge(href: path))
118
124
  end
125
+
119
126
  alias_method :bootstrap_icon_to, :glyphicon_to
120
127
  alias_method :glyph_icon_to, :glyphicon_to
121
128
 
@@ -1,5 +1,5 @@
1
1
  module Effective
2
- class FormInput
2
+ class FormBuilderInput
3
3
 
4
4
  def initialize(object, object_name, template, method, opts, html_opts = {})
5
5
  @object = object
@@ -1,6 +1,6 @@
1
- module Inputs
2
- module EffectiveDatePicker
3
- class Input < Effective::FormInput
1
+ module Effective
2
+ module FormBuilderInputs
3
+ class EffectiveDatePicker < Effective::FormBuilderInput
4
4
  delegate :content_tag, :text_field_tag, :to => :@template
5
5
 
6
6
  def default_input_js
@@ -65,4 +65,3 @@ module Inputs
65
65
  end
66
66
  end
67
67
  end
68
-
@@ -1,6 +1,6 @@
1
- module Inputs
2
- module EffectiveDateTimePicker
3
- class Input < Effective::FormInput
1
+ module Effective
2
+ module FormBuilderInputs
3
+ class EffectiveDateTimePicker < Effective::FormBuilderInput
4
4
  delegate :content_tag, :text_field_tag, :to => :@template
5
5
 
6
6
  def default_input_js
@@ -59,4 +59,3 @@ module Inputs
59
59
  end
60
60
  end
61
61
  end
62
-
@@ -1,6 +1,6 @@
1
- module Inputs
2
- module EffectiveEmail
3
- class Input < Effective::FormInput
1
+ module Effective
2
+ module FormBuilderInputs
3
+ class EffectiveEmail < Effective::FormBuilderInput
4
4
  delegate :content_tag, :email_field_tag, :to => :@template
5
5
 
6
6
  def default_input_html
@@ -25,4 +25,3 @@ module Inputs
25
25
  end
26
26
  end
27
27
  end
28
-
@@ -4,9 +4,9 @@
4
4
  # Only supports one category, and one kind of objects
5
5
  # No polymorphic stuff
6
6
 
7
- module Inputs
8
- module EffectivePanelSelect
9
- class Input < Effective::FormInput
7
+ module Effective
8
+ module FormBuilderInputs
9
+ class EffectivePanelSelect < Effective::FormBuilderInput
10
10
  delegate :grouped_collection_select, :hidden_field_tag, :text_field_tag, :render, to: :@template
11
11
 
12
12
  def default_options
@@ -1,6 +1,6 @@
1
- module Inputs
2
- module EffectivePrice
3
- class Input < Effective::FormInput
1
+ module Effective
2
+ module FormBuilderInputs
3
+ class EffectivePrice < Effective::FormBuilderInput
4
4
  delegate :content_tag, :number_to_currency, :text_field_tag, :hidden_field_tag, :to => :@template
5
5
 
6
6
  def default_options
@@ -53,4 +53,3 @@ module Inputs
53
53
  end
54
54
  end
55
55
  end
56
-
@@ -1,6 +1,6 @@
1
- module Inputs
2
- module EffectiveRadioButtons
3
- class Input < Effective::FormInput
1
+ module Effective
2
+ module FormBuilderInputs
3
+ class EffectiveRadioButtons < Effective::FormBuilderInput
4
4
  delegate :collection_radio_buttons, :content_tag, :label_tag, :radio_button_tag, :image_tag, :to => :@template
5
5
 
6
6
  BOOLEAN_COLLECTION = [['Yes', true], ['No', false]]
@@ -113,4 +113,3 @@ module Inputs
113
113
  end
114
114
  end
115
115
  end
116
-
@@ -1,6 +1,6 @@
1
- module Inputs
2
- module EffectiveSelect
3
- class Input < Effective::FormInput
1
+ module Effective
2
+ module FormBuilderInputs
3
+ class EffectiveSelect < Effective::FormBuilderInput
4
4
  delegate :collection_select, :grouped_collection_select, :hidden_field, :to => :@template
5
5
 
6
6
  def default_options
@@ -1,6 +1,6 @@
1
- module Inputs
2
- module EffectiveStaticControl
3
- class Input < Effective::FormInput
1
+ module Effective
2
+ module FormBuilderInputs
3
+ class EffectiveStaticControl < Effective::FormBuilderInput
4
4
  delegate :content_tag, :to => :@template
5
5
 
6
6
  def default_input_html
@@ -25,4 +25,3 @@ module Inputs
25
25
  end
26
26
  end
27
27
  end
28
-
@@ -1,6 +1,6 @@
1
- module Inputs
2
- module EffectiveTel
3
- class Input < Effective::FormInput
1
+ module Effective
2
+ module FormBuilderInputs
3
+ class EffectiveTel < Effective::FormBuilderInput
4
4
  delegate :content_tag, :telephone_field_tag, :to => :@template
5
5
 
6
6
  DEFAULT_TEL_MASK = '(999) 999-9999? x99999'
@@ -62,4 +62,3 @@ module Inputs
62
62
  end
63
63
  end
64
64
  end
65
-
@@ -1,6 +1,6 @@
1
- module Inputs
2
- module EffectiveTimePicker
3
- class Input < Effective::FormInput
1
+ module Effective
2
+ module FormBuilderInputs
3
+ class EffectiveTimePicker < Effective::FormBuilderInput
4
4
  delegate :content_tag, :text_field_tag, :to => :@template
5
5
 
6
6
  def default_input_js
@@ -44,4 +44,3 @@ module Inputs
44
44
  end
45
45
  end
46
46
  end
47
-
@@ -1,6 +1,6 @@
1
- module Inputs
2
- module EffectiveUrl
3
- class Input < Effective::FormInput
1
+ module Effective
2
+ module FormBuilderInputs
3
+ class EffectiveUrl < Effective::FormBuilderInput
4
4
  FA_FIELD_NAMES = ['facebook', 'google', 'linkedin', 'twitter', 'vimeo', 'youtube']
5
5
 
6
6
  delegate :content_tag, :url_field_tag, :to => :@template
@@ -84,4 +84,3 @@ module Inputs
84
84
  end
85
85
  end
86
86
  end
87
-
@@ -1,5 +1,6 @@
1
1
  require 'effective_form_inputs/engine'
2
2
  require 'effective_form_inputs/version'
3
+ require 'effective_form_inputs/form_builder_inputs'
3
4
 
4
5
  module EffectiveFormInputs
5
6
  end
@@ -2,22 +2,24 @@ module EffectiveFormInputs
2
2
  class Engine < ::Rails::Engine
3
3
  engine_name 'effective_form_inputs'
4
4
 
5
- config.autoload_paths += Dir["#{config.root}/app/models/**/"]
5
+ config.autoload_paths += Dir[
6
+ "#{config.root}/lib/validators/",
7
+ "#{config.root}/lib/effective_form_inputs/inputs",
8
+
9
+ ]
10
+
11
+ config.eager_load_paths += Dir[
12
+ "#{config.root}/lib/validators/",
13
+ "#{config.root}/lib/effective_form_inputs/inputs",
14
+ ]
6
15
 
7
16
  initializer 'effective_form_inputs.action_view' do |app|
8
17
  Rails.application.config.to_prepare do
9
18
  ActiveSupport.on_load :action_view do
10
- ActionView::Helpers::FormBuilder.send(:include, Effective::FormBuilderInputs)
19
+ ActionView::Helpers::FormBuilder.send(:include, ::Effective::FormBuilderInputs)
11
20
  end
12
21
  end
13
22
  end
14
23
 
15
- initializer 'effective_form_inputs.check_for_effective_bootstrap' do |app|
16
- Rails.application.config.to_prepare do
17
- if defined?(EffectiveBootstrap)
18
- raise 'effective_form_inputs and effective_bootstrap cannot be run alongside eachother. Sorry.'
19
- end
20
- end
21
- end
22
24
  end
23
25
  end
@@ -0,0 +1,50 @@
1
+ module Effective
2
+ module FormBuilderInputs
3
+ def effective_ckeditor_text_area(method, options_tag = nil, options = {}, html_options = {})
4
+ EffectiveCkeditorTextArea.new(@object, @object_name, @template, method, options, html_options).to_html
5
+ end
6
+
7
+ def effective_date_time_picker(method, options = {})
8
+ EffectiveDateTimePicker.new(@object, @object_name, @template, method, options, options).to_html
9
+ end
10
+
11
+ def effective_date_picker(method, options = {})
12
+ EffectiveDatePicker.new(@object, @object_name, @template, method, options, options).to_html
13
+ end
14
+
15
+ def effective_panel_select(method, options_tag = nil, options = {}, html_options = {})
16
+ options[:collection] = options_tag
17
+ EffectivePanelSelect.new(@object, @object_name, @template, method, options, html_options).to_html
18
+ end
19
+
20
+ def effective_price(method, options = {})
21
+ EffectivePrice.new(@object, @object_name, @template, method, options, options).to_html
22
+ end
23
+
24
+ def effective_radio_buttons(method, options = {})
25
+ EffectiveRadioButtons.new(@object, @object_name, @template, method, options, options).to_html
26
+ end
27
+
28
+ def effective_static_control(method, options = {})
29
+ EffectiveStaticControl.new(@object, @object_name, @template, method, options, options).to_html
30
+ end
31
+
32
+ def effective_select(method, options_tag = nil, options = {}, html_options = {})
33
+ options[:collection] = options_tag
34
+ EffectiveSelect.new(@object, @object_name, @template, method, options, html_options).to_html
35
+ end
36
+
37
+ def effective_tel(method, options_tag = nil, options = {}, html_options = {})
38
+ EffectiveTel.new(@object, @object_name, @template, method, options, html_options).to_html
39
+ end
40
+
41
+ def effective_time_picker(method, options = {})
42
+ EffectiveTimePicker.new(@object, @object_name, @template, method, options, options).to_html
43
+ end
44
+
45
+ def effective_url(method, options_tag = nil, options = {}, html_options = {})
46
+ EffectiveUrl.new(@object, @object_name, @template, method, options, html_options).to_html
47
+ end
48
+
49
+ end
50
+ end
@@ -5,7 +5,7 @@ if defined?(SimpleForm)
5
5
 
6
6
  class EffectiveCkeditorTextAreaInput < SimpleForm::Inputs::StringInput
7
7
  def input(wrapper_options = nil)
8
- Inputs::EffectiveCkeditorTextArea::Input.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
8
+ Effective::FormBuilderInputs::EffectiveCkeditorTextArea.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
9
9
  end
10
10
  end
11
11
 
@@ -5,7 +5,7 @@ if defined?(SimpleForm)
5
5
 
6
6
  class EffectiveDatePickerInput < SimpleForm::Inputs::StringInput
7
7
  def input(wrapper_options = nil)
8
- Inputs::EffectiveDatePicker::Input.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
8
+ Effective::FormBuilderInputs::EffectiveDatePicker.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
9
9
  end
10
10
  end
11
11
 
@@ -5,7 +5,7 @@ if defined?(SimpleForm)
5
5
 
6
6
  class EffectiveDateTimePickerInput < SimpleForm::Inputs::StringInput
7
7
  def input(wrapper_options = nil)
8
- Inputs::EffectiveDateTimePicker::Input.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
8
+ Effective::FormBuilderInputs::EffectiveDateTimePicker.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
9
9
  end
10
10
  end
11
11
 
@@ -5,7 +5,7 @@ if defined?(SimpleForm)
5
5
 
6
6
  class EffectiveEmailInput < SimpleForm::Inputs::StringInput
7
7
  def input(wrapper_options = nil)
8
- Inputs::EffectiveEmail::Input.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
8
+ Effective::FormBuilderInputs::EffectiveEmail.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
9
9
  end
10
10
  end
11
11
 
@@ -11,7 +11,7 @@ if defined?(SimpleForm)
11
11
  options[:label_method] = label_method unless options[:polymorphic]
12
12
  options[:value_method] = value_method unless options[:polymorphic]
13
13
 
14
- Inputs::EffectivePanelSelect::Input.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
14
+ Effective::FormBuilderInputs::EffectivePanelSelect.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
15
15
  end
16
16
  end
17
17
 
@@ -5,7 +5,7 @@ if defined?(SimpleForm)
5
5
 
6
6
  class EffectivePriceInput < SimpleForm::Inputs::StringInput
7
7
  def input(wrapper_options = nil)
8
- Inputs::EffectivePrice::Input.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
8
+ Effective::FormBuilderInputs::EffectivePrice.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
9
9
  end
10
10
  end
11
11
 
@@ -31,7 +31,7 @@ if defined?(SimpleForm)
31
31
 
32
32
  options[:wrapper_html][:class] = options[:wrapper_html][:class].join(' ')
33
33
 
34
- Inputs::EffectiveRadioButtons::Input.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
34
+ Effective::FormBuilderInputs::EffectiveRadioButtons.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
35
35
  end
36
36
 
37
37
  end
@@ -0,0 +1,38 @@
1
+ # = simple_form_for @thing do |f|
2
+ # = f.input :category, :as => :effective_select
3
+
4
+ if defined?(SimpleForm)
5
+
6
+ class EffectiveSelectInput < SimpleForm::Inputs::CollectionSelectInput
7
+ def input(wrapper_options = nil)
8
+ label_method, value_method = (detect_collection_methods rescue [:to_s, :to_s])
9
+
10
+ options[:collection] = collection
11
+ options[:label_method] = label_method unless options[:polymorphic]
12
+ options[:value_method] = value_method unless options[:polymorphic]
13
+
14
+ Effective::FormBuilderInputs::EffectiveSelect.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
15
+ end
16
+
17
+ # Apply ActsAsArchived behavior.
18
+ def collection
19
+ @collection ||= begin
20
+ collection = translate(options.delete(:collection)) || self.class.boolean_collection
21
+ collection.respond_to?(:call) ? collection.call : collection.to_a
22
+ end
23
+ end
24
+
25
+ def translate(collection)
26
+ return collection unless object.respond_to?(:new_record?)
27
+ return collection unless collection.respond_to?(:klass) && collection.klass.respond_to?(:acts_as_archived?)
28
+
29
+ if object.new_record?
30
+ collection.unarchived
31
+ else
32
+ collection.unarchived.or(collection.archived.where(collection.klass.primary_key => object.send(attribute_name)))
33
+ end
34
+ end
35
+
36
+ end
37
+
38
+ end
@@ -5,7 +5,7 @@ if defined?(SimpleForm)
5
5
 
6
6
  class EffectiveStaticControlInput < SimpleForm::Inputs::StringInput
7
7
  def input(wrapper_options = nil)
8
- Inputs::EffectiveStaticControl::Input.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
8
+ Effective::FormBuilderInputs::EffectiveStaticControl.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
9
9
  end
10
10
  end
11
11
 
@@ -5,7 +5,7 @@ if defined?(SimpleForm)
5
5
 
6
6
  class EffectiveTelInput < SimpleForm::Inputs::StringInput
7
7
  def input(wrapper_options = nil)
8
- Inputs::EffectiveTel::Input.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
8
+ Effective::FormBuilderInputs::EffectiveTel.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
9
9
  end
10
10
  end
11
11
 
@@ -5,7 +5,7 @@ if defined?(SimpleForm)
5
5
 
6
6
  class EffectiveTimePickerInput < SimpleForm::Inputs::StringInput
7
7
  def input(wrapper_options = nil)
8
- Inputs::EffectiveTimePicker::Input.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
8
+ Effective::FormBuilderInputs::EffectiveTimePicker.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
9
9
  end
10
10
  end
11
11
 
@@ -7,7 +7,7 @@ if defined?(SimpleForm)
7
7
 
8
8
  class EffectiveUrlInput < SimpleForm::Inputs::StringInput
9
9
  def input(wrapper_options = nil)
10
- Inputs::EffectiveUrl::Input.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
10
+ Effective::FormBuilderInputs::EffectiveUrl.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
11
11
  end
12
12
  end
13
13
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveFormInputs
2
- VERSION = '1.2.6'.freeze
2
+ VERSION = '1.4.0'.freeze
3
3
  end
File without changes
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_form_inputs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-08 00:00:00.000000000 Z
11
+ date: 2021-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 3.1.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: sassc
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  description: Collection of Form Inputs
42
56
  email:
43
57
  - info@codeandeffect.com
@@ -47,6 +61,7 @@ extra_rdoc_files: []
47
61
  files:
48
62
  - MIT-LICENSE
49
63
  - README.md
64
+ - app/assets/config/effective_form_inputs_manifest.js
50
65
  - app/assets/javascripts/effective_ckeditor_text_area/initialize.js.coffee
51
66
  - app/assets/javascripts/effective_ckeditor_text_area/input.js
52
67
  - app/assets/javascripts/effective_date_picker/initialize.js.coffee
@@ -82,52 +97,51 @@ files:
82
97
  - app/assets/stylesheets/effective_form_inputs.scss
83
98
  - app/assets/stylesheets/effective_panel_select/input.scss
84
99
  - app/assets/stylesheets/effective_radio_buttons/input.scss
85
- - app/assets/stylesheets/effective_select/bootstrap-theme.css
100
+ - app/assets/stylesheets/effective_select/bootstrap-theme.scss
86
101
  - app/assets/stylesheets/effective_select/input.scss
87
102
  - app/assets/stylesheets/effective_select/overrides.scss
88
- - app/assets/stylesheets/effective_select/select2.css
103
+ - app/assets/stylesheets/effective_select/select2.scss
89
104
  - app/assets/stylesheets/effective_time_picker/input.scss
90
105
  - app/helpers/effective_bootstrap3_helper.rb
91
106
  - app/helpers/effective_form_inputs_helper.rb
92
- - app/models/effective/form_builder_inputs.rb
93
- - app/models/effective/form_input.rb
94
- - app/models/inputs/effective_ckeditor_text_area/input.rb
95
- - app/models/inputs/effective_ckeditor_text_area_input.rb
96
- - app/models/inputs/effective_date_picker/input.rb
97
- - app/models/inputs/effective_date_picker_input.rb
98
- - app/models/inputs/effective_date_time_picker/input.rb
99
- - app/models/inputs/effective_date_time_picker_input.rb
100
- - app/models/inputs/effective_email/input.rb
101
- - app/models/inputs/effective_email_input.rb
102
- - app/models/inputs/effective_panel_select/input.rb
103
- - app/models/inputs/effective_panel_select_input.rb
104
- - app/models/inputs/effective_price/input.rb
105
- - app/models/inputs/effective_price_input.rb
106
- - app/models/inputs/effective_radio_buttons/input.rb
107
- - app/models/inputs/effective_radio_buttons_input.rb
108
- - app/models/inputs/effective_select/input.rb
109
- - app/models/inputs/effective_select_input.rb
110
- - app/models/inputs/effective_static_control/input.rb
111
- - app/models/inputs/effective_static_control_input.rb
112
- - app/models/inputs/effective_tel/input.rb
113
- - app/models/inputs/effective_tel_input.rb
114
- - app/models/inputs/effective_time_picker/input.rb
115
- - app/models/inputs/effective_time_picker_input.rb
116
- - app/models/inputs/effective_url/input.rb
117
- - app/models/inputs/effective_url_input.rb
118
- - app/validators/effective_email_validator.rb
119
- - app/validators/effective_tel_validator.rb
120
- - app/validators/effective_url_validator.rb
107
+ - app/models/effective/form_builder_input.rb
108
+ - app/models/effective/form_builder_inputs/effective_date_picker.rb
109
+ - app/models/effective/form_builder_inputs/effective_date_time_picker.rb
110
+ - app/models/effective/form_builder_inputs/effective_email.rb
111
+ - app/models/effective/form_builder_inputs/effective_panel_select.rb
112
+ - app/models/effective/form_builder_inputs/effective_price.rb
113
+ - app/models/effective/form_builder_inputs/effective_radio_buttons.rb
114
+ - app/models/effective/form_builder_inputs/effective_select.rb
115
+ - app/models/effective/form_builder_inputs/effective_static_control.rb
116
+ - app/models/effective/form_builder_inputs/effective_tel.rb
117
+ - app/models/effective/form_builder_inputs/effective_time_picker.rb
118
+ - app/models/effective/form_builder_inputs/effective_url.rb
121
119
  - app/views/effective/effective_panel_select/_input.html.haml
122
120
  - app/views/effective/style_guide/_effective_form_inputs.html.haml
123
121
  - lib/effective_form_inputs.rb
124
122
  - lib/effective_form_inputs/engine.rb
123
+ - lib/effective_form_inputs/form_builder_inputs.rb
124
+ - lib/effective_form_inputs/inputs/effective_ckeditor_text_area_input.rb
125
+ - lib/effective_form_inputs/inputs/effective_date_picker_input.rb
126
+ - lib/effective_form_inputs/inputs/effective_date_time_picker_input.rb
127
+ - lib/effective_form_inputs/inputs/effective_email_input.rb
128
+ - lib/effective_form_inputs/inputs/effective_panel_select_input.rb
129
+ - lib/effective_form_inputs/inputs/effective_price_input.rb
130
+ - lib/effective_form_inputs/inputs/effective_radio_buttons_input.rb
131
+ - lib/effective_form_inputs/inputs/effective_select_input.rb
132
+ - lib/effective_form_inputs/inputs/effective_static_control_input.rb
133
+ - lib/effective_form_inputs/inputs/effective_tel_input.rb
134
+ - lib/effective_form_inputs/inputs/effective_time_picker_input.rb
135
+ - lib/effective_form_inputs/inputs/effective_url_input.rb
125
136
  - lib/effective_form_inputs/version.rb
137
+ - lib/validators/effective_email_validator.rb
138
+ - lib/validators/effective_tel_validator.rb
139
+ - lib/validators/effective_url_validator.rb
126
140
  homepage: https://github.com/code-and-effect/effective_form_inputs
127
141
  licenses:
128
142
  - MIT
129
143
  metadata: {}
130
- post_install_message:
144
+ post_install_message:
131
145
  rdoc_options: []
132
146
  require_paths:
133
147
  - lib
@@ -142,9 +156,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
156
  - !ruby/object:Gem::Version
143
157
  version: '0'
144
158
  requirements: []
145
- rubyforge_project:
146
- rubygems_version: 2.4.5.1
147
- signing_key:
159
+ rubygems_version: 3.1.2
160
+ signing_key:
148
161
  specification_version: 4
149
162
  summary: Collection of Form Inputs
150
163
  test_files: []
@@ -1,50 +0,0 @@
1
- module Effective
2
- module FormBuilderInputs
3
- def effective_ckeditor_text_area(method, options_tag = nil, options = {}, html_options = {})
4
- Inputs::EffectiveCkeditorTextArea::Input.new(@object, @object_name, @template, method, options, html_options).to_html
5
- end
6
-
7
- def effective_date_time_picker(method, options = {})
8
- Inputs::EffectiveDateTimePicker::Input.new(@object, @object_name, @template, method, options, options).to_html
9
- end
10
-
11
- def effective_date_picker(method, options = {})
12
- Inputs::EffectiveDatePicker::Input.new(@object, @object_name, @template, method, options, options).to_html
13
- end
14
-
15
- def effective_panel_select(method, options_tag = nil, options = {}, html_options = {})
16
- options[:collection] = options_tag
17
- Inputs::EffectivePanelSelect::Input.new(@object, @object_name, @template, method, options, html_options).to_html
18
- end
19
-
20
- def effective_price(method, options = {})
21
- Inputs::EffectivePrice::Input.new(@object, @object_name, @template, method, options, options).to_html
22
- end
23
-
24
- def effective_radio_buttons(method, options = {})
25
- Inputs::EffectiveRadioButtons::Input.new(@object, @object_name, @template, method, options, options).to_html
26
- end
27
-
28
- def effective_static_control(method, options = {})
29
- Inputs::EffectiveStaticControl::Input.new(@object, @object_name, @template, method, options, options).to_html
30
- end
31
-
32
- def effective_select(method, options_tag = nil, options = {}, html_options = {})
33
- options[:collection] = options_tag
34
- Inputs::EffectiveSelect::Input.new(@object, @object_name, @template, method, options, html_options).to_html
35
- end
36
-
37
- def effective_tel(method, options_tag = nil, options = {}, html_options = {})
38
- Inputs::EffectiveTel::Input.new(@object, @object_name, @template, method, options, html_options).to_html
39
- end
40
-
41
- def effective_time_picker(method, options = {})
42
- Inputs::EffectiveTimePicker::Input.new(@object, @object_name, @template, method, options, options).to_html
43
- end
44
-
45
- def effective_url(method, options_tag = nil, options = {}, html_options = {})
46
- Inputs::EffectiveUrl::Input.new(@object, @object_name, @template, method, options, html_options).to_html
47
- end
48
-
49
- end
50
- end
@@ -1,37 +0,0 @@
1
- module Inputs
2
- module EffectiveCkeditorTextArea
3
- class Input < Effective::FormInput
4
- delegate :content_tag, :text_area_tag, :asset_path, :to => :@template
5
-
6
- def default_input_js
7
- {
8
- effective_assets: defined?(EffectiveAssets).present?,
9
- effective_ckeditor_js_path: asset_path('effective_ckeditor.js'),
10
- effective_ckeditor_css_path: asset_path('effective_ckeditor.css'),
11
- contentsCss: (
12
- case options[:contentsCss]
13
- when :bootstrap
14
- 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'
15
- when false
16
- nil
17
- else
18
- options[:contentsCss] || asset_path('application.css')
19
- end
20
- ),
21
- toolbar: options[:toolbar],
22
- height: options[:height],
23
- width: options[:width]
24
- }.compact
25
- end
26
-
27
- def default_input_html
28
- {class: 'effective_ckeditor_text_area text'}
29
- end
30
-
31
- def to_html
32
- text_area_tag(field_name, value, tag_options)
33
- end
34
- end
35
- end
36
- end
37
-
@@ -1,18 +0,0 @@
1
- # = simple_form_for @thing do |f|
2
- # = f.input :category, :as => :effective_select
3
-
4
- if defined?(SimpleForm)
5
-
6
- class EffectiveSelectInput < SimpleForm::Inputs::CollectionSelectInput
7
- def input(wrapper_options = nil)
8
- label_method, value_method = (detect_collection_methods rescue [:to_s, :to_s])
9
-
10
- options[:collection] = collection
11
- options[:label_method] = label_method unless options[:polymorphic]
12
- options[:value_method] = value_method unless options[:polymorphic]
13
-
14
- Inputs::EffectiveSelect::Input.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
15
- end
16
- end
17
-
18
- end