effective_style_guide 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cee7176157fe6f96185e73a9bf8a100de9af7587
4
- data.tar.gz: 050ec66244a1c3d1b78e13c97a1eb03189c19b0a
3
+ metadata.gz: e9247fa86e4242f37a1bf4fc04b11443e6f395ba
4
+ data.tar.gz: 4bef82aeac5e7335224371463172a210d7649897
5
5
  SHA512:
6
- metadata.gz: 3c652b203139a4577d687e8f3657d2addd3e08cb6ce7d03ee530766a1088ff6a4a9f54f5dc8a63854e296fe6fc0b78ae8b623e5b4e82cecf173f4078fd073220
7
- data.tar.gz: 8e1a8b4696a898f8eabb7736e9d814f70ca3a89335e77a1411e913b1665cd253457947bab0426a2e69e89e9e11ef0f7fcc1dcf51b206b01481f6fd7c9b56b47c
6
+ metadata.gz: d52e2ad4df0adcd1fe20b89c87fcdf43cca58ba237e8c561a8cbf1de82ef24ec422cbf9fb48f712fbf0ae4c474694deff58432d556f0f772b9b1eb3a6d3d0fc7
7
+ data.tar.gz: 7b50f30022917b85a8becdf96edcb33a9bd011e0e7d64e6d23d01d3794269c9adc9023885b7036d370c0b61bc036271dea2548962a0e3bbfb66b56f182b500bd
@@ -7,7 +7,12 @@ module Effective
7
7
  end
8
8
 
9
9
  def self.column(name, sql_type = nil, default = nil, null = true)
10
- columns << ::ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null)
10
+ if Rails.version >= '4.2.0'
11
+ cast_type = "ActiveRecord::Type::#{sql_type.to_s.titleize.sub('Datetime', 'DateTime')}".constantize.new()
12
+ columns << ::ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, cast_type, sql_type.to_s, null)
13
+ else
14
+ columns << ::ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null)
15
+ end
11
16
  end
12
17
 
13
18
  column :id, :integer
@@ -4,13 +4,20 @@
4
4
  = f.input :password, :hint => 'please enter a password (this is a password field)'
5
5
  = f.input :number, :hint => 'please enter a number (this is a number field)'
6
6
  = f.input :range, :as => :range, :hint => 'please enter a number range (this is a range field)'
7
- = f.input :category, :as => :select, :collection => 10.times.map { |x| "Category #{x}"}, :hint => 'please select a category (this is a select field)'
8
- = f.input :drink, :as => :check_boxes, :wrapper => :horizontal_inline_radio_and_checkboxes, :collection => ['Water', 'Tea', 'Coffee', 'Soda'], :hint => 'please select one or more drinks (this is a check_boxes :wrapper => :horizontal_inline_radio_and_checkboxes field)'
9
- = f.input :food, :as => :radio_buttons, :wrapper => :horizontal_inline_radio_and_checkboxes, :collection => ['Pasta', 'Rice', 'Potato', 'Couscous'], :hint => 'please select one food (this is a radio_buttons :wrapper => :horizontal_inline_radio_and_checkboxes field)'
7
+
8
+ - if defined?(EffectiveFormInputs)
9
+ = f.input :category, :as => :effective_select, :collection => EffectiveStyleGuide.colors, :hint => 'please select a category (this is an effective_select from EffectiveFormInputs)', :placeholder => 'Please choose a category'
10
+ = f.input :category, :as => :effective_select, :collection => EffectiveStyleGuide.colors, :hint => 'please select multiple categories (this is an effective_select from EffectiveFormInputs)', :placeholder => 'Please choose multiple categories', :multiple => true
11
+ = f.input :category, :as => :effective_select, :collection => EffectiveStyleGuide.colors, :hint => 'please create or select multiple tags (this is an effective_select from EffectiveFormInputs)', :placeholder => 'Create or select multiple tags', :multiple => true, :tags => true
12
+ - else
13
+ = f.input :category, :as => :select, :collection => EffectiveStyleGuide.colors, :hint => 'please select a category (this is a select field)'
14
+
15
+ = f.input :drink, :as => :check_boxes, :wrapper => :horizontal_inline_radio_and_checkboxes, :collection => EffectiveStyleGuide.foods, :hint => 'please select one or more drinks (this is a check_boxes :wrapper => :horizontal_inline_radio_and_checkboxes field)'
16
+ = f.input :food, :as => :radio_buttons, :wrapper => :horizontal_inline_radio_and_checkboxes, :collection => EffectiveStyleGuide.foods, :hint => 'please select one food (this is a radio_buttons :wrapper => :horizontal_inline_radio_and_checkboxes field)'
10
17
  = f.input :content, :hint => 'please enter a whole bunch of content (this is a textarea)'
