effective_style_guide 1.5.4 → 1.5.5

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: 15c680dc7f50b5a59346b4337a383c794b5454cd
4
- data.tar.gz: 7f7bd3e722c0c5f1f956e2d4d5454f96e4571edd
3
+ metadata.gz: d26a7ecba2a64a4f6cdc5543e45009032b619d49
4
+ data.tar.gz: c56078e47877581c66d7ecbd757eaa9c4a7d5466
5
5
  SHA512:
6
- metadata.gz: 0f36cce6561895ef0bde2a1e93c252c270d1d7a7ae9ef954d44418325521615d4e0b18bbaaaab6ef6599bc6821928499ab004158c4695fb3a11a3e03b61e1b2a
7
- data.tar.gz: 3fd78df75187488e0cfd725511b2a549a29a503a4db716f4cb3a34e46889ebb8e6b4bdd180d1572d8cc8c1095af8479b87db5e8c9a3f6d9395cb20547dda8c32
6
+ metadata.gz: ef91a9aaafd0d224c7e4cc105f1b4f937c7991819ef393f4719c106b0b72a3b8732fe5f93eea4e00fbe807e7e5f9100c4f6c8711e77d138042859e880e34cf55
7
+ data.tar.gz: aa756124ce259c50a11fd685629eccd37e0ff3b27c0562081a785a82048c21b34030ad3c217aa6eb19ad87c4c6a10da87524b03d8da06917f7ffa1c1ac7ad3e4
@@ -1,3 +1,3 @@
1
1
  module EffectiveStyleGuide
2
- VERSION = '1.5.4'.freeze
2
+ VERSION = '1.5.5'.freeze
3
3
  end
