padrino-admin 0.10.7 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +22 -1
  3. data/lib/padrino-admin.rb +8 -1
  4. data/lib/padrino-admin/access_control.rb +6 -4
  5. data/lib/padrino-admin/bootstrap-less/accordion.less +34 -0
  6. data/lib/padrino-admin/bootstrap-less/alerts.less +98 -0
  7. data/lib/padrino-admin/bootstrap-less/badges.less +58 -0
  8. data/lib/padrino-admin/bootstrap-less/bootstrap.less +62 -0
  9. data/lib/padrino-admin/bootstrap-less/breadcrumbs.less +25 -0
  10. data/lib/padrino-admin/bootstrap-less/button-groups.less +166 -0
  11. data/lib/padrino-admin/bootstrap-less/buttons.less +175 -0
  12. data/lib/padrino-admin/bootstrap-less/carousel.less +192 -0
  13. data/lib/padrino-admin/bootstrap-less/close.less +32 -0
  14. data/lib/padrino-admin/bootstrap-less/code.less +61 -0
  15. data/lib/padrino-admin/bootstrap-less/component-animations.less +32 -0
  16. data/lib/padrino-admin/bootstrap-less/dropdowns.less +223 -0
  17. data/lib/padrino-admin/bootstrap-less/font-awesome-ie7.less +350 -0
  18. data/lib/padrino-admin/bootstrap-less/font-awesome.less +537 -0
  19. data/lib/padrino-admin/bootstrap-less/forms.less +543 -0
  20. data/lib/padrino-admin/bootstrap-less/glyphicons.less +200 -0
  21. data/lib/padrino-admin/bootstrap-less/grid.less +49 -0
  22. data/lib/padrino-admin/bootstrap-less/jumbotron.less +32 -0
  23. data/lib/padrino-admin/bootstrap-less/labels.less +46 -0
  24. data/lib/padrino-admin/bootstrap-less/media.less +54 -0
  25. data/lib/padrino-admin/bootstrap-less/mixins.less +530 -0
  26. data/lib/padrino-admin/bootstrap-less/modals.less +136 -0
  27. data/lib/padrino-admin/bootstrap-less/navbar.less +379 -0
  28. data/lib/padrino-admin/bootstrap-less/navs.less +277 -0
  29. data/lib/padrino-admin/bootstrap-less/normalize.less +396 -0
  30. data/lib/padrino-admin/bootstrap-less/padrino-admin.less +16 -0
  31. data/lib/padrino-admin/bootstrap-less/pager.less +43 -0
  32. data/lib/padrino-admin/bootstrap-less/pagination.less +100 -0
  33. data/lib/padrino-admin/bootstrap-less/popovers.less +133 -0
  34. data/lib/padrino-admin/bootstrap-less/print.less +74 -0
  35. data/lib/padrino-admin/bootstrap-less/progress-bars.less +118 -0
  36. data/lib/padrino-admin/bootstrap-less/responsive-utilities.less +59 -0
  37. data/lib/padrino-admin/bootstrap-less/scaffolding.less +90 -0
  38. data/lib/padrino-admin/bootstrap-less/tables.less +231 -0
  39. data/lib/padrino-admin/bootstrap-less/thumbnails.less +42 -0
  40. data/lib/padrino-admin/bootstrap-less/tooltip.less +71 -0
  41. data/lib/padrino-admin/bootstrap-less/type.less +252 -0
  42. data/lib/padrino-admin/bootstrap-less/utilities.less +42 -0
  43. data/lib/padrino-admin/bootstrap-less/variables.less +316 -0
  44. data/lib/padrino-admin/bootstrap-less/wells.less +29 -0
  45. data/lib/padrino-admin/generators/actions.rb +18 -2
  46. data/lib/padrino-admin/generators/admin_app.rb +38 -26
  47. data/lib/padrino-admin/generators/admin_page.rb +8 -1
  48. data/lib/padrino-admin/generators/orm.rb +58 -11
  49. data/lib/padrino-admin/generators/templates/account/couchrest.rb.tt +1 -1
  50. data/lib/padrino-admin/generators/templates/account/{mini_record.rb.tt → minirecord.rb.tt} +0 -0
  51. data/lib/padrino-admin/generators/templates/account/mongoid.rb.tt +1 -1
  52. data/lib/padrino-admin/generators/templates/account/ohm.rb.tt +61 -0
  53. data/lib/padrino-admin/generators/templates/account/sequel.rb.tt +1 -1
  54. data/lib/padrino-admin/generators/templates/app.rb.tt +36 -29
  55. data/lib/padrino-admin/generators/templates/app/controllers/{base.rb → base.rb.tt} +1 -2
  56. data/lib/padrino-admin/generators/templates/app/controllers/sessions.rb.tt +6 -3
  57. data/lib/padrino-admin/generators/templates/assets/images/favicon.ico +0 -0
  58. data/lib/padrino-admin/generators/templates/assets/images/font/FontAwesome.otf +0 -0
  59. data/lib/padrino-admin/generators/templates/assets/images/font/fontawesome-webfont.eot +0 -0
  60. data/lib/padrino-admin/generators/templates/assets/images/font/fontawesome-webfont.svg +284 -0
  61. data/lib/padrino-admin/generators/templates/assets/images/font/fontawesome-webfont.ttf +0 -0
  62. data/lib/padrino-admin/generators/templates/assets/images/font/fontawesome-webfont.woff +0 -0
  63. data/lib/padrino-admin/generators/templates/assets/images/logo.png +0 -0
  64. data/lib/padrino-admin/generators/templates/assets/javascripts/application.js +117 -0
  65. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-affix.js +117 -0
  66. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-alert.js +99 -0
  67. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-button.js +105 -0
  68. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-carousel.js +207 -0
  69. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-collapse.js +167 -0
  70. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-dropdown.js +165 -0
  71. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-modal.js +251 -0
  72. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-popover.js +114 -0
  73. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-scrollspy.js +162 -0
  74. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-tab.js +144 -0
  75. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-tooltip.js +361 -0
  76. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-transition.js +60 -0
  77. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-typeahead.js +335 -0
  78. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap.min.js +6 -0
  79. data/lib/padrino-admin/generators/templates/assets/javascripts/jquery-1.9.0.min.js +4 -0
  80. data/lib/padrino-admin/generators/templates/assets/stylesheets/application.css +346 -0
  81. data/lib/padrino-admin/generators/templates/assets/stylesheets/bootstrap.css +952 -0
  82. data/lib/padrino-admin/generators/templates/erb/app/base/index.erb.tt +13 -15
  83. data/lib/padrino-admin/generators/templates/erb/app/errors/403.erb.tt +3 -0
  84. data/lib/padrino-admin/generators/templates/erb/app/errors/404.erb.tt +3 -0
  85. data/lib/padrino-admin/generators/templates/erb/app/errors/500.erb.tt +3 -0
  86. data/lib/padrino-admin/generators/templates/erb/app/layouts/application.erb.tt +59 -39
  87. data/lib/padrino-admin/generators/templates/erb/app/layouts/error.erb.tt +23 -0
  88. data/lib/padrino-admin/generators/templates/erb/app/sessions/new.erb.tt +41 -53
  89. data/lib/padrino-admin/generators/templates/erb/page/_form.erb.tt +16 -9
  90. data/lib/padrino-admin/generators/templates/erb/page/edit.erb.tt +9 -17
  91. data/lib/padrino-admin/generators/templates/erb/page/index.erb.tt +73 -31
  92. data/lib/padrino-admin/generators/templates/erb/page/new.erb.tt +8 -16
  93. data/lib/padrino-admin/generators/templates/haml/app/base/index.haml.tt +11 -24
  94. data/lib/padrino-admin/generators/templates/haml/app/errors/403.haml.tt +3 -0
  95. data/lib/padrino-admin/generators/templates/haml/app/errors/404.haml.tt +3 -0
  96. data/lib/padrino-admin/generators/templates/haml/app/errors/500.haml.tt +3 -0
  97. data/lib/padrino-admin/generators/templates/haml/app/layouts/application.haml.tt +47 -29
  98. data/lib/padrino-admin/generators/templates/haml/app/layouts/error.haml.tt +18 -0
  99. data/lib/padrino-admin/generators/templates/haml/app/sessions/new.haml.tt +33 -28
  100. data/lib/padrino-admin/generators/templates/haml/page/_form.haml.tt +13 -9
  101. data/lib/padrino-admin/generators/templates/haml/page/edit.haml.tt +7 -14
  102. data/lib/padrino-admin/generators/templates/haml/page/index.haml.tt +56 -27
  103. data/lib/padrino-admin/generators/templates/haml/page/new.haml.tt +6 -13
  104. data/lib/padrino-admin/generators/templates/page/controller.rb.tt +57 -12
  105. data/lib/padrino-admin/generators/templates/slim/app/base/index.slim.tt +11 -24
  106. data/lib/padrino-admin/generators/templates/slim/app/errors/403.slim.tt +3 -0
  107. data/lib/padrino-admin/generators/templates/slim/app/errors/404.slim.tt +3 -0
  108. data/lib/padrino-admin/generators/templates/slim/app/errors/500.slim.tt +3 -0
  109. data/lib/padrino-admin/generators/templates/slim/app/layouts/application.slim.tt +43 -26
  110. data/lib/padrino-admin/generators/templates/slim/app/layouts/error.slim.tt +19 -0
  111. data/lib/padrino-admin/generators/templates/slim/app/sessions/new.slim.tt +31 -27
  112. data/lib/padrino-admin/generators/templates/slim/page/_form.slim.tt +13 -11
  113. data/lib/padrino-admin/generators/templates/slim/page/edit.slim.tt +7 -15
  114. data/lib/padrino-admin/generators/templates/slim/page/index.slim.tt +54 -28
  115. data/lib/padrino-admin/generators/templates/slim/page/new.slim.tt +6 -14
  116. data/lib/padrino-admin/helpers/authentication_helpers.rb +6 -4
  117. data/lib/padrino-admin/helpers/view_helpers.rb +27 -5
  118. data/lib/padrino-admin/locale/admin/cs.yml +53 -13
  119. data/lib/padrino-admin/locale/admin/da.yml +53 -13
  120. data/lib/padrino-admin/locale/admin/de.yml +53 -13
  121. data/lib/padrino-admin/locale/admin/en.yml +53 -13
  122. data/lib/padrino-admin/locale/admin/es.yml +53 -13
  123. data/lib/padrino-admin/locale/admin/fr.yml +53 -13
  124. data/lib/padrino-admin/locale/admin/hu.yml +53 -13
  125. data/lib/padrino-admin/locale/admin/it.yml +53 -13
  126. data/lib/padrino-admin/locale/admin/ja.yml +54 -13
  127. data/lib/padrino-admin/locale/admin/lv.yml +53 -13
  128. data/lib/padrino-admin/locale/admin/nl.yml +53 -13
  129. data/lib/padrino-admin/locale/admin/no.yml +53 -13
  130. data/lib/padrino-admin/locale/admin/pl.yml +53 -13
  131. data/lib/padrino-admin/locale/admin/pt_br.yml +53 -13
  132. data/lib/padrino-admin/locale/admin/ro.yml +53 -13
  133. data/lib/padrino-admin/locale/admin/ru.yml +54 -13
  134. data/lib/padrino-admin/locale/admin/sv.yml +53 -13
  135. data/lib/padrino-admin/locale/admin/tr.yml +53 -13
  136. data/lib/padrino-admin/locale/admin/uk.yml +53 -13
  137. data/lib/padrino-admin/locale/admin/zh_cn.yml +53 -13
  138. data/lib/padrino-admin/locale/admin/zh_tw.yml +53 -13
  139. data/lib/padrino-admin/locale/orm/fr.yml +8 -8
  140. data/padrino-admin.gemspec +2 -0
  141. data/test/fixtures/data_mapper.rb +0 -4
  142. data/test/generators/test_account_model_generator.rb +88 -18
  143. data/test/generators/test_admin_app_generator.rb +120 -165
  144. data/test/generators/test_admin_page_generator.rb +53 -56
  145. data/test/helper.rb +4 -0
  146. data/test/test_admin_application.rb +5 -5
  147. data/test/test_locale.rb +3 -3
  148. metadata +119 -35
  149. data/lib/padrino-admin/generators/templates/assets/stylesheets/base.css +0 -95
  150. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/amro/style.css +0 -364
  151. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/bec-green/style.css +0 -290
  152. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/bec/style.css +0 -301
  153. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/blue/style.css +0 -287
  154. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/default/style.css +0 -373
  155. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/djime-cerulean/style.css +0 -305
  156. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/kathleene/style.css +0 -279
  157. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/olive/style.css +0 -345
  158. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/orange/style.css +0 -269
  159. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/reidb-greenish/style.css +0 -302
  160. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/ruby/style.css +0 -281
  161. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/warehouse/style.css +0 -391
  162. data/lib/padrino-admin/generators/templates/erb/app/base/_sidebar.erb.tt +0 -13
  163. data/lib/padrino-admin/generators/templates/haml/app/base/_sidebar.haml.tt +0 -11
  164. data/lib/padrino-admin/generators/templates/slim/app/base/_sidebar.slim.tt +0 -11
