effective_style_guide 1.3.6 → 1.3.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8dfea8edbaa5b2fc2297eb904c2180de18af025a
4
- data.tar.gz: 44603b1d8ebe2c47ee77fe274ab832e5750fdfdb
3
+ metadata.gz: 216aeae702c2c0e1f55229ca6b337d3f550c7aff
4
+ data.tar.gz: 0ed0c1daf2fa7a52139aa974a8242eb4b683a2b2
5
5
  SHA512:
6
- metadata.gz: 2d07834a7dfaae98b85d8742a278305574c016a1adbba513cfc77aae439ed1016dfef5d7863c541a3994838cf0ff9b73bbfcd86605300d24542c213785d49ec6
7
- data.tar.gz: 76a5767e3f0f5f415241de519c3d6e834d45dda6e524e27e18da8754594bbe178e680bafd0b49f96485bd95e392310b8abe1396bd35258612e11f79b02dcdebc
6
+ metadata.gz: 39ad4c8d26ebf06b3402d57725c43d909e61c31cbee47463558dcdc778012d0830d15ee3cc84696b5912de8ff28ad9e0b43d18ea1d48611f42fbbc2175c5d3df
7
+ data.tar.gz: 82055edca53970a0c435a12d85749b23c94f9ed438d8ae1df7db04f4d7f003164abcca558a1cde3d3d5ca71dbe808b6ded92c53275f9ebf96cdff3ccf50d4853
data/README.md CHANGED
@@ -51,7 +51,7 @@ This file will be automatically detected and included in the /styleguide page.
51
51
 