@@ -0,0 +1,182 @@
1
+ # Put this in your /config/initializers/ directory. It can replace the existing simple_form config file.
2
+
3
+ # Use this setup block to configure all options available in SimpleForm.
4
+ SimpleForm.setup do |config|
5
+ config.error_notification_class = 'alert alert-danger'
6
+ config.button_class = 'btn btn-default'
7
+ config.boolean_label_class = nil
8
+
9
+ config.wrappers :vertical_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
10
+ b.use :html5
11
+ b.use :placeholder
12
+ b.optional :maxlength
13
+ b.optional :pattern
14
+ b.optional :min_max
15
+ b.optional :readonly
16
+ b.use :label, class: 'control-label'
17
+
18
+ b.use :input, class: 'form-control'
19
+ b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
20
+ b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
21
+ end
22
+
23
+ config.wrappers :errors_supressed, tag: 'div', class: 'form-group' do |b|
24
+ b.use :html5
25
+ b.use :placeholder
26
+ b.optional :maxlength
27
+ b.optional :pattern
28
+ b.optional :min_max
29
+ b.optional :readonly
30
+ b.use :label, class: 'control-label'
31
+
32
+ b.use :input, class: 'form-control'
33
+ b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
34
+ end
35
+
36
+ config.wrappers :vertical_file_input, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
37
+ b.use :html5
38
+ b.use :placeholder
39
+ b.optional :maxlength
40
+ b.optional :readonly
41
+ b.use :label, class: 'control-label'
42
+
43
+ b.use :input
44
+ b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
45
+ b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
46
+ end
47
+
48
+ config.wrappers :vertical_boolean, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
49
+ b.use :html5
50
+ b.optional :readonly
51
+
52
+ b.wrapper tag: 'div', class: 'checkbox' do |ba|
53
+ ba.use :label_input
54
+ end
55
+
56
+ b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
57
+ b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
58
+ end
59
+
60
+ config.wrappers :vertical_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
61
+ b.use :html5
62
+ b.optional :readonly
63
+ b.use :label, class: 'control-label'
64
+ b.use :input
65
+ b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
66
+ b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
67
+ end
68
+
69
+ config.wrappers :horizontal_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
70
+ b.use :html5
71
+ b.use :placeholder
72
+ b.optional :maxlength
73
+ b.optional :pattern
74
+ b.optional :min_max
75
+ b.optional :readonly
76
+ b.use :label, class: 'col-sm-3 control-label'
77
+
78
+ b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
79
+ ba.use :input, class: 'form-control'
80
+ ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
81
+ ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
82
+ end
83
+ end
84
+
85
+ config.wrappers :horizontal_file_input, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
86
+ b.use :html5
87
+ b.use :placeholder
88
+ b.optional :maxlength
89
+ b.optional :readonly
90
+ b.use :label, class: 'col-sm-3 control-label'
91
+
92
+ b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
93
+ ba.use :input
94
+ ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
95
+ ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
96
+ end
97
+ end
98
+
99
+ config.wrappers :horizontal_boolean, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
100
+ b.use :html5
101
+ b.optional :readonly
102
+
103
+ b.wrapper tag: 'div', class: 'col-sm-offset-3 col-sm-9' do |wr|
104
+ wr.wrapper tag: 'div', class: 'checkbox' do |ba|
105
+ ba.use :label_input
106
+ end
107
+
108
+ wr.use :error, wrap_with: { tag: 'span', class: 'help-block' }
109
+ wr.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
110
+ end
111
+ end
112
+
113
+ config.wrappers :horizontal_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
114
+ b.use :html5
115
+ b.optional :readonly
116
+
117
+ b.use :label, class: 'col-sm-3 control-label'
118
+
119
+ b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
120
+ ba.use :input
121
+ ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
122
+ ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
123
+ end
124
+ end
125
+
126
+ config.wrappers :inline_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
127
+ b.use :html5
128
+ b.use :placeholder
129
+ b.optional :maxlength
130
+ b.optional :pattern
131
+ b.optional :min_max
132
+ b.optional :readonly
133
+ b.use :label, class: 'sr-only'
134
+
135
+ b.use :input, class: 'form-control'
136
+ b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
137
+ b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
138
+ end
139
+
140
+ config.wrappers :multi_select, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
141
+ b.use :html5
142
+ b.optional :readonly
143
+ b.use :label, class: 'control-label'
144
+ b.wrapper tag: 'div', class: 'form-inline' do |ba|
145
+ ba.use :input, class: 'form-control'
146
+ ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
147
+ ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
148
+ end
149
+ end
150
+ # Wrappers for forms and inputs using the Bootstrap toolkit.
151
+ # Check the Bootstrap docs (http://getbootstrap.com)
152
+ # to learn about the different styles for forms and inputs,
153
+ # buttons and other elements.
154
+ config.default_wrapper = :vertical_form
155
+ config.wrapper_mappings = {
156
+ check_boxes: :vertical_radio_and_checkboxes,
157
+ radio_buttons: :vertical_radio_and_checkboxes,
158
+ file: :vertical_file_input,
159
+ boolean: :vertical_boolean,
160
+ datetime: :multi_select,
161
+ date: :multi_select,
162
+ time: :multi_select
163
+ }
164
+
165
+ ### Custom as per Effective Style Guide ###
166
+ config.browser_validations = true
167
+
168
+ config.button_class = 'btn btn-primary'
169
+
170
+ config.boolean_style = :nested
171
+
172
+ config.wrapper_mappings[:horizontal_form] = {
173
+ check_boxes: :horizontal_radio_and_checkboxes,
174
+ radio_buttons: :horizontal_radio_and_checkboxes,
175
+ file: :horizontal_file_input,
176
+ boolean: :horizontal_boolean,
177
+ datetime: :horizontal_radio_and_checkboxes,
178
+ date: :horizontal_radio_and_checkboxes,
179
+ time: :horizontal_radio_and_checkboxes
180
+ }
181
+
182
+ 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.5.4
4
+ version: 1.5.5
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: 2017-05-23 00:00:00.000000000 Z
11
+ date: 2018-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -108,6 +108,7 @@ files:
108
108
  - lib/effective_style_guide/engine.rb
109
109
  - lib/effective_style_guide/version.rb
110
110
  - lib/generators/effective_style_guide/install_generator.rb
111
+ - lib/generators/effective_style_guide/simple_form_bootstrap3.rb
111
112
  homepage: https://github.com/code-and-effect/effective_style_guide
112
113
  licenses:
113
114
  - MIT