formtastic-plus 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +7 -0
- data/README.md +31 -0
- data/lib/assets/stylesheets/bootstrap-without-forms.css.scss +53 -0
- data/lib/assets/stylesheets/formtastic-plus/_actions.scss +34 -0
- data/lib/assets/stylesheets/formtastic-plus/_all.scss +21 -0
- data/lib/assets/stylesheets/formtastic-plus/_disabled.scss +12 -0
- data/lib/assets/stylesheets/formtastic-plus/_errors.scss +36 -0
- data/lib/assets/stylesheets/formtastic-plus/_fieldset.scss +33 -0
- data/lib/assets/stylesheets/formtastic-plus/_form.scss +4 -0
- data/lib/assets/stylesheets/formtastic-plus/_hints.scss +8 -0
- data/lib/assets/stylesheets/formtastic-plus/_inputs.scss +30 -0
- data/lib/assets/stylesheets/formtastic-plus/_labels.scss +16 -0
- data/lib/assets/stylesheets/formtastic-plus/_mixins.scss +150 -0
- data/lib/assets/stylesheets/formtastic-plus/_reset.scss +34 -0
- data/lib/assets/stylesheets/formtastic-plus/inputs/_boolean.scss +3 -0
- data/lib/assets/stylesheets/formtastic-plus/inputs/_check_boxes.scss +52 -0
- data/lib/assets/stylesheets/formtastic-plus/inputs/_datetime.scss +55 -0
- data/lib/assets/stylesheets/formtastic-plus/inputs/_file.scss +27 -0
- data/lib/assets/stylesheets/formtastic-plus/inputs/_radio.scss +52 -0
- data/lib/assets/stylesheets/formtastic-plus/inputs/_range.scss +3 -0
- data/lib/assets/stylesheets/formtastic-plus/inputs/_select.scss +18 -0
- data/lib/assets/stylesheets/formtastic-plus/inputs/_stringish.scss +11 -0
- data/lib/assets/stylesheets/formtastic-plus/inputs/_text.scss +6 -0
- data/lib/assets/stylesheets/formtastic-plus.css.scss +1 -0
- data/lib/formtastic-plus.rb +6 -0
- metadata +113 -0
data/LICENSE
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
Copyright (C) 2012 Anton Ageev
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
4
|
+
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
6
|
+
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Formtastic meets Bootstrap
|
2
|
+
|
3
|
+
`formtastic-plus` makes a formtastic form to look like a [bootstrap](http://twitter.github.com/bootstrap/) form.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add following lines to Gemfile:
|
8
|
+
|
9
|
+
gem "bootstrap-sass", "~> 2.0"
|
10
|
+
gem "formtastic", "~> 2.1"
|
11
|
+
gem "formtastic-plus"
|
12
|
+
|
13
|
+
Run `bundle install`.
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
Add following lines in `app/assets/stylesheets/application.css`:
|
18
|
+
|
19
|
+
/*
|
20
|
+
...
|
21
|
+
*= require bootstrap_without_forms
|
22
|
+
*= require formtastic-plus
|
23
|
+
...
|
24
|
+
*/
|
25
|
+
|
26
|
+
All done. Enjoy nice looking forms!
|
27
|
+
|
28
|
+
### Why should I use `formtastic-plus` instead of `formtastic-bootstrap`?
|
29
|
+
|
30
|
+
[formtastic-bootstrap](https://github.com/mjbellantoni/formtastic-bootstrap) changes html-structure and breaks 3rd party extensions for [formtastic](https://github.com/justinfrench/formtastic).
|
31
|
+
`formtastic-plus` is just css-styles for standard formtastic forms.
|
@@ -0,0 +1,53 @@
|
|
1
|
+
// Core variables and mixins
|
2
|
+
@import "bootstrap/variables"; // Modify this for custom colors, font-sizes, etc
|
3
|
+
@import "bootstrap/mixins";
|
4
|
+
|
5
|
+
// CSS Reset
|
6
|
+
@import "bootstrap/reset";
|
7
|
+
|
8
|
+
// Grid system and page structure
|
9
|
+
@import "bootstrap/scaffolding";
|
10
|
+
@import "bootstrap/grid";
|
11
|
+
@import "bootstrap/layouts";
|
12
|
+
|
13
|
+
// Base CSS
|
14
|
+
@import "bootstrap/type";
|
15
|
+
@import "bootstrap/code";
|
16
|
+
//@import "bootstrap/forms";
|
17
|
+
@import "bootstrap/tables";
|
18
|
+
|
19
|
+
// Components: common
|
20
|
+
@import "bootstrap/sprites";
|
21
|
+
@import "bootstrap/dropdowns";
|
22
|
+
@import "bootstrap/wells";
|
23
|
+
@import "bootstrap/component-animations";
|
24
|
+
@import "bootstrap/close";
|
25
|
+
|
26
|
+
// Components: Buttons & Alerts
|
27
|
+
@import "bootstrap/buttons";
|
28
|
+
@import "bootstrap/button-groups";
|
29
|
+
@import "bootstrap/alerts"; // Note: alerts share common CSS with buttons and thus have styles in buttons.less
|
30
|
+
|
31
|
+
// Components: Nav
|
32
|
+
@import "bootstrap/navs";
|
33
|
+
@import "bootstrap/navbar";
|
34
|
+
@import "bootstrap/breadcrumbs";
|
35
|
+
@import "bootstrap/pagination";
|
36
|
+
@import "bootstrap/pager";
|
37
|
+
|
38
|
+
// Components: Popovers
|
39
|
+
@import "bootstrap/modals";
|
40
|
+
@import "bootstrap/tooltip";
|
41
|
+
@import "bootstrap/popovers";
|
42
|
+
|
43
|
+
// Components: Misc
|
44
|
+
@import "bootstrap/thumbnails";
|
45
|
+
@import "bootstrap/labels";
|
46
|
+
@import "bootstrap/badges";
|
47
|
+
@import "bootstrap/progress-bars";
|
48
|
+
@import "bootstrap/accordion";
|
49
|
+
@import "bootstrap/carousel";
|
50
|
+
@import "bootstrap/hero-unit";
|
51
|
+
|
52
|
+
// Utility classes
|
53
|
+
@import "bootstrap/utilities"; // Has to be last to override when necessary
|
@@ -0,0 +1,34 @@
|
|
1
|
+
fieldset.actions {
|
2
|
+
padding: ($baseLineHeight - 1px) 0 $baseLineHeight;
|
3
|
+
margin-top: $baseLineHeight;
|
4
|
+
margin-bottom: $baseLineHeight;
|
5
|
+
background-color: $grayLighter;
|
6
|
+
border-top: 1px solid #ddd;
|
7
|
+
@include clearfix();
|
8
|
+
|
9
|
+
ol {
|
10
|
+
margin: 0;
|
11
|
+
margin-left: $labelWidth;
|
12
|
+
padding: 0;
|
13
|
+
list-style: none;
|
14
|
+
|
15
|
+
|
16
|
+
li {
|
17
|
+
display: inline-block;
|
18
|
+
margin: 0;
|
19
|
+
padding: 0;
|
20
|
+
}
|
21
|
+
|
22
|
+
li.input_action input {
|
23
|
+
@include button();
|
24
|
+
|
25
|
+
&[type='submit'] {
|
26
|
+
@include button-primary();
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
li.link_action a {
|
31
|
+
@include button();
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
// Core variables and mixins
|
2
|
+
@import "bootstrap/variables"; // Modify this for custom colors, font-sizes, etc
|
3
|
+
@import "bootstrap/mixins";
|
4
|
+
|
5
|
+
$labelWidth: (4 * $gridColumnWidth) !default;
|
6
|
+
$inputWidth: (5 * $gridColumnWidth) !default;
|
7
|
+
|
8
|
+
@import "mixins";
|
9
|
+
|
10
|
+
.formtastic {
|
11
|
+
@import "reset";
|
12
|
+
|
13
|
+
@import "form";
|
14
|
+
@import "fieldset";
|
15
|
+
@import "actions";
|
16
|
+
@import "labels";
|
17
|
+
@import "hints";
|
18
|
+
@import "errors";
|
19
|
+
@import "inputs";
|
20
|
+
@import "disabled";
|
21
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
fieldset.inputs {
|
2
|
+
input[disabled],
|
3
|
+
select[disabled],
|
4
|
+
textarea[disabled],
|
5
|
+
input[readonly],
|
6
|
+
select[readonly],
|
7
|
+
textarea[readonly] {
|
8
|
+
background-color: $inputDisabledBackground !important;
|
9
|
+
border-color: #ddd !important;
|
10
|
+
cursor: not-allowed;
|
11
|
+
}
|
12
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
fieldset.inputs {
|
2
|
+
> ol {
|
3
|
+
> li.input > p.inline-errors {
|
4
|
+
display: block;
|
5
|
+
margin: 0 0 0 $labelWidth;
|
6
|
+
color: $errorText;
|
7
|
+
@include font-shorthand($baseFontSize, normal, $baseLineHeight);
|
8
|
+
}
|
9
|
+
|
10
|
+
> li.error {
|
11
|
+
> label, > fieldset.choices > legend > label, > fieldset.fragments > legend > label {
|
12
|
+
color: $errorText !important;
|
13
|
+
}
|
14
|
+
|
15
|
+
input, select, textarea {
|
16
|
+
color: $errorText !important;
|
17
|
+
border-color: $errorText !important;
|
18
|
+
&:focus {
|
19
|
+
border-color: darken($errorText, 10%) !important;
|
20
|
+
@include box-shadow-important(0 0 6px lighten($errorText, 20%));
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
input:focus:required:invalid,
|
25
|
+
textarea:focus:required:invalid,
|
26
|
+
select:focus:required:invalid {
|
27
|
+
color: $errorText !important;
|
28
|
+
border-color: $errorText !important;
|
29
|
+
&:focus {
|
30
|
+
border-color: darken($errorText, 10%) !important;
|
31
|
+
@include box-shadow-important(0 0 6px lighten($errorText, 20%));
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
fieldset.inputs, fieldset.actions {
|
2
|
+
@include clearfix();
|
3
|
+
|
4
|
+
margin: $baseLineHeight (1.5 * $baseLineHeight);
|
5
|
+
padding: 0;
|
6
|
+
|
7
|
+
border: none;
|
8
|
+
}
|
9
|
+
|
10
|
+
fieldset.inputs {
|
11
|
+
padding-top: 0.75 * $baseLineHeight;
|
12
|
+
|
13
|
+
> legend {
|
14
|
+
display: block;
|
15
|
+
width: 100%;
|
16
|
+
|
17
|
+
margin-bottom: 1.5 * $baseLineHeight;
|
18
|
+
padding: 0;
|
19
|
+
|
20
|
+
@include font-shorthand(1.5 * $baseFontSize, normal, 1.5 * $baseLineHeight);
|
21
|
+
|
22
|
+
color: $grayDark;
|
23
|
+
|
24
|
+
border: none;
|
25
|
+
border-bottom: 1px solid #eee;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
fieldset.actions {
|
30
|
+
> legend {
|
31
|
+
display: none;
|
32
|
+
}
|
33
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
fieldset.inputs {
|
2
|
+
ol {
|
3
|
+
margin: 0;
|
4
|
+
padding: 0;
|
5
|
+
|
6
|
+
list-style: none;
|
7
|
+
|
8
|
+
> li.input {
|
9
|
+
margin: (0.5 * $baseLineHeight) 0 $baseLineHeight 0;
|
10
|
+
@include clearfix();
|
11
|
+
|
12
|
+
@import "inputs/stringish";
|
13
|
+
@import "inputs/range";
|
14
|
+
@import "inputs/text";
|
15
|
+
@import "inputs/boolean";
|
16
|
+
@import "inputs/check_boxes";
|
17
|
+
@import "inputs/radio";
|
18
|
+
@import "inputs/select";
|
19
|
+
@import "inputs/file";
|
20
|
+
@import "inputs/datetime";
|
21
|
+
|
22
|
+
.input-mini { width: 1 * $gridColumnWidth !important; }
|
23
|
+
.input-small { width: 1.5 * $gridColumnWidth !important; }
|
24
|
+
.input-medium { width: 2 * $gridColumnWidth !important; }
|
25
|
+
.input-large { width: 3.5 * $gridColumnWidth !important; }
|
26
|
+
.input-xlarge { width: 5 * $gridColumnWidth !important; }
|
27
|
+
.input-xxlarge { width: 9 * $gridColumnWidth !important; }
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,150 @@
|
|
1
|
+
@mixin box-shadow-important($shadow: 0 1px 3px rgba(0, 0, 0, 0.25)) {
|
2
|
+
-webkit-box-shadow: $shadow !important;
|
3
|
+
-moz-box-shadow: $shadow !important;
|
4
|
+
box-shadow: $shadow !important;
|
5
|
+
}
|
6
|
+
|
7
|
+
@mixin button() {
|
8
|
+
display: inline-block;
|
9
|
+
@include ie7-inline-block();
|
10
|
+
padding: 4px 10px 4px;
|
11
|
+
margin-bottom: 0; // For input.btn
|
12
|
+
font-size: $baseFontSize;
|
13
|
+
line-height: $baseLineHeight;
|
14
|
+
color: $grayDark;
|
15
|
+
text-align: center;
|
16
|
+
text-shadow: 0 1px 1px rgba(255,255,255,.75);
|
17
|
+
vertical-align: middle;
|
18
|
+
@include buttonBackground($btnBackground, $btnBackgroundHighlight);
|
19
|
+
border: 1px solid $btnBorder;
|
20
|
+
border-bottom-color: darken($btnBorder, 10%);
|
21
|
+
@include border-radius(4px);
|
22
|
+
$shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
|
23
|
+
@include box-shadow($shadow);
|
24
|
+
cursor: pointer;
|
25
|
+
|
26
|
+
// Give IE7 some love
|
27
|
+
@include ie7-restore-left-whitespace();
|
28
|
+
|
29
|
+
&:hover {
|
30
|
+
color: $grayDark;
|
31
|
+
text-decoration: none;
|
32
|
+
background-color: darken($white, 10%);
|
33
|
+
background-position: 0 -15px;
|
34
|
+
|
35
|
+
// transition is only when going to hover, otherwise the background
|
36
|
+
// behind the gradient (there for IE<=9 fallback) gets mismatched
|
37
|
+
@include transition(background-position .1s linear);
|
38
|
+
}
|
39
|
+
|
40
|
+
&:focus {
|
41
|
+
@include tab-focus();
|
42
|
+
}
|
43
|
+
|
44
|
+
&:active {
|
45
|
+
background-image: none;
|
46
|
+
$shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
|
47
|
+
@include box-shadow($shadow);
|
48
|
+
background-color: darken($white, 10%);
|
49
|
+
background-color: darken($white, 15%) \9;
|
50
|
+
outline: 0;
|
51
|
+
}
|
52
|
+
|
53
|
+
&[disabled] {
|
54
|
+
cursor: default;
|
55
|
+
background-image: none;
|
56
|
+
background-color: darken($white, 10%);
|
57
|
+
@include opacity(0.65);
|
58
|
+
@include box-shadow(none);
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
@mixin button-primary() {
|
63
|
+
&, &:hover {
|
64
|
+
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
|
65
|
+
color: $white;
|
66
|
+
}
|
67
|
+
|
68
|
+
@include buttonBackground($btnPrimaryBackground, $btnPrimaryBackgroundHighlight);
|
69
|
+
}
|
70
|
+
|
71
|
+
@mixin text-input() {
|
72
|
+
display: inline-block;
|
73
|
+
width: $inputWidth;
|
74
|
+
height: $baseLineHeight;
|
75
|
+
padding: 4px;
|
76
|
+
margin-bottom: 0.25 * $baseLineHeight;
|
77
|
+
color: $gray;
|
78
|
+
border: 1px solid $inputBorder;
|
79
|
+
|
80
|
+
@include font-shorthand($baseFontSize, normal, $baseLineHeight);
|
81
|
+
|
82
|
+
@include border-radius(3px);
|
83
|
+
|
84
|
+
@include box-shadow(inset 0 1px 1px rgba(0, 0, 0, 0.075));
|
85
|
+
$transition: border linear .2s, box-shadow linear .2s;
|
86
|
+
@include transition($transition);
|
87
|
+
|
88
|
+
&:focus {
|
89
|
+
border-color: rgba(82,168,236,.8);
|
90
|
+
$shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
|
91
|
+
@include box-shadow($shadow);
|
92
|
+
outline: 0;
|
93
|
+
outline: thin dotted \9; /* IE6-9 */
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
@mixin required-abbr($top-offset) {
|
98
|
+
abbr {
|
99
|
+
position: absolute;
|
100
|
+
right: 9px;
|
101
|
+
top: $top-offset;
|
102
|
+
color: red;
|
103
|
+
border: none;
|
104
|
+
font-size: 1.5 * $baseFontSize;
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
@mixin label-common($abbr-top-offset: 2px) {
|
109
|
+
color: $grayDark;
|
110
|
+
text-align: right;
|
111
|
+
|
112
|
+
@include font-shorthand($baseFontSize, normal, $baseLineHeight);
|
113
|
+
@include required-abbr($abbr-top-offset);
|
114
|
+
}
|
115
|
+
|
116
|
+
@mixin switch-input($selector) {
|
117
|
+
#{$selector} {
|
118
|
+
width: auto;
|
119
|
+
height: $baseLineHeight;
|
120
|
+
padding: 0;
|
121
|
+
margin: -2px (0.3 * $baseLineHeight) 0 0;
|
122
|
+
*margin-top: 0; /* IE7 */
|
123
|
+
line-height: normal;
|
124
|
+
cursor: pointer;
|
125
|
+
@include border-radius(0);
|
126
|
+
border: 0 \9; /* IE9 and down */
|
127
|
+
|
128
|
+
&:focus {
|
129
|
+
@include box-shadow(none);
|
130
|
+
@include tab-focus();
|
131
|
+
}
|
132
|
+
}
|
133
|
+
|
134
|
+
&.input {
|
135
|
+
#{$selector} {
|
136
|
+
margin-left: $labelWidth;
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
140
|
+
label {
|
141
|
+
position: relative;
|
142
|
+
display: inline-block;
|
143
|
+
|
144
|
+
padding-right: 20px;
|
145
|
+
|
146
|
+
cursor: pointer;
|
147
|
+
|
148
|
+
@include label-common($abbr-top-offset: -2px);
|
149
|
+
}
|
150
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
label {
|
2
|
+
font-size: medium;
|
3
|
+
font-weight: normal;
|
4
|
+
line-height: normal;
|
5
|
+
display: inline;
|
6
|
+
margin: 0;
|
7
|
+
color: transparent;
|
8
|
+
|
9
|
+
input, textarea, select {
|
10
|
+
display: inline;
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
.label {
|
15
|
+
padding: 0;
|
16
|
+
font-size: medium;
|
17
|
+
font-weight: normal;
|
18
|
+
line-height: normal;
|
19
|
+
color: transparent;
|
20
|
+
vertical-align: baseline;
|
21
|
+
white-space: normal;
|
22
|
+
text-shadow: none;
|
23
|
+
background-color: transparent;
|
24
|
+
@include border-radius(none);
|
25
|
+
|
26
|
+
&:hover {
|
27
|
+
color: transparent;
|
28
|
+
text-decoration: none;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
legend {
|
33
|
+
border: none;
|
34
|
+
}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
&.check_boxes {
|
2
|
+
padding: 0;
|
3
|
+
|
4
|
+
fieldset.choices {
|
5
|
+
@include clearfix();
|
6
|
+
|
7
|
+
margin: 0;
|
8
|
+
padding: 0;
|
9
|
+
|
10
|
+
border: none;
|
11
|
+
|
12
|
+
> legend.label {
|
13
|
+
display: block;
|
14
|
+
float: left;
|
15
|
+
margin: 0;
|
16
|
+
padding: 0;
|
17
|
+
|
18
|
+
width: $labelWidth;
|
19
|
+
|
20
|
+
label {
|
21
|
+
position: relative;
|
22
|
+
display: inline-block;
|
23
|
+
|
24
|
+
margin: 0;
|
25
|
+
padding: 4px 20px 4px 0;
|
26
|
+
width: $labelWidth - 20px;
|
27
|
+
|
28
|
+
line-height: $baseLineHeight;
|
29
|
+
|
30
|
+
@include label-common();
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
> ol.choices-group {
|
35
|
+
display: block;
|
36
|
+
margin: 0;
|
37
|
+
padding: 0;
|
38
|
+
margin-left: $labelWidth;
|
39
|
+
|
40
|
+
> li.choice {
|
41
|
+
padding: 4px 0;
|
42
|
+
line-height: $baseLineHeight;
|
43
|
+
|
44
|
+
@include switch-input("input[type='checkbox']");
|
45
|
+
|
46
|
+
> label {
|
47
|
+
@include label-common();
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
&.date, &.time, &.datetime {
|
2
|
+
padding: 0;
|
3
|
+
|
4
|
+
fieldset.fragments {
|
5
|
+
@include clearfix();
|
6
|
+
|
7
|
+
margin: 0;
|
8
|
+
padding: 0;
|
9
|
+
|
10
|
+
border: none;
|
11
|
+
|
12
|
+
> legend.label {
|
13
|
+
display: block;
|
14
|
+
float: left;
|
15
|
+
margin: 0;
|
16
|
+
padding: 0;
|
17
|
+
|
18
|
+
width: $labelWidth;
|
19
|
+
|
20
|
+
label {
|
21
|
+
position: relative;
|
22
|
+
display: inline-block;
|
23
|
+
|
24
|
+
margin: 0;
|
25
|
+
padding: 4px 20px 4px 0;
|
26
|
+
width: $labelWidth - 20px;
|
27
|
+
|
28
|
+
line-height: $baseLineHeight;
|
29
|
+
|
30
|
+
@include label-common();
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
> ol.fragments-group {
|
35
|
+
display: block;
|
36
|
+
margin: 0;
|
37
|
+
padding: 0;
|
38
|
+
margin-left: $labelWidth;
|
39
|
+
|
40
|
+
> li.fragment {
|
41
|
+
display: inline-block;
|
42
|
+
padding: 4px (0.5 * $baseLineHeight) 4px 0;
|
43
|
+
line-height: $baseLineHeight;
|
44
|
+
|
45
|
+
> label {
|
46
|
+
@include label-common();
|
47
|
+
display: block;
|
48
|
+
width: 100%;
|
49
|
+
padding-right: 0;
|
50
|
+
text-align: left;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
&.file {
|
2
|
+
input[type='file'] {
|
3
|
+
// Reset the file input to browser defaults
|
4
|
+
width: auto;
|
5
|
+
padding: initial;
|
6
|
+
line-height: initial;
|
7
|
+
border: initial;
|
8
|
+
background-color: $inputBackground;
|
9
|
+
background-color: initial;
|
10
|
+
@include box-shadow(none);
|
11
|
+
|
12
|
+
// Set the height of select and file controls to match text inputs
|
13
|
+
height: 28px; /* In IE7, the height of the select element cannot be changed by height, only font-size */
|
14
|
+
*margin-top: 4px; /* For IE7, add top margin to align select with labels */
|
15
|
+
line-height: 28px;
|
16
|
+
|
17
|
+
// Reset line-height for IE
|
18
|
+
line-height: 18px \9;
|
19
|
+
|
20
|
+
padding-bottom: 4px;
|
21
|
+
|
22
|
+
&:focus {
|
23
|
+
@include box-shadow(none);
|
24
|
+
@include tab-focus();
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
&.radio {
|
2
|
+
padding: 0;
|
3
|
+
|
4
|
+
fieldset.choices {
|
5
|
+
@include clearfix();
|
6
|
+
|
7
|
+
margin: 0;
|
8
|
+
padding: 0;
|
9
|
+
|
10
|
+
border: none;
|
11
|
+
|
12
|
+
> legend.label {
|
13
|
+
display: block;
|
14
|
+
float: left;
|
15
|
+
margin: 0;
|
16
|
+
padding: 0;
|
17
|
+
|
18
|
+
width: $labelWidth;
|
19
|
+
|
20
|
+
label {
|
21
|
+
position: relative;
|
22
|
+
display: inline-block;
|
23
|
+
|
24
|
+
margin: 0;
|
25
|
+
padding: 4px 20px 4px 0;
|
26
|
+
width: $labelWidth - 20px;
|
27
|
+
|
28
|
+
line-height: $baseLineHeight;
|
29
|
+
|
30
|
+
@include label-common();
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
> ol.choices-group {
|
35
|
+
display: block;
|
36
|
+
margin: 0;
|
37
|
+
padding: 0;
|
38
|
+
margin-left: $labelWidth;
|
39
|
+
|
40
|
+
> li.choice {
|
41
|
+
padding: 4px 0;
|
42
|
+
line-height: $baseLineHeight;
|
43
|
+
|
44
|
+
@include switch-input("input[type='radio']");
|
45
|
+
|
46
|
+
> label {
|
47
|
+
@include label-common();
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
&.select, &.time_zone, &.country {
|
2
|
+
select {
|
3
|
+
display: inline-block;
|
4
|
+
width: $inputWidth;
|
5
|
+
padding: 4px;
|
6
|
+
margin-bottom: 9px;
|
7
|
+
color: $gray;
|
8
|
+
background-color: $inputBackground;
|
9
|
+
border: 1px solid $inputBorder;
|
10
|
+
@include border-radius(3px);
|
11
|
+
|
12
|
+
height: 28px; /* In IE7, the height of the select element cannot be changed by height, only font-size */
|
13
|
+
*margin-top: 4px; /* For IE7, add top margin to align select with labels */
|
14
|
+
|
15
|
+
@include font-shorthand($baseFontSize, normal, 28px);
|
16
|
+
font-family: $baseFontFamily;
|
17
|
+
}
|
18
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "formtastic-plus/all";
|
metadata
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: formtastic-plus
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0.rc1
|
5
|
+
prerelease: 6
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Anton Ageev
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-04-07 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: railties
|
16
|
+
requirement: &13706440 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.1.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *13706440
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: sass-rails
|
27
|
+
requirement: &13423660 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *13423660
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: bootstrap-sass
|
38
|
+
requirement: &12324740 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '2.0'
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *12324740
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: formtastic
|
49
|
+
requirement: &12165120 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.1'
|
55
|
+
type: :runtime
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *12165120
|
58
|
+
description: formtastic-plus makes a formtastic form to look like a bootstrap form.
|
59
|
+
email: antage@gmail.com
|
60
|
+
executables: []
|
61
|
+
extensions: []
|
62
|
+
extra_rdoc_files: []
|
63
|
+
files:
|
64
|
+
- lib/formtastic-plus.rb
|
65
|
+
- lib/assets/stylesheets/formtastic-plus.css.scss
|
66
|
+
- lib/assets/stylesheets/formtastic-plus/_all.scss
|
67
|
+
- lib/assets/stylesheets/formtastic-plus/_form.scss
|
68
|
+
- lib/assets/stylesheets/formtastic-plus/_fieldset.scss
|
69
|
+
- lib/assets/stylesheets/formtastic-plus/_actions.scss
|
70
|
+
- lib/assets/stylesheets/formtastic-plus/_inputs.scss
|
71
|
+
- lib/assets/stylesheets/formtastic-plus/_labels.scss
|
72
|
+
- lib/assets/stylesheets/formtastic-plus/inputs/_stringish.scss
|
73
|
+
- lib/assets/stylesheets/formtastic-plus/inputs/_text.scss
|
74
|
+
- lib/assets/stylesheets/formtastic-plus/inputs/_boolean.scss
|
75
|
+
- lib/assets/stylesheets/formtastic-plus/inputs/_radio.scss
|
76
|
+
- lib/assets/stylesheets/formtastic-plus/inputs/_check_boxes.scss
|
77
|
+
- lib/assets/stylesheets/formtastic-plus/inputs/_select.scss
|
78
|
+
- lib/assets/stylesheets/formtastic-plus/inputs/_range.scss
|
79
|
+
- lib/assets/stylesheets/formtastic-plus/inputs/_file.scss
|
80
|
+
- lib/assets/stylesheets/formtastic-plus/inputs/_datetime.scss
|
81
|
+
- lib/assets/stylesheets/formtastic-plus/_mixins.scss
|
82
|
+
- lib/assets/stylesheets/formtastic-plus/_hints.scss
|
83
|
+
- lib/assets/stylesheets/formtastic-plus/_errors.scss
|
84
|
+
- lib/assets/stylesheets/formtastic-plus/_disabled.scss
|
85
|
+
- lib/assets/stylesheets/formtastic-plus/_reset.scss
|
86
|
+
- lib/assets/stylesheets/bootstrap-without-forms.css.scss
|
87
|
+
- README.md
|
88
|
+
- LICENSE
|
89
|
+
homepage: http://github.com/antage/formtastic-plus
|
90
|
+
licenses: []
|
91
|
+
post_install_message:
|
92
|
+
rdoc_options: []
|
93
|
+
require_paths:
|
94
|
+
- lib
|
95
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ! '>='
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
|
+
none: false
|
103
|
+
requirements:
|
104
|
+
- - ! '>'
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: 1.3.1
|
107
|
+
requirements: []
|
108
|
+
rubyforge_project:
|
109
|
+
rubygems_version: 1.8.15
|
110
|
+
signing_key:
|
111
|
+
specification_version: 3
|
112
|
+
summary: formtastic meets bootstrap
|
113
|
+
test_files: []
|