11
18
  = f.input :archived, :hint => 'please select true or false (this is a boolean field)'
12
- = f.input :drink, :as => :check_boxes, :collection => ['Water', 'Tea', 'Coffee', 'Soda'], :hint => 'please select one or more drinks (this is a check_boxes field)'
13
- = f.input :food, :as => :radio_buttons, :collection => ['Pasta', 'Rice', 'Potato', 'Couscous'], :hint => 'please select one food (this is a radio_buttons field)'
19
+ = f.input :drink, :as => :check_boxes, :collection => EffectiveStyleGuide.foods, :hint => 'please select one or more drinks (this is a check_boxes field)'
20
+ = f.input :food, :as => :radio_buttons, :collection => EffectiveStyleGuide.foods, :hint => 'please select one food (this is a radio_buttons field)'
14
21
 
15
22
  - if defined?(EffectiveAssets)
16
23
  = f.input :files, :as => :asset_box, :hint => 'please upload one or more files (this is an asset_box field from EffectiveAssets)'
@@ -38,13 +45,20 @@
38
45
  = f.input :password, :hint => 'please enter a password (this is a password field)'
39
46
  = f.input :number, :hint => 'please enter a number (this is a number field)'
40
47
  = f.input :range, :as => :range, :hint => 'please enter a number range (this is a range field)'
41
- = f.input :category, :as => :select, :collection => 10.times.map { |x| "Category #{x}"}, :hint => 'please select a category (this is a select field)'
48
+
49
+ - if defined?(EffectiveFormInputs)
50
+ = f.input :category, :as => :effective_select, :collection => EffectiveStyleGuide.colors, :hint => 'please select a category (this is an effective_select from EffectiveFormInputs)', :placeholder => 'Please choose a category'
51
+ = f.input :category, :as => :effective_select, :collection => EffectiveStyleGuide.colors, :hint => 'please select multiple categories (this is an effective_select from EffectiveFormInputs)', :placeholder => 'Please choose multiple categories', :multiple => true
52
+ = f.input :category, :as => :effective_select, :collection => EffectiveStyleGuide.colors, :hint => 'please create or select multiple tags (this is an effective_select from EffectiveFormInputs)', :placeholder => 'Create or select multiple tags', :multiple => true, :tags => true
53
+ - else
54
+ = f.input :category, :as => :select, :collection => EffectiveStyleGuide.colors, :hint => 'please select a category (this is a select field)'
55
+
42
56
  = f.input :drink, :as => :check_boxes, :wrapper => :horizontal_inline_radio_and_checkboxes, :collection => ['Water', 'Tea', 'Coffee', 'Soda'], :hint => 'please select one or more drinks (this is a check_boxes :wrapper => :horizontal_inline_radio_and_checkboxes field)'
43
57
  = f.input :food, :as => :radio_buttons, :wrapper => :horizontal_inline_radio_and_checkboxes, :collection => ['Pasta', 'Rice', 'Potato', 'Couscous'], :hint => 'please select one food (this is a radio_buttons :wrapper => :horizontal_inline_radio_and_checkboxes field)'
44
58
  = f.input :content, :hint => 'please enter a whole bunch of content (this is a textarea)'
45
59
  = f.input :archived, :wrapper => :horizontal_boolean, :hint => 'please select true or false (this is a boolean field)'
46
- = f.input :drink, :wrapper => :horizontal_radio_and_checkboxes, :as => :check_boxes, :collection => ['Water', 'Tea', 'Coffee', 'Soda'], :hint => 'please select one or more drinks (this is a check_boxes field)'
47
- = f.input :food, :wrapper => :horizontal_radio_and_checkboxes, :as => :radio_buttons, :collection => ['Pasta', 'Rice', 'Potato', 'Couscous'], :hint => 'please select one food (this is a radio_buttons field)'
60
+ = f.input :drink, :wrapper => :horizontal_radio_and_checkboxes, :as => :check_boxes, :collection => EffectiveStyleGuide.foods, :hint => 'please select one or more drinks (this is a check_boxes field)'
61
+ = f.input :food, :wrapper => :horizontal_radio_and_checkboxes, :as => :radio_buttons, :collection => EffectiveStyleGuide.foods, :hint => 'please select one food (this is a radio_buttons field)'
48
62
 
49
63
  - if defined?(EffectiveAssets)
50
64
  = f.input :files, :as => :asset_box, :hint => 'please upload one or more files (this is an asset_box field from EffectiveAssets)'
@@ -1,7 +1,10 @@
1
1
  = simple_form_for Effective::StyleGuide.new(), :html => {:class => 'form-inline'}, :wrapper => :inline_form, :url => '/' do |f|
2
2
  = f.input :title, :placeholder => 'Enter title'