52
52
  simple_form (https://github.com/plataformatec/simple_form) is a pretty good FormBuilder gem.
53
53
 
54
- At this time of writing, the latest simple_form v3.1.0.rc2 includes a bootstrap3 config/initializer that gets very close to generating the correct bootstrap3 form HTML (as per bootstrap's example page).
54
+ At this time of writing, the latest simple_form v3.2.1 includes a bootstrap3 config/initializer that gets very close to generating the correct bootstrap3 form HTML (as per bootstrap's example page).
55
55
 
56
56
  Very close, but not quite perfect.
57
57
 
@@ -337,6 +337,18 @@ rescue_from Effective::AccessDenied do |exception|
337
337
  end
338
338
  ```
339
339
 
340
+
341
+ ### Permissions
342
+
343
+ The permissions you actually want to define are as follows (using CanCan):
344
+
345
+ ```ruby
346
+ if user.is?(:admin)
347
+ can :show, Effective::StyleGuide
348
+ end
349
+ ```
350
+
351
+
340
352
  ## License
341
353
 
342
354
  MIT License. Copyright [Code and Effect Inc.](http://www.codeandeffect.com/)
@@ -1,38 +1,18 @@
1
1
  module Effective
2
- class StyleGuide < ActiveRecord::Base
3
- acts_as_asset_box :files => 1..6 if defined?(EffectiveAssets)
2
+ class StyleGuide
3
+ include ActiveModel::Model
4
4
 
5
- def self.columns
6
- @columns ||= []
5
+ if defined?(EffectiveAssets)
6
+ acts_as_asset_box files: 1..6
7
7
  end
8
8
 
9
- def self.column(name, sql_type = nil, default = nil, null = true)
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
16
- end
17
-
18
- column :id, :integer
19
-
20
- column :title, :string
21
- column :email, :string
22
- column :password, :string
23
- column :number, :integer
24
- column :range, :integer
25
- column :category, :string
26
- column :content, :text
27
- column :archived, :boolean
28
- column :drink, :string
29
- column :food, :string
30
- column :price, :integer
31
- column :updated_at, :datetime
32
- column :publish_on, :date
33
- column :static_text, :string
9
+ ATTRIBUTES = [
10
+ :id, :title, :email, :password, :number, :range, :category, :content,
11
+ :archived, :drink, :food, :price, :updated_at, :publish_on, :static_text
12
+ ]
34
13
 
35
- validates_presence_of :id, :title, :email, :password, :number, :range, :category, :content, :archived, :drink, :food, :price, :updated_at, :publish_on, :static_text
14
+ attr_accessor *ATTRIBUTES
15
+ validates *ATTRIBUTES, presence: true
36
16
 
37
17
  def static_text
38
18
  'some static text'
@@ -1,4 +1,4 @@
1
- - variations = ['Success', 'Info', 'Notice', 'Alert', 'Warning', 'Danger']
1
+ - variations = ['Success', 'Info', 'Warning', 'Danger']
2
2
 
3
3
  - variations.each do |variation|
4
4
  .alert{:class => "alert-#{variation.downcase}"}
@@ -6,26 +6,63 @@
6
6
  = f.input :range, :as => :range, :hint => 'please enter a number range (this is a range field)'
7
7
 
8
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
9
+ = f.input :category,
10
+ :as => :effective_select,
11
+ :collection => EffectiveStyleGuide.colors,
12
+ :hint => 'please select a category (this is an effective_select from EffectiveFormInputs)',
13
+ :placeholder => 'Please choose a category'
14
+
15
+ = f.input :category,
16
+ :as => :effective_select,
17
+ :collection => EffectiveStyleGuide.colors,
18
+ :hint => 'please select multiple categories (this is an effective_select from EffectiveFormInputs)',
19
+ :placeholder => 'Please choose multiple categories', :multiple => true
20
+
21
+ = f.input :category,
22
+ :as => :effective_select,
23
+ :collection => EffectiveStyleGuide.colors,
24
+ :hint => 'please create or select multiple tags (this is an effective_select from EffectiveFormInputs)',
25
+ :placeholder => 'Create or select multiple tags',
26
+ :multiple => true,
27
+ :tags => true
12
28
  - else
13
- = f.input :category, :as => :select, :collection => EffectiveStyleGuide.colors, :hint => 'please select a category (this is a select field)'
29
+ = f.input :category,
30
+ :as => :select,
31
+ :collection => EffectiveStyleGuide.colors,
32
+ :hint => 'please select a category (this is a select field)'
14
33
 
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)'
17
34
  = f.input :content, :hint => 'please enter a whole bunch of content (this is a textarea)'
18
35
  = f.input :archived, :hint => 'please select true or false (this is a boolean 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)'
36
+
37
+ = f.input :drink,
38
+ :as => :check_boxes,
39
+ :collection => EffectiveStyleGuide.foods,
40
+ :hint => 'please select one or more drinks (this is a check_boxes :wrapper => :horizontal_radio_and_checkboxes field)',
41
+ :wrapper => :horizontal_radio_and_checkboxes
42
+
43
+ = f.input :food,
44
+ :as => :radio_buttons,
45
+ :collection => EffectiveStyleGuide.foods,
46
+ :hint => 'please select one food (this is a radio_buttons :wrapper => :horizontal_radio_and_checkboxes field)',
47
+ :wrapper => :horizontal_radio_and_checkboxes
21
48
 
22
49
  - if defined?(EffectiveAssets)
23
- = f.input :files, :as => :asset_box, :hint => 'please upload one or more files (this is an asset_box field from EffectiveAssets)'
50
+ = f.input :files,
51
+ :as => :asset_box,
52
+ :hint => 'please upload one or more files (this is an asset_box field from EffectiveAssets)'
24
53
 
25
54
  - if defined?(EffectiveFormInputs)
26
- = f.input :updated_at, :as => :effective_date_time_picker, :hint => 'please enter a datetime (this is an effective_date_time_picker field from EffectiveFormInputs)'
27
- = f.input :publish_on, :as => :effective_date_picker, :hint => 'please enter a date (this is an effective_date_picker field from EffectiveFormInputs)'
28
- = f.input :static_text, :as => :effective_static_control, :hint => 'you cant enter anything here (this is an effective_static_control field from EffectiveFormInputs)'
55
+ = f.input :updated_at,
56
+ :as => :effective_date_time_picker,
57
+ :hint => 'please enter a datetime (this is an effective_date_time_picker field from EffectiveFormInputs)'
58
+
59
+ = f.input :publish_on,
60
+ :as => :effective_date_picker,
61
+ :hint => 'please enter a date (this is an effective_date_picker field from EffectiveFormInputs)'
62
+
63
+ = f.input :static_text,
64
+ :as => :effective_static_control,
65
+ :hint => "you can't enter anything here (this is an effective_static_control field from EffectiveFormInputs)"
29
66
  - else
30
67
  = f.input :updated_at, :as => :datetime, :hint => 'please enter a date and time (this is a datetime field)'
31
68
  = f.input :publish_on, :as => :date, :hint => 'please enter a date (this is a date field)'
@@ -34,7 +71,10 @@
34
71
  = f.input :price, :as => :price, :hint => 'please enter a price (this is a price field from EffectiveOrders)'
35
72
 
36
73
  .form-group
37
- .col-sm-offset-3.col-sm-9= f.button :submit
74
+ .col-sm-offset-3.col-sm-9
75
+ = f.button :submit, 'Save', class: 'btn btn-primary'
76
+ = f.button :submit, 'Save and Add New'
77
+ = link_to 'Cancel', '#'
38
78
 
39
79
  %hr
40
80
  .inline-example Form Horizontal Invalid State
@@ -47,26 +87,63 @@
47
87
  = f.input :range, :as => :range, :hint => 'please enter a number range (this is a range field)'
48
88
 
49
89
  - 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
90
+ = f.input :category,
91
+ :as => :effective_select,
92
+ :collection => EffectiveStyleGuide.colors,
93
+ :hint => 'please select a category (this is an effective_select from EffectiveFormInputs)',
94
+ :placeholder => 'Please choose a category'
95
+
96
+ = f.input :category,
97
+ :as => :effective_select,
98
+ :collection => EffectiveStyleGuide.colors,
99
+ :hint => 'please select multiple categories (this is an effective_select from EffectiveFormInputs)',
100
+ :placeholder => 'Please choose multiple categories', :multiple => true
101
+
102
+ = f.input :category,
103
+ :as => :effective_select,
104
+ :collection => EffectiveStyleGuide.colors,
105
+ :hint => 'please create or select multiple tags (this is an effective_select from EffectiveFormInputs)',
106
+ :placeholder => 'Create or select multiple tags',
107
+ :multiple => true,
108
+ :tags => true
53
109
  - else
54
- = f.input :category, :as => :select, :collection => EffectiveStyleGuide.colors, :hint => 'please select a category (this is a select field)'
110
+ = f.input :category,
111
+ :as => :select,
112
+ :collection => EffectiveStyleGuide.colors,
113
+ :hint => 'please select a category (this is a select field)'
55
114
 
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)'
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)'
58
115
  = f.input :content, :hint => 'please enter a whole bunch of content (this is a textarea)'
59
116
  = f.input :archived, :wrapper => :horizontal_boolean, :hint => 'please select true or false (this is a boolean 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)'
117
+
118
+ = f.input :drink,
119
+ :as => :check_boxes,
120
+ :collection => EffectiveStyleGuide.foods,
121
+ :hint => 'please select one or more drinks (this is a check_boxes :wrapper => :horizontal_radio_and_checkboxes field)',
122
+ :wrapper => :horizontal_radio_and_checkboxes
123
+
124
+ = f.input :food,
125
+ :as => :radio_buttons,
126
+ :collection => EffectiveStyleGuide.foods,
127
+ :hint => 'please select one food (this is a radio_buttons :wrapper => :horizontal_radio_and_checkboxes field)',
128
+ :wrapper => :horizontal_radio_and_checkboxes
62
129
 
63
130
  - if defined?(EffectiveAssets)
64
- = f.input :files, :as => :asset_box, :hint => 'please upload one or more files (this is an asset_box field from EffectiveAssets)'
131
+ = f.input :files,
132
+ :as => :asset_box,
133
+ :hint => 'please upload one or more files (this is an asset_box field from EffectiveAssets)'
65
134
 
66
135
  - if defined?(EffectiveFormInputs)
67
- = f.input :updated_at, :as => :effective_date_time_picker, :hint => 'please enter a datetime (this is an effective_date_time_picker field from EffectiveFormInputs)'
68
- = f.input :publish_on, :as => :effective_date_picker, :hint => 'please enter a date (this is an effective_date_picker field from EffectiveFormInputs)'
69
- = f.input :static_text, :as => :effective_static_control, :hint => 'you cant enter anything here (this is an effective_static_control field from EffectiveFormInputs)'
136
+ = f.input :updated_at,
137
+ :as => :effective_date_time_picker,
138
+ :hint => 'please enter a datetime (this is an effective_date_time_picker field from EffectiveFormInputs)'
139
+
140
+ = f.input :publish_on,
141
+ :as => :effective_date_picker,
142
+ :hint => 'please enter a date (this is an effective_date_picker field from EffectiveFormInputs)'
143
+
144
+ = f.input :static_text,
145
+ :as => :effective_static_control,
146
+ :hint => 'you cant enter anything here (this is an effective_static_control field from EffectiveFormInputs)'
70
147
  - else
71
148
  = f.input :updated_at, :as => :datetime, :hint => 'please enter a date and time (this is a datetime field)'
72
149
  = f.input :publish_on, :as => :date, :hint => 'please enter a date (this is a date field)'
@@ -75,4 +152,7 @@
75
152
  = f.input :price, :as => :price, :hint => 'please enter a price (this is a price field from EffectiveOrders)'
76
153
 
77
154
  .form-group
78
- .col-sm-offset-3.col-sm-9= f.button :submit
155
+ .col-sm-offset-3.col-sm-9
156
+ = f.button :submit, 'Save', class: 'btn btn-primary'
157
+ = f.button :submit, 'Save and Add New'
158
+ = link_to 'Cancel', '#'
@@ -1,12 +1,21 @@
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
+
4
5
  - if defined?(EffectiveFormInputs)
5
- = f.input :category, :as => :effective_select, :collection => EffectiveStyleGuide.colors, :placeholder => 'Select color'
6
+ = f.input :category,
7
+ :as => :effective_select,
8
+ :collection => EffectiveStyleGuide.colors,
9
+ :placeholder => 'Select color'
6
10
  - else
7
- = f.input :category, :as => :select, :collection => EffectiveStyleGuide.colors, :placeholder => 'Select color'
11
+ = f.input :category,
12
+ :as => :select,
13
+ :collection => EffectiveStyleGuide.colors,
14
+ :placeholder => 'Select color'
15
+
8
16
  = f.input :archived
9
- = f.button :submit
17
+
18
+ = f.button :submit, 'Save', class: 'btn btn-primary'
10
19
 
11
20
  %hr
12
21
  .inline-example Inline Form Invalid State
@@ -14,12 +23,21 @@
14
23
  = simple_form_for Effective::StyleGuide.new().tap { |s| s.valid? }, :html => {:class => 'form-inline'}, :wrapper => :inline_form, :url => '/' do |f|
15
24
  = f.input :title, :placeholder => 'Enter title'
16
25
  = f.input :email, :placeholder => 'Enter email'
26
+
17
27
  - if defined?(EffectiveFormInputs)
18
- = f.input :category, :as => :effective_select, :collection => EffectiveStyleGuide.colors, :placeholder => 'Select color'
28
+ = f.input :category,
29
+ :as => :effective_select,
30
+ :collection => EffectiveStyleGuide.colors,
31
+ :placeholder => 'Select color'
19
32
  - else
20
- = f.input :category, :as => :select, :collection => EffectiveStyleGuide.colors, :placeholder => 'Select color'
33
+ = f.input :category,
34
+ :as => :select,
35
+ :collection => EffectiveStyleGuide.colors,
36
+ :placeholder => 'Select color'
37
+
21
38
  = f.input :archived
22
- = f.button :submit
39
+
40
+ = f.button :submit, 'Save', class: 'btn btn-primary'
23
41
 
24
42
 
25
43
 
@@ -6,26 +6,62 @@
6
6
  = f.input :range, :as => :range, :hint => 'please enter a number range (this is a range field)'
7
7
 
8
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
9
+ = f.input :category,
10
+ :as => :effective_select,
11
+ :collection => EffectiveStyleGuide.colors,
12
+ :hint => 'please select a category (this is an effective_select from EffectiveFormInputs)',
13
+ :placeholder => 'Please choose a category'
14
+
15
+ = f.input :category,
16
+ :as => :effective_select,
17
+ :collection => EffectiveStyleGuide.colors,
18
+ :hint => 'please select multiple categories (this is an effective_select from EffectiveFormInputs)',
19
+ :placeholder => 'Please choose multiple categories',
20
+ :multiple => true
21
+
22
+ = f.input :category,
23
+ :as => :effective_select,
24
+ :collection => EffectiveStyleGuide.colors,
25
+ :hint => 'please create or select multiple tags (this is an effective_select from EffectiveFormInputs)',
26
+ :placeholder => 'Create or select multiple tags',
27
+ :multiple => true,
28
+ :tags => true
12
29
  - else
13
- = f.input :category, :as => :select, :collection => EffectiveStyleGuide.colors, :hint => 'please select a category (this is a select field)'
30
+ = f.input :category,
31
+ :as => :select,
32
+ :collection => EffectiveStyleGuide.colors,
33
+ :hint => 'please select a category (this is a select field)'
34
+
35
+ = f.input :content, :as => :text, :hint => 'please enter a whole bunch of content (this is a textarea)'
36
+ = f.input :archived, :as => :boolean, :hint => 'please select true or false (this is a boolean field)'
37
+
38
+ = f.input :drink,
39
+ :as => :check_boxes,
40
+ :collection => EffectiveStyleGuide.foods,
41
+ :hint => 'please select one or more drinks (this is a check_boxes input)'
14
42
 
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)'
17
- = f.input :content, :hint => 'please enter a whole bunch of content (this is a textarea)'
18
- = f.input :archived, :hint => 'please select true or false (this is a boolean 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)'
43
+ = f.input :food,
44
+ :as => :radio_buttons,
45
+ :collection => EffectiveStyleGuide.foods,
46
+ :hint => 'please select one food (this is a radio_buttons input)'
21
47
 
22
48
  - if defined?(EffectiveAssets)
23
- = f.input :files, :as => :asset_box, :hint => 'please upload one or more files (this is an asset_box field from EffectiveAssets)'
49
+ = f.input :files,
50
+ :as => :asset_box,
51
+ :hint => 'please upload one or more files (this is an asset_box field from EffectiveAssets)'
24
52
 
25
53
  - if defined?(EffectiveFormInputs)
26
- = f.input :updated_at, :as => :effective_date_time_picker, :hint => 'please enter a datetime (this is an effective_date_time_picker field from EffectiveFormInputs)'
27
- = f.input :publish_on, :as => :effective_date_picker, :hint => 'please enter a date (this is an effective_date_picker field from EffectiveFormInputs)'
28
- = f.input :static_text, :as => :effective_static_control, :hint => 'you cant enter anything here (this is an effective_static_control field from EffectiveFormInputs)'
54
+ = f.input :updated_at,
55
+ :as => :effective_date_time_picker,
56
+ :hint => 'please enter a datetime (this is an effective_date_time_picker field from EffectiveFormInputs)'
57
+
58
+ = f.input :publish_on,
59
+ :as => :effective_date_picker,
60
+ :hint => 'please enter a date (this is an effective_date_picker field from EffectiveFormInputs)'
61
+
62
+ = f.input :static_text,
63
+ :as => :effective_static_control,
64
+ :hint => "you can't enter anything here (this is an effective_static_control field from EffectiveFormInputs)"
29
65
  - else
30
66
  = f.input :updated_at, :as => :datetime, :hint => 'please enter a date and time (this is a datetime field)'
31
67
  = f.input :publish_on, :as => :date, :hint => 'please enter a date (this is a date field)'
@@ -33,7 +69,9 @@
33
69
  - if defined?(EffectiveOrders)
34
70
  = f.input :price, :as => :price, :hint => 'please enter a price (this is a price field from EffectiveOrders)'
35
71
 
36
- = f.button :submit
72
+ = f.button :submit, 'Save', class: 'btn btn-primary'
73
+ = f.button :submit, 'Save and Add New'
74
+ = link_to 'Cancel', '#'
37
75
 
38
76
  %hr
39
77
  .inline-example Form Vertical Invalid State
@@ -46,26 +84,60 @@
46
84
  = f.input :range, :as => :range, :hint => 'please enter a number range (this is a range field)'
47
85
 
48
86
  - 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
87
+ = f.input :category,
88
+ :as => :effective_select,
89
+ :collection => EffectiveStyleGuide.colors,
90
+ :hint => 'please select a category (this is an effective_select from EffectiveFormInputs)',
91
+ :placeholder => 'Please choose a category'
92
+
93
+ = f.input :category,
94
+ :as => :effective_select,
95
+ :collection => EffectiveStyleGuide.colors,
96
+ :hint => 'please select multiple categories (this is an effective_select from EffectiveFormInputs)',
97
+ :placeholder => 'Please choose multiple categories',
98
+ :multiple => true
99
+
100
+ = f.input :category,
101
+ :as => :effective_select,
102
+ :collection => EffectiveStyleGuide.colors,
103
+ :hint => 'please create or select multiple tags (this is an effective_select from EffectiveFormInputs)',
104
+ :placeholder => 'Create or select multiple tags',
105
+ :multiple => true,
106
+ :tags => true
52
107
  - else
53
- = f.input :category, :as => :select, :collection => EffectiveStyleGuide.colors, :hint => 'please select a category (this is a select field)'
108
+ = f.input :category,
109
+ :as => :select,
110
+ :collection => EffectiveStyleGuide.colors,
111
+ :hint => 'please select a category (this is a select field)'
112
+
113
+ = f.input :content, :as => :text, :hint => 'please enter a whole bunch of content (this is a textarea)'
114
+ = f.input :archived, :as => :boolean, :hint => 'please select true or false (this is a boolean field)'
54
115
 
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)'
57
- = f.input :content, :hint => 'please enter a whole bunch of content (this is a textarea)'
58
- = f.input :archived, :hint => 'please select true or false (this is a boolean 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)'
116
+ = f.input :drink,
117
+ :as => :check_boxes,
118
+ :collection => EffectiveStyleGuide.foods,
119
+ :hint => 'please select one or more drinks (this is a check_boxes input)'
120
+
121
+ = f.input :food,
122
+ :as => :radio_buttons,
123
+ :collection => EffectiveStyleGuide.foods,
124
+ :hint => 'please select one food (this is a radio_buttons input)'
61
125
 
62
126
  - if defined?(EffectiveAssets)
63
127
  = f.input :files, :as => :asset_box, :hint => 'please upload one or more files (this is an asset_box field from EffectiveAssets)'
64
128
 
65
129
  - if defined?(EffectiveFormInputs)
66
- = f.input :updated_at, :as => :effective_date_time_picker, :hint => 'please enter a datetime (this is an effective_date_time_picker field from EffectiveFormInputs)'
67
- = f.input :publish_on, :as => :effective_date_picker, :hint => 'please enter a date (this is an effective_date_picker field from EffectiveFormInputs)'
68
- = f.input :static_text, :as => :effective_static_control, :hint => 'you cant enter anything here (this is an effective_static_control field from EffectiveFormInputs)'
130
+ = f.input :updated_at,
131
+ :as => :effective_date_time_picker,
132
+ :hint => 'please enter a datetime (this is an effective_date_time_picker field from EffectiveFormInputs)'
133
+
134
+ = f.input :publish_on,
135
+ :as => :effective_date_picker,
136
+ :hint => 'please enter a date (this is an effective_date_picker field from EffectiveFormInputs)'
137
+
138
+ = f.input :static_text,
139
+ :as => :effective_static_control,
140
+ :hint => 'you cant enter anything here (this is an effective_static_control field from EffectiveFormInputs)'
69
141
  - else
70
142
  = f.input :updated_at, :as => :datetime, :hint => 'please enter a date and time (this is a datetime field)'
71
143
  = f.input :publish_on, :as => :date, :hint => 'please enter a date (this is a date field)'
@@ -73,4 +145,6 @@
73
145
  - if defined?(EffectiveOrders)
74
146
  = f.input :price, :as => :price, :hint => 'please enter a price (this is a price field from EffectiveOrders)'
75
147
 
76
- = f.button :submit
148
+ = f.button :submit, 'Save', class: 'btn btn-primary'
149
+ = f.button :submit, 'Save and Add New'
150
+ = link_to 'Cancel', '#'
@@ -18,3 +18,23 @@
18
18
  %small Small
19
19
  = '-'
20
20
  %a{:href => '#'} Link
21
+
22
+ %ul
23
+ %li List item
24
+ %li
25
+ List item
26
+ %ol
27
+ %li Nested numbered item
28
+ %li Nested numbered item
29
+ %li Nested numbered item
30
+ %li List item
31
+
32
+ %ol
33
+ %li Numbered item
34
+ %li
35
+ Numbered item
36
+ %ul
37
+ %li Nested list item
38
+ %li Nested list item
39
+ %li Nested list item
40
+ %li Numbered item
@@ -1,3 +1,4 @@
1
+ require 'faker'
1
2
  require 'haml-rails'
2
3
  require 'effective_style_guide/engine'
3
4
  require 'effective_style_guide/version'
@@ -1,3 +1,3 @@
1
1
  module EffectiveStyleGuide
2
- VERSION = '1.3.6'.freeze
2
+ VERSION = '1.3.7'.freeze
3
3
  end
metadata CHANGED
@@ -1,69 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_style_guide
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.6
4
+ version: 1.3.7
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-12-08 00:00:00.000000000 Z
11
+ date: 2016-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 3.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: coffee-rails
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: faker
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
+ - - ">="
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: haml-rails
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - '>='
59
+ - - ">="
46
60
  - !ruby/object:Gem::Version
47
61
  version: '0'
48
62
  type: :runtime
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - '>='
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: simple_form
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - '>='
73
+ - - ">="
60
74
  - !ruby/object:Gem::Version
61
75
  version: '0'
62
76
  type: :runtime
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - '>='
80
+ - - ">="
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
69
83
  description: Ensure that your custom CSS theme looks good with all Twitter Bootstrap3
@@ -74,6 +88,9 @@ executables: []
74
88
  extensions: []
75
89
  extra_rdoc_files: []
76
90
  files:
91
+ - MIT-LICENSE
92
+ - README.md
93
+ - Rakefile
77
94
  - app/controllers/effective/style_guide_controller.rb
78
95
  - app/models/effective/access_denied.rb
79
96
  - app/models/effective/datatables/style_guide.rb
@@ -99,15 +116,12 @@ files:
99
116
  - app/views/effective/style_guide/_wells.html.haml
100
117
  - app/views/effective/style_guide/show.html.haml
101
118
  - config/routes.rb
119
+ - lib/effective_style_guide.rb
102
120
  - lib/effective_style_guide/engine.rb
103
121
  - lib/effective_style_guide/version.rb
104
- - lib/effective_style_guide.rb
105
122
  - lib/generators/effective_style_guide/install_generator.rb
106
- - lib/generators/templates/effective_style_guide.rb
107
123
  - lib/generators/templates/README
108
- - MIT-LICENSE
109
- - Rakefile
110
- - README.md
124
+ - lib/generators/templates/effective_style_guide.rb
111
125
  homepage: https://github.com/code-and-effect/effective_style_guide
112
126
  licenses:
113
127
  - MIT
@@ -118,17 +132,17 @@ require_paths:
118
132
  - lib
119
133
  required_ruby_version: !ruby/object:Gem::Requirement
120
134
  requirements:
121
- - - '>='
135
+ - - ">="
122
136
  - !ruby/object:Gem::Version
123
137
  version: '0'
124
138
  required_rubygems_version: !ruby/object:Gem::Requirement
125
139
  requirements:
126
- - - '>='
140
+ - - ">="
127
141
  - !ruby/object:Gem::Version
128
142
  version: '0'
129
143
  requirements: []
130
144
  rubyforge_project:
131
- rubygems_version: 2.0.14
145
+ rubygems_version: 2.4.5.1
132
146
  signing_key:
133
147
  specification_version: 4
134
148
  summary: Ensure that your custom CSS theme looks good with all Twitter Bootstrap3