@@ -0,0 +1,543 @@
1
+ //
2
+ // Forms
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Non-controls
7
+ // -------------------------
8
+
9
+ form {
10
+ margin: 0;
11
+ }
12
+
13
+ fieldset {
14
+ padding: 0;
15
+ margin: 0;
16
+ border: 0;
17
+ }
18
+
19
+ legend {
20
+ display: block;
21
+ width: 100%;
22
+ padding: 0;
23
+ margin-bottom: @line-height-base;
24
+ font-size: (@font-size-base * 1.5);
25
+ line-height: (@line-height-base * 2);
26
+ color: @grayDark;
27
+ border: 0;
28
+ border-bottom: 1px solid #e5e5e5;
29
+ }
30
+
31
+ label {
32
+ display: inline-block;
33
+ margin-bottom: 5px;
34
+ font-weight: bold;
35
+ }
36
+
37
+ // Form controls
38
+ // -------------------------
39
+
40
+ // Shared size and type resets
41
+ select,
42
+ textarea,
43
+ input[type="text"],
44
+ input[type="password"],
45
+ input[type="datetime"],
46
+ input[type="datetime-local"],
47
+ input[type="date"],
48
+ input[type="month"],
49
+ input[type="time"],
50
+ input[type="week"],
51
+ input[type="number"],
52
+ input[type="email"],
53
+ input[type="url"],
54
+ input[type="search"],
55
+ input[type="tel"],
56
+ input[type="color"] {
57
+ display: inline-block;
58
+ min-height: @input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
59
+ padding: 6px 9px;
60
+ // margin-bottom: (@line-height-base / 2);
61
+ font-size: @font-size-base;
62
+ line-height: @line-height-base;
63
+ color: @gray;
64
+ vertical-align: middle;
65
+ background-color: @input-background;
66
+ border: 1px solid @input-border;
67
+ border-radius: @input-border-radius;
68
+ .box-shadow(inset 0 1px 1px rgba(0,0,0,.075));
69
+ .transition(~"border linear .2s, box-shadow linear .2s");
70
+ }
71
+
72
+ // Reset appearance properties for textual inputs and textarea
73
+ // Can't be on input[type=*] selectors or it's too specific
74
+ input,
75
+ select,
76
+ textarea {
77
+ width: 100%;
78
+ }
79
+
80
+ // Reset width of input images, buttons, radios, checkboxes
81
+ input[type="file"],
82
+ input[type="image"],
83
+ input[type="submit"],
84
+ input[type="reset"],
85
+ input[type="button"],
86
+ input[type="radio"],
87
+ input[type="checkbox"] {
88
+ width: auto; // Override of generic input selector
89
+ }
90
+
91
+ // Reset height since textareas have rows
92
+ textarea {
93
+ height: auto;
94
+ }
95
+
96
+ // Everything else
97
+ textarea,
98
+ input[type="text"],
99
+ input[type="password"],
100
+ input[type="datetime"],
101
+ input[type="datetime-local"],
102
+ input[type="date"],
103
+ input[type="month"],
104
+ input[type="time"],
105
+ input[type="week"],
106
+ input[type="number"],
107
+ input[type="email"],
108
+ input[type="url"],
109
+ input[type="search"],
110
+ input[type="tel"],
111
+ input[type="color"] {
112
+ // Focus state
113
+ &:focus {
114
+ border-color: rgba(82,168,236,.8);
115
+ outline: 0;
116
+ outline: thin dotted \9; /* IE6-9 */
117
+ //.box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6)");
118
+ .box-shadow(0 0 8px rgba(82,168,236,.6));
119
+ }
120
+ }
121
+
122
+ // Position radios and checkboxes better
123
+ input[type="radio"],
124
+ input[type="checkbox"] {
125
+ margin: 4px 0 0;
126
+ margin-top: 1px \9; /* IE8-9 */
127
+ line-height: normal;
128
+ }
129
+
130
+ // Set the height of select and file controls to match text inputs
131
+ select,
132
+ input[type="file"] {
133
+ height: @input-height-base; /* In IE7, the height of the select element cannot be changed by height, only font-size. TODO: Check if this is still needed when dropping IE7 support */
134
+ line-height: @input-height-base;
135
+ }
136
+
137
+ // Make multiple select elements height not fixed
138
+ select[multiple],
139
+ select[size] {
140
+ height: auto;
141
+ }
142
+
143
+ // Focus for select, file, radio, and checkbox
144
+ select:focus,
145
+ input[type="file"]:focus,
146
+ input[type="radio"]:focus,
147
+ input[type="checkbox"]:focus {
148
+ .tab-focus();
149
+ }
150
+
151
+
152
+ // Placeholder
153
+ // -------------------------
154
+
155
+ // Placeholder text gets special styles because when browsers invalidate entire lines if it doesn't understand a selector
156
+ input,
157
+ textarea {
158
+ .placeholder();
159
+ }
160
+
161
+
162
+ // CHECKBOXES & RADIOS
163
+ // -------------------
164
+
165
+ // Indent the labels to position radios/checkboxes as hanging
166
+ .radio,
167
+ .checkbox {
168
+ display: block;
169
+ min-height: @line-height-base; // clear the floating input if there is no label text
170
+ margin-bottom: (@line-height-base / 2);
171
+ padding-left: 20px;
172
+ label {
173
+ display: inline;
174
+ margin-bottom: 0;
175
+ font-weight: normal;
176
+ }
177
+ }
178
+
179
+ .radio input[type="radio"],
180
+ .radio-inline input[type="radio"],
181
+ .checkbox input[type="checkbox"],
182
+ .checkbox-inline input[type="checkbox"] {
183
+ float: left;
184
+ margin-left: -20px;
185
+ }
186
+ .radio + .radio,
187
+ .checkbox + .checkbox {
188
+ margin-top: ((@line-height-base / 4) * -1);
189
+ }
190
+
191
+ // Move the options list down to align with labels
192
+ .controls > .radio:first-child,
193
+ .controls > .checkbox:first-child {
194
+ padding-top: 5px; // has to be padding because margin collaspes
195
+ }
196
+
197
+ // Radios and checkboxes on same line
198
+ .radio-inline,
199
+ .checkbox-inline {
200
+ display: inline-block;
201
+ padding-top: 5px;
202
+ padding-left: 20px;
203
+ margin-bottom: 0;
204
+ vertical-align: middle;
205
+ font-weight: normal;
206
+ }
207
+ .radio-inline + .radio-inline,
208
+ .checkbox-inline + .checkbox-inline {
209
+ margin-top: 0;
210
+ margin-left: 10px; // space out consecutive inline controls
211
+ }
212
+
213
+
214
+
215
+ // INPUT SIZES
216
+ // -----------
217
+
218
+ select,
219
+ textarea,
220
+ input[type="text"],
221
+ input[type="password"],
222
+ input[type="datetime"],
223
+ input[type="datetime-local"],
224
+ input[type="date"],
225
+ input[type="month"],
226
+ input[type="time"],
227
+ input[type="week"],
228
+ input[type="number"],
229
+ input[type="email"],
230
+ input[type="url"],
231
+ input[type="search"],
232
+ input[type="tel"],
233
+ input[type="color"] {
234
+ &.input-large {
235
+ padding: @padding-large;
236
+ font-size: @font-size-large;
237
+ border-radius: @border-radius-large;
238
+ }
239
+ &.input-small {
240
+ min-height: @input-height-small;
241
+ padding: @padding-small;
242
+ font-size: @font-size-small;
243
+ border-radius: @border-radius-small;
244
+ }
245
+ }
246
+
247
+
248
+
249
+ // GRID SIZING FOR INPUTS
250
+ // ----------------------
251
+
252
+ // Grid style input sizes
253
+ input[class*="span"],
254
+ select[class*="span"],
255
+ textarea[class*="span"] {
256
+ float: none;
257
+ margin-left: 0;
258
+ margin-right: 0;
259
+ }
260
+
261
+ // Ensure input-prepend/append never wraps
262
+ .input-append input[class*="span"],
263
+ .input-prepend input[class*="span"] {
264
+ display: inline-block;
265
+ }
266
+
267
+ input[class*="span"],
268
+ select[class*="span"],
269
+ textarea[class*="span"] {
270
+ height: @input-height-base;
271
+ }
272
+
273
+
274
+
275
+ // DISABLED STATE
276
+ // --------------
277
+
278
+ // Disabled and read-only inputs
279
+ // Note: HTML5 says that inputs under a fieldset > legend:first-child won't be
280
+ // disabled if the fieldset is disabled. Due to implementation difficulty,
281
+ // we don't honor that edge case; we style them as disabled anyway.
282
+ input,
283
+ select,
284
+ textarea {
285
+ &[disabled],
286
+ &[readonly],
287
+ fieldset[disabled] & {
288
+ cursor: not-allowed;
289
+ background-color: @input-background-disabled;
290
+ }
291
+ }
292
+ // Explicitly reset the colors here
293
+ input[type="radio"],
294
+ input[type="checkbox"] {
295
+ &[disabled],
296
+ &[readonly],
297
+ fieldset[disabled] & {
298
+ background-color: transparent;
299
+ }
300
+ }
301
+
302
+
303
+
304
+
305
+ // FORM FIELD FEEDBACK STATES
306
+ // --------------------------
307
+
308
+ // Warning
309
+ .has-warning {
310
+ .formFieldState(@state-warning-text, @state-warning-text, @state-warning-background);
311
+ }
312
+ // Error
313
+ .has-error {
314
+ .formFieldState(@state-error-text, @state-error-text, @state-error-background);
315
+ }
316
+ // Success
317
+ .has-success {
318
+ .formFieldState(@state-success-text, @state-success-text, @state-success-background);
319
+ }
320
+
321
+ // HTML5 invalid states
322
+ // Shares styles with the .control-group.error above
323
+ input:focus:invalid,
324
+ textarea:focus:invalid,
325
+ select:focus:invalid {
326
+ color: #b94a48;
327
+ border-color: #ee5f5b;
328
+ &:focus {
329
+ border-color: darken(#ee5f5b, 10%);
330
+ @shadow: 0 0 6px lighten(#ee5f5b, 20%);
331
+ .box-shadow(@shadow);
332
+ }
333
+ }
334
+
335
+
336
+
337
+ // FORM ACTIONS
338
+ // ------------
339
+
340
+ .form-actions {
341
+ padding: (@line-height-base - 1) 20px @line-height-base;
342
+ margin-top: @line-height-base;
343
+ margin-bottom: @line-height-base;
344
+ background-color: @form-actions-background;
345
+ border-top: 1px solid #e5e5e5;
346
+ .clear_float(); // Adding clearfix to allow for .pull-right button containers
347
+ }
348
+
349
+
350
+
351
+ // HELP TEXT
352
+ // ---------
353
+
354
+ .help-block,
355
+ .help-inline {
356
+ color: lighten(@text-color, 25%); // lighten the text some for contrast
357
+ }
358
+
359
+ .help-block {
360
+ display: block; // account for any element using help-block
361
+ margin-bottom: (@line-height-base / 2);
362
+ }
363
+
364
+ .help-inline {
365
+ display: inline-block;
366
+ vertical-align: middle;
367
+ padding-left: 5px;
368
+ }
369
+
370
+
371
+
372
+ // Input groups
373
+ // --------------------------------------------------
374
+
375
+ // Base styles
376
+ // -------------------------
377
+ .input-group {
378
+ display: table;
379
+
380
+ // Undo padding and float of grid classes
381
+ &[class*="span"] {
382
+ float: none;
383
+ padding: 0;
384
+ }
385
+
386
+ input,
387
+ select {
388
+ width: 100%;
389
+ }
390
+ }
391
+
392
+ // Display as table-cell
393
+ // -------------------------
394
+ .input-group-addon,
395
+ .input-group-btn,
396
+ .input-group input {
397
+ display: table-cell;
398
+ margin: 0;
399
+ border-radius: 0;
400
+ &.input-small {
401
+ border-radius: 0;
402
+ }
403
+ &.input-large {
404
+ border-radius: 0;
405
+ }
406
+ }
407
+ // Addon and addon wrapper for buttons
408
+ .input-group-addon,
409
+ .input-group-btn {
410
+ width: 1%;
411
+ vertical-align: middle; // Match the inputs
412
+ }
413
+
414
+ // Text input groups
415
+ // -------------------------
416
+ .input-group-addon {
417
+ .box-sizing(border-box);
418
+ padding: 6px 8px;
419
+ font-size: @font-size-base;
420
+ font-weight: normal;
421
+ line-height: @line-height-base;
422
+ text-align: center;
423
+ text-shadow: 0 1px 0 #fff;
424
+ background-color: @grayLighter;
425
+ border: 1px solid #ccc;
426
+
427
+ &.input-small {
428
+ padding: @padding-small;
429
+ font-size: @font-size-small;
430
+ }
431
+ &.input-large {
432
+ padding: @padding-large;
433
+ font-size: @font-size-large;
434
+ }
435
+ }
436
+
437
+ // Reset rounded corners
438
+ .input-group input:first-child,
439
+ .input-group-addon:first-child {
440
+ .border-left-radius(@border-radius-base);
441
+ &.input-small {
442
+ .border-left-radius(@border-radius-small);
443
+ }
444
+ &.input-large {
445
+ .border-left-radius(@border-radius-large);
446
+ }
447
+ }
448
+ .input-group-addon:first-child {
449
+ border-right: 0;
450
+ }
451
+ .input-group input:last-child,
452
+ .input-group-addon:last-child {
453
+ .border-right-radius(@border-radius-base);
454
+ &.input-small {
455
+ .border-right-radius(@border-radius-small);
456
+ }
457
+ &.input-large {
458
+ .border-right-radius(@border-radius-large);
459
+ }
460
+ }
461
+ .input-group-addon:last-child {
462
+ border-left: 0;
463
+ }
464
+
465
+ // Button input groups
466
+ // -------------------------
467
+ .input-group-btn {
468
+ position: relative;
469
+ white-space: nowrap;
470
+ }
471
+ .input-group-btn > .btn {
472
+ position: relative;
473
+ float: left; // Collapse white-space
474
+ border-radius: 0;
475
+ + .btn {
476
+ margin-left: -1px;
477
+ }
478
+ // Bring the "active" button to the front
479
+ &:hover,
480
+ &:active {
481
+ z-index: 2;
482
+ }
483
+ }
484
+
485
+ // Prepended buttons
486
+ .input-group-btn:first-child {
487
+ // Round the left corners only
488
+ > .btn:first-child,
489
+ > .dropdown-toggle:first-child {
490
+ .border-left-radius(@border-radius-base);
491
+ &.btn-large { .border-left-radius(@border-radius-large); }
492
+ &.btn-small { .border-left-radius(@border-radius-small); }
493
+ }
494
+ }
495
+
496
+ // Appended buttons
497
+ .input-group-btn:last-child {
498
+ // Round the right corners only
499
+ > .btn:last-child,
500
+ > .dropdown-toggle {
501
+ .border-right-radius(@border-radius-base);
502
+ &.btn-large { .border-right-radius(@border-radius-large); }
503
+ &.btn-small { .border-right-radius(@border-radius-small); }
504
+ }
505
+ }
506
+
507
+
508
+
509
+ // Horizontal forms
510
+ // --------------------------------------------------
511
+
512
+ @media screen and (min-width: 768px) {
513
+
514
+ .form-horizontal {
515
+
516
+ // Increase spacing between groups
517
+ .control-group {
518
+ position: relative;
519
+ margin-bottom: @line-height-base;
520
+ .clear_float();
521
+
522
+ input,
523
+ select,
524
+ textarea {
525
+ margin-bottom: 0;
526
+ }
527
+ }
528
+
529
+ // Float the labels left
530
+ .control-group > .control-label {
531
+ float: left;
532
+ width: (@component-offset-horizontal - 20);
533
+ padding-top: 6px;
534
+ text-align: right;
535
+ }
536
+
537
+ // Move over all input controls and content over
538
+ .control-group > .controls {
539
+ margin-left: @component-offset-horizontal;
540
+ }
541
+
542
+ }
543
+ }