3
3
  = f.input :email, :placeholder => 'Enter email'
4
- = f.input :category, :as => :select, :collection => 10.times.map { |x| "Category #{x}"}
4
+ - if defined?(EffectiveFormInputs)
5
+ = f.input :category, :as => :effective_select, :collection => EffectiveStyleGuide.colors
6
+ - else
7
+ = f.input :category, :as => :select, :collection => EffectiveStyleGuide.colors
5
8
  = f.input :archived
6
9
  = f.button :submit
7
10
 
@@ -11,6 +14,12 @@
11
14
  = simple_form_for Effective::StyleGuide.new().tap { |s| s.valid? }, :html => {:class => 'form-inline'}, :wrapper => :inline_form, :url => '/' do |f|
12
15
  = f.input :title, :placeholder => 'Enter title'
13
16
  = f.input :email, :placeholder => 'Enter email'
14
- = f.input :category, :as => :select, :collection => 10.times.map { |x| "Category #{x}"}
17
+ - if defined?(EffectiveFormInputs)
18
+ = f.input :category, :as => :effective_select, :collection => EffectiveStyleGuide.colors
19
+ - else
20
+ = f.input :category, :as => :select, :collection => EffectiveStyleGuide.colors
15
21
  = f.input :archived
16
22
  = f.button :submit
23
+
24
+
25
+
@@ -4,13 +4,20 @@
4
4
  = f.input :password, :hint => 'please enter a password (this is a password field)'
5
5
  = f.input :number, :hint => 'please enter a number (this is a number field)'
6
6
  = f.input :range, :as => :range, :hint => 'please enter a number range (this is a range field)'
7
- = f.input :category, :as => :select, :collection => 10.times.map { |x| "Category #{x}"}, :hint => 'please select a category (this is a select field)'
8
- = f.input :drink, :as => :check_boxes, :wrapper => :vertical_inline_radio_and_checkboxes, :collection => ['Water', 'Tea', 'Coffee', 'Soda'], :hint => 'please select one or more drinks (this is a check_boxes :wrapper => :vertical_inline_radio_and_checkboxes field)'
9
- = f.input :food, :as => :radio_buttons, :wrapper => :vertical_inline_radio_and_checkboxes, :collection => ['Pasta', 'Rice', 'Potato', 'Couscous'], :hint => 'please select one food (this is a radio_buttons :wrapper => :vertical_inline_radio_and_checkboxes field)'
7
+
8
+ - if defined?(EffectiveFormInputs)
9
+ = f.input :category, :as => :effective_select, :collection => EffectiveStyleGuide.colors, :hint => 'please select a category (this is an effective_select from EffectiveFormInputs)', :placeholder => 'Please choose a category'
10
+ = f.input :category, :as => :effective_select, :collection => EffectiveStyleGuide.colors, :hint => 'please select multiple categories (this is an effective_select from EffectiveFormInputs)', :placeholder => 'Please choose multiple categories', :multiple => true
11
+ = f.input :category, :as => :effective_select, :collection => EffectiveStyleGuide.colors, :hint => 'please create or select multiple tags (this is an effective_select from EffectiveFormInputs)', :placeholder => 'Create or select multiple tags', :multiple => true, :tags => true
12
+ - else
13
+ = f.input :category, :as => :select, :collection => EffectiveStyleGuide.colors, :hint => 'please select a category (this is a select field)'
14
+
15
+ = f.input :drink, :as => :check_boxes, :wrapper => :vertical_inline_radio_and_checkboxes, :collection => EffectiveStyleGuide.foods, :hint => 'please select one or more drinks (this is a check_boxes :wrapper => :vertical_inline_radio_and_checkboxes field)'
16
+ = f.input :food, :as => :radio_buttons, :wrapper => :vertical_inline_radio_and_checkboxes, :collection => EffectiveStyleGuide.foods, :hint => 'please select one food (this is a radio_buttons :wrapper => :vertical_inline_radio_and_checkboxes field)'
10
17
  = f.input :content, :hint => 'please enter a whole bunch of content (this is a textarea)'
11
18
  = f.input :archived, :hint => 'please select true or false (this is a boolean field)'
12
- = f.input :drink, :as => :check_boxes, :collection => ['Water', 'Tea', 'Coffee', 'Soda'], :hint => 'please select one or more drinks (this is a check_boxes field)'
13
- = f.input :food, :as => :radio_buttons, :collection => ['Pasta', 'Rice', 'Potato', 'Couscous'], :hint => 'please select one food (this is a radio_buttons field)'
19
+ = f.input :drink, :as => :check_boxes, :collection => EffectiveStyleGuide.foods, :hint => 'please select one or more drinks (this is a check_boxes field)'
20
+ = f.input :food, :as => :radio_buttons, :collection => EffectiveStyleGuide.foods, :hint => 'please select one food (this is a radio_buttons field)'
14
21
 
