speedo 0.2.5 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -43,47 +43,62 @@ div.uni-uploader {
43
43
  }
44
44
  }
45
45
 
46
+ $labelwidth: 100px;
46
47
  .formtastic {
47
- textarea {
48
- padding:5px;
49
- }
50
- .fragments .label, .choices .label {
51
- position:relative;
52
- width:25%;
53
- margin-right:-25%;
54
- label {
55
- position:relative;
56
- }
57
- }
58
- .label { // Override bootstrap label styling
59
- font-size: inherit;
60
- font-weight: inherit;
61
- line-height: inherit;
62
- text-shadow: none;
63
- vertical-align: inherit;
64
- white-space: inherit;
65
- border:0;
66
- border-radius:0;
67
- padding:0;
68
- color: $text;
69
- background-color: transparent;
70
- }
71
- .inline_choices {
72
- .choices-group {
73
- width:100%;
74
- .choice {
75
- display:inline-block; zoom:1;*display:inline;
76
- vertical-align:top;
77
- margin-right:1em;
78
- margin:0 1em 0 0;
48
+ fieldset {
49
+ .control-group {
50
+ @include clearfix;
51
+ label.control-label {
52
+ float:left;
53
+ width:$labelwidth;
54
+ abbr[title] {
55
+ border-bottom:0;
56
+ color:#900;
57
+ }
58
+ }
59
+ .controls {
60
+ margin-left:$labelwidth;
61
+ input {
62
+ width:100%;
63
+ &[type=radio], &[type=checkbox] {
64
+ width:auto;
65
+ }
66
+ }
67
+ textarea {
68
+ width:100%;
69
+ }
70
+ select {
71
+ width:100%;
72
+ }
73
+ &.choices {
74
+ .choice {
75
+ .uni-radio, .uni-checker {
76
+ margin-left:-18px;
77
+ }
78
+ }
79
+ }
80
+ }
81
+ &.inline_choices {
82
+ .choices {
83
+ .choice {
84
+ display:inline-block; zoom:1;*display:inline;
85
+ vertical-align:top;
86
+ margin-right:2em;
87
+ padding-top:0;
88
+ }
89
+ }
79
90
  }
80
91
  }
81
92
  }
93
+ .errors {
94
+ color:#cc0000;
95
+ margin:0.5em 0 1.5em 25%;
96
+ list-style:square;
97
+ }
82
98
  }
83
99
 
84
100
 
85
101
  ul.as-selections {
86
- width:72%; // To match the formtastic input widths
87
102
  border:1px solid #999;
88
103
  @include border-radius(3px);
89
104
  padding:5px;
@@ -1,5 +1,4 @@
1
1
  @import 'bootstrap';
2
- @import 'formtastic-buttonless';
3
2
  @import 'autoSuggest';
4
3
  @import 'chosen';
5
4
  @import 'jquery.dataTables';
@@ -1,5 +1,5 @@
1
1
  /* Colors, base.css */
2
- $bg: #ddd; /* Background color (if not in web-app mode) */
2
+ $bg: #fff; /* Background color (if not in web-app mode) */
3
3
  $text: #333;
4
4
  $link: #0090d5;
5
5
  $hover: #17639b;
@@ -2,12 +2,15 @@
2
2
 
3
3
  %h1 Forms with Uniform, AutoGrowing, AutoSuggesting - h1
4
4
  = semantic_form_for 'speedo' do |f|
5
+ / = f.semantic_errors
5
6
  = f.inputs do
6
- = f.input 'Title', placeholder: 'Type your title'
7
+ .row-fluid
8
+ = f.input 'Title', placeholder: 'Type your title', wrapper_html: {class: 'span6'}
9
+ = f.input 'Name', wrapper_html: {class: 'span6'}
7
10
  = f.input 'Singer', input_html: { class: 'autoSuggest' }
8
11
  = f.input 'Description', as: :text, input_html: { placeholder: 'AutoGrowing', class: 'autogrow tip', :rows => 2, title: 'Tip: you can type what you like, and this will get bigger to fit!', data: {placement: 'bottom'} }
9
12
  = f.input 'Attachment', as: :file, required: false
10
- = f.input 'Select', as: :select, include_blank: false
13
+ = f.input 'Select', as: :select, include_blank: false, hint: 'Just select one!'
11
14
  = f.input 'Are you real?', as: :radio, wrapper_html: { class: 'inline_choices' }
12
15
  = f.input 'Which do you own?', as: :check_boxes, collection: ['Speedo','Swim Short','Bikini']
13
16
 
@@ -92,6 +92,19 @@ module Speedo
92
92
  def run_formtastic_generator
93
93
  generate "formtastic:install"
94
94
  end
95
+
96
+ def bootstrap_formtastic
97
+ if File.exist? 'config/initializers/formtastic.rb'
98
+ unless File.read('config/initializers/formtastic.rb').match /SpeedoFormstrap/
99
+ append_file 'config/initializers/formtastic.rb' do
100
+ "\n# config/initializers/formtastic.rb"
101
+ "\nFormtastic::Helpers::FormHelper.builder = SpeedoFormstrap::FormBuilder"
102
+ end
103
+ end
104
+ else
105
+ say "Make sure to add `Formtastic::Helpers::FormHelper.builder = SpeedoFormstrap::FormBuilder` to config/initializers/formtastic.rb."
106
+ end
107
+ end
95
108
 
96
109
  private
97
110
 
@@ -1,3 +1,3 @@
1
1
  module Speedo
2
- VERSION = "0.2.5"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/speedo.rb CHANGED
@@ -4,6 +4,7 @@ require 'speedo/layout_helper'
4
4
  require 'haml'
5
5
  require 'coffee-script'
6
6
  require 'formtastic'
7
+ require 'speedo-formstrap'
7
8
 
8
9
  module Speedo
9
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: speedo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-06-25 00:00:00.000000000Z
13
+ date: 2012-06-28 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
17
- requirement: &2166511840 !ruby/object:Gem::Requirement
17
+ requirement: &2153343480 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '3.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2166511840
25
+ version_requirements: *2153343480
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: haml
28
- requirement: &2166510660 !ruby/object:Gem::Requirement
28
+ requirement: &2153342160 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *2166510660
36
+ version_requirements: *2153342160
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: coffee-script
39
- requirement: &2166509580 !ruby/object:Gem::Requirement
39
+ requirement: &2153341480 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '0'
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *2166509580
47
+ version_requirements: *2153341480
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: sass-rails
50
- requirement: &2166508940 !ruby/object:Gem::Requirement
50
+ requirement: &2153340820 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *2166508940
58
+ version_requirements: *2153340820
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: bourbon
61
- requirement: &2166508060 !ruby/object:Gem::Requirement
61
+ requirement: &2153339860 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,21 +66,32 @@ dependencies:
66
66
  version: '0'
67
67
  type: :runtime
68
68
  prerelease: false
69
- version_requirements: *2166508060
69
+ version_requirements: *2153339860
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: formtastic
72
- requirement: &2166507100 !ruby/object:Gem::Requirement
72
+ requirement: &2153338820 !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 2.1.1
78
+ type: :runtime
79
+ prerelease: false
80
+ version_requirements: *2153338820
81
+ - !ruby/object:Gem::Dependency
82
+ name: speedo-formstrap
83
+ requirement: &2153337640 !ruby/object:Gem::Requirement
73
84
  none: false
74
85
  requirements:
75
86
  - - ! '>='
76
87
  - !ruby/object:Gem::Version
77
- version: 2.1.0.rc
88
+ version: 1.2.3
78
89
  type: :runtime
79
90
  prerelease: false
80
- version_requirements: *2166507100
91
+ version_requirements: *2153337640
81
92
  - !ruby/object:Gem::Dependency
82
93
  name: jquery-rails
83
- requirement: &2166506560 !ruby/object:Gem::Requirement
94
+ requirement: &2153336760 !ruby/object:Gem::Requirement
84
95
  none: false
85
96
  requirements:
86
97
  - - ! '>='
@@ -88,10 +99,10 @@ dependencies:
88
99
  version: '0'
89
100
  type: :runtime
90
101
  prerelease: false
91
- version_requirements: *2166506560
102
+ version_requirements: *2153336760
92
103
  - !ruby/object:Gem::Dependency
93
104
  name: sqlite3
94
- requirement: &2166506060 !ruby/object:Gem::Requirement
105
+ requirement: &2153335980 !ruby/object:Gem::Requirement
95
106
  none: false
96
107
  requirements:
97
108
  - - ! '>='
@@ -99,7 +110,7 @@ dependencies:
99
110
  version: '0'
100
111
  type: :development
101
112
  prerelease: false
102
- version_requirements: *2166506060
113
+ version_requirements: *2153335980
103
114
  description: This is a layout gem intended as a backdrop for developing rails applications
104
115
  quickly. Its intention is to speed initial development, removing the need for any
105
116
  intensive front-end development until the app is functional.
@@ -179,7 +190,6 @@ files:
179
190
  - vendor/assets/stylesheets/speedo/dataTables/ui-icons_454545_256x240.png
180
191
  - vendor/assets/stylesheets/speedo/dataTables/ui-icons_888888_256x240.png
181
192
  - vendor/assets/stylesheets/speedo/dataTables/ui-icons_cd0a0a_256x240.png
182
- - vendor/assets/stylesheets/speedo/formtastic-buttonless.css
183
193
  - vendor/assets/stylesheets/speedo/jquery-ui-1.8.18.custom.css
184
194
  - vendor/assets/stylesheets/speedo/jquery.dataTables.css
185
195
  - vendor/assets/stylesheets/speedo/jqueryui/ui-bg_flat_0_aaaaaa_40x100.png
@@ -363,7 +373,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
363
373
  version: '0'
364
374
  segments:
365
375
  - 0
366
- hash: -1333860995035779373
376
+ hash: -1722773184336694848
367
377
  required_rubygems_version: !ruby/object:Gem::Requirement
368
378
  none: false
369
379
  requirements:
@@ -372,7 +382,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
372
382
  version: '0'
373
383
  segments:
374
384
  - 0
375
- hash: -1333860995035779373
385
+ hash: -1722773184336694848
376
386
  requirements: []
377
387
  rubyforge_project:
378
388
  rubygems_version: 1.8.10
@@ -1,271 +0,0 @@
1
- /* -------------------------------------------------------------------------------------------------
2
-
3
-
4
-
5
-
6
- THIS FILE HAS BEEN MODIFIED FOR SPEEDO: ALL REFERENCES TO .button(s), .action(s), .button_action
7
- AND .link_action HAVE BEEN REMOVED, TO REMOVE CONFLICTS WITH GH-BUTTONS
8
-
9
-
10
-
11
-
12
- It's *strongly* suggested that you don't modify this file. Instead, load a new stylesheet after
13
- this one in your layouts (eg formtastic_changes.css) and override the styles to suit your needs.
14
- This will allow you to update formtastic.css with new releases without clobbering your own changes.
15
-
16
- This stylesheet forms part of the Formtastic Rails Plugin
17
- (c) 2008-2011 Justin French
18
-
19
- --------------------------------------------------------------------------------------------------*/
20
-
21
- /* NORMALIZE AND RESET - obviously inspired by Yahoo's reset.css, but scoped to just .formtastic
22
- --------------------------------------------------------------------------------------------------*/
23
- .formtastic,
24
- .formtastic ul,
25
- .formtastic ol,
26
- .formtastic li,
27
- .formtastic fieldset,
28
- .formtastic legend,
29
- .formtastic input,
30
- .formtastic textarea,
31
- .formtastic select,
32
- .formtastic p {
33
- margin:0;
34
- padding:0;
35
- }
36
-
37
- .formtastic fieldset {
38
- border:0;
39
- }
40
-
41
- .formtastic em,
42
- .formtastic strong {
43
- font-style:normal;
44
- font-weight:normal;
45
- }
46
-
47
- .formtastic ol,
48
- .formtastic ul {
49
- list-style:none;
50
- }
51
-
52
- .formtastic abbr,
53
- .formtastic acronym {
54
- border:0;
55
- font-variant:normal;
56
- }
57
-
58
- .formtastic input,
59
- .formtastic textarea {
60
- font-family:sans-serif;
61
- font-size:inherit;
62
- font-weight:inherit;
63
- }
64
-
65
- .formtastic input,
66
- .formtastic textarea,
67
- .formtastic select {
68
- font-size:100%;
69
- }
70
-
71
- .formtastic legend {
72
- white-space:normal;
73
- color:#000;
74
- }
75
-
76
-
77
- /* SEMANTIC ERRORS
78
- --------------------------------------------------------------------------------------------------*/
79
- .formtastic .errors {
80
- color:#cc0000;
81
- margin:0.5em 0 1.5em 25%;
82
- list-style:square;
83
- }
84
-
85
- .formtastic .errors li {
86
- padding:0;
87
- border:none;
88
- display:list-item;
89
- }
90
-
91
-
92
- /* INPUTS
93
- --------------------------------------------------------------------------------------------------*/
94
- .formtastic .inputs {
95
- overflow:hidden; /* clear containing floats */
96
- }
97
-
98
- .formtastic .input {
99
- overflow:hidden; /* clear containing floats */
100
- padding:0.5em 0; /* padding and negative margin juggling is for Firefox */
101
- margin-top:-0.5em;
102
- margin-bottom:1em;
103
- }
104
-
105
-
106
- /* LEFT ALIGNED LABELS
107
- --------------------------------------------------------------------------------------------------*/
108
- .formtastic .input .label {
109
- display:block;
110
- width:25%;
111
- float:left;
112
- padding-top:.2em;
113
- }
114
-
115
- .formtastic .fragments .label,
116
- .formtastic .choices .label {
117
- position:absolute;
118
- width:95%;
119
- left:0px;
120
- }
121
-
122
- .formtastic .fragments .label label,
123
- .formtastic .choices .label label {
124
- position:absolute;
125
- }
126
-
127
- /* NESTED FIELDSETS AND LEGENDS (radio, check boxes and date/time inputs use nested fieldsets)
128
- --------------------------------------------------------------------------------------------------*/
129
- .formtastic .choices {
130
- position:relative;
131
- }
132
-
133
- .formtastic .choices-group {
134
- float:left;
135
- width:74%;
136
- margin:0;
137
- padding:0 0 0 25%;
138
- }
139
-
140
- .formtastic .choice {
141
- padding:0;
142
- border:0;
143
- }
144
-
145
-
146
- /* INLINE HINTS
147
- --------------------------------------------------------------------------------------------------*/
148
- .formtastic .input .inline-hints {
149
- color:#666;
150
- margin:0.5em 0 0 25%;
151
- }
152
-
153
-
154
- /* INLINE ERRORS
155
- --------------------------------------------------------------------------------------------------*/
156
- .formtastic .inline-errors {
157
- color:#cc0000;
158
- margin:0.5em 0 0 25%;
159
- }
160
-
161
- .formtastic .errors {
162
- color:#cc0000;
163
- margin:0.5em 0 0 25%;
164
- list-style:square;
165
- }
166
-
167
- .formtastic .errors li {
168
- padding:0;
169
- border:none;
170
- display:list-item;
171
- }
172
-
173
-
174
- /* STRING, NUMERIC, PASSWORD, EMAIL, URL, PHONE, SEARCH (ETC) OVERRIDES
175
- --------------------------------------------------------------------------------------------------*/
176
- .formtastic .stringish input {
177
- width:72%;
178
- }
179
-
180
- .formtastic .stringish input[size] {
181
- width:auto;
182
- max-width:72%;
183
- }
184
-
185
-
186
- /* TEXTAREA OVERRIDES
187
- --------------------------------------------------------------------------------------------------*/
188
- .formtastic .text textarea {
189
- width:72%;
190
- }
191
-
192
- .formtastic .text textarea[cols] {
193
- width:auto;
194
- max-width:72%;
195
- }
196
-
197
-
198
- /* HIDDEN OVERRIDES
199
- --------------------------------------------------------------------------------------------------*/
200
- .formtastic .hidden {
201
- display:none;
202
- }
203
-
204
-
205
- /* BOOLEAN LABELS
206
- --------------------------------------------------------------------------------------------------*/
207
- .formtastic .boolean label {
208
- padding-left:25%;
209
- display:block;
210
- }
211
-
212
-
213
- /* CHOICE GROUPS
214
- --------------------------------------------------------------------------------------------------*/
215
- .formtastic .choices-group {
216
- margin-bottom:-0.5em;
217
- }
218
-
219
- .formtastic .choice {
220
- margin:0.1em 0 0.5em 0;
221
- }
222
-
223
- .formtastic .choice label {
224
- float:none;
225
- width:100%;
226
- line-height:100%;
227
- padding-top:0;
228
- margin-bottom:0.6em;
229
- }
230
-
231
-
232
- /* ADJUSTMENTS FOR INPUTS INSIDE LABELS (boolean input, radio input, check_boxes input)
233
- --------------------------------------------------------------------------------------------------*/
234
- .formtastic .choice label input,
235
- .formtastic .boolean label input {
236
- margin:0 0.3em 0 0.1em;
237
- line-height:100%;
238
- }
239
-
240
-
241
- /* FRAGMENTED INPUTS (DATE/TIME/DATETIME)
242
- --------------------------------------------------------------------------------------------------*/
243
- .formtastic .fragments {
244
- position:relative;
245
- }
246
-
247
- .formtastic .fragments-group {
248
- float:left;
249
- width:74%;
250
- margin:0;
251
- padding:0 0 0 25%;
252
- }
253
-
254
- .formtastic .fragment {
255
- float:left;
256
- width:auto;
257
- margin:0 .3em 0 0;
258
- padding:0;
259
- border:0;
260
- }
261
-
262
- .formtastic .fragment label {
263
- display:none;
264
- }
265
-
266
- .formtastic .fragment label input {
267
- display:inline;
268
- margin:0;
269
- padding:0;
270
- }
271
-