15
22
  - if defined?(EffectiveAssets)
16
23
  = f.input :files, :as => :asset_box, :hint => 'please upload one or more files (this is an asset_box field from EffectiveAssets)'
@@ -37,13 +44,20 @@
37
44
  = f.input :password, :hint => 'please enter a password (this is a password field)'
38
45
  = f.input :number, :hint => 'please enter a number (this is a number field)'
39
46
  = f.input :range, :as => :range, :hint => 'please enter a number range (this is a range field)'
40
- = f.input :category, :as => :select, :collection => 10.times.map { |x| "Category #{x}"}, :hint => 'please select a category (this is a select field)'
41
- = f.input :drink, :as => :check_boxes, :wrapper => :vertical_inline_radio_and_checkboxes, :collection => ['Water', 'Tea', 'Coffee', 'Soda'], :hint => 'please select one or more drinks (this is a check_boxes :wrapper => :vertical_inline_radio_and_checkboxes field)'
42
- = f.input :food, :as => :radio_buttons, :wrapper => :vertical_inline_radio_and_checkboxes, :collection => ['Pasta', 'Rice', 'Potato', 'Couscous'], :hint => 'please select one food (this is a radio_buttons :wrapper => :vertical_inline_radio_and_checkboxes field)'
47
+
48
+ - if defined?(EffectiveFormInputs)
49
+ = f.input :category, :as => :effective_select, :collection => EffectiveStyleGuide.colors, :hint => 'please select a category (this is an effective_select from EffectiveFormInputs)', :placeholder => 'Please choose a category'
50
+ = f.input :category, :as => :effective_select, :collection => EffectiveStyleGuide.colors, :hint => 'please select multiple categories (this is an effective_select from EffectiveFormInputs)', :placeholder => 'Please choose multiple categories', :multiple => true
51
+ = f.input :category, :as => :effective_select, :collection => EffectiveStyleGuide.colors, :hint => 'please create or select multiple tags (this is an effective_select from EffectiveFormInputs)', :placeholder => 'Create or select multiple tags', :multiple => true, :tags => true
52
+ - else
53
+ = f.input :category, :as => :select, :collection => EffectiveStyleGuide.colors, :hint => 'please select a category (this is a select field)'
54
+
55
+ = f.input :drink, :as => :check_boxes, :wrapper => :vertical_inline_radio_and_checkboxes, :collection => EffectiveStyleGuide.foods, :hint => 'please select one or more drinks (this is a check_boxes :wrapper => :vertical_inline_radio_and_checkboxes field)'
56
+ = f.input :food, :as => :radio_buttons, :wrapper => :vertical_inline_radio_and_checkboxes, :collection => EffectiveStyleGuide.foods, :hint => 'please select one food (this is a radio_buttons :wrapper => :vertical_inline_radio_and_checkboxes field)'
43
57
  = f.input :content, :hint => 'please enter a whole bunch of content (this is a textarea)'
44
58
  = f.input :archived, :hint => 'please select true or false (this is a boolean field)'
45
- = f.input :drink, :as => :check_boxes, :collection => ['Water', 'Tea', 'Coffee', 'Soda'], :hint => 'please select one or more drinks (this is a check_boxes field)'
46
- = f.input :food, :as => :radio_buttons, :collection => ['Pasta', 'Rice', 'Potato', 'Couscous'], :hint => 'please select one food (this is a radio_buttons field)'
59
+ = f.input :drink, :as => :check_boxes, :collection => EffectiveStyleGuide.foods, :hint => 'please select one or more drinks (this is a check_boxes field)'
60
+ = f.input :food, :as => :radio_buttons, :collection => EffectiveStyleGuide.foods, :hint => 'please select one food (this is a radio_buttons field)'
47
61
 
48
62
  - if defined?(EffectiveAssets)
49
63
  = f.input :files, :as => :asset_box, :hint => 'please upload one or more files (this is an asset_box field from EffectiveAssets)'
@@ -1,3 +1,3 @@
1
1
  module EffectiveStyleGuide
2
- VERSION = '1.2.0'.freeze
2
+ VERSION = '1.3.0'.freeze
3
3
  end
@@ -17,4 +17,12 @@ module EffectiveStyleGuide
17
17
  true
18
18
  end
19
19
 
20
+ def self.colors
21
+ ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet', 'black', 'white', 'gray']
22
+ end
23
+
24
+ def self.foods
25
+ ['Water', 'Tea', 'Coffee', 'Soda']
26
+ end
27
+
20
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_style_guide
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-06 00:00:00.000000000 Z
11
+ date: 2015-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails