bootstrap-generators 1.4.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +238 -21
- data/bootstrap-generators.gemspec +3 -3
- data/lib/bootstrap-generators.rb +0 -1
- data/lib/bootstrap/generators/version.rb +1 -1
- data/lib/generators/bootstrap/install/install_generator.rb +5 -12
- data/lib/generators/bootstrap/install/templates/assets/stylesheets/fluid.css +5 -5
- data/lib/generators/bootstrap/install/templates/assets/stylesheets/fluid.css.less +119 -0
- data/lib/generators/bootstrap/install/templates/assets/stylesheets/fluid.css.scss +5 -5
- data/lib/generators/bootstrap/install/templates/assets/stylesheets/hero.css +0 -5
- data/lib/generators/bootstrap/install/templates/assets/stylesheets/hero.css.less +114 -0
- data/lib/generators/bootstrap/install/templates/assets/stylesheets/hero.css.scss +0 -5
- data/lib/generators/bootstrap/install/templates/config/initializers/simple_form.rb +118 -40
- data/lib/generators/bootstrap/install/templates/config/locales/simple_form.en.yml +24 -0
- data/lib/generators/bootstrap/install/templates/form_builders/form_builder/_form.html.erb +9 -8
- data/lib/generators/bootstrap/install/templates/form_builders/form_builder/_form.html.haml +8 -7
- data/lib/generators/bootstrap/install/templates/form_builders/simple_form/_form.html.erb +5 -7
- data/lib/generators/bootstrap/install/templates/form_builders/simple_form/_form.html.haml +6 -7
- data/lib/generators/bootstrap/install/templates/layouts/fluid.html.erb +50 -47
- data/lib/generators/bootstrap/install/templates/layouts/fluid.html.haml +75 -55
- data/lib/generators/bootstrap/install/templates/layouts/hero.html.erb +11 -14
- data/lib/generators/bootstrap/install/templates/layouts/hero.html.haml +9 -11
- data/lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/edit.html.erb +8 -2
- data/lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/index.html.erb +5 -2
- data/lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/new.html.erb +4 -1
- data/lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/show.html.erb +8 -2
- data/lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/edit.html.haml +6 -2
- data/lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/index.html.haml +4 -2
- data/lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/new.html.haml +3 -1
- data/lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/show.html.haml +6 -2
- data/test/lib/generators/bootstrap/install_generator_test.rb +6 -20
- data/test/test_helper.rb +1 -1
- data/vendor/assets/images/glyphicons-halflings-white.png +0 -0
- data/vendor/assets/images/glyphicons-halflings.png +0 -0
- data/vendor/assets/javascripts/bootstrap-alert.js +91 -0
- data/vendor/assets/javascripts/bootstrap-button.js +98 -0
- data/vendor/assets/javascripts/bootstrap-carousel.js +154 -0
- data/vendor/assets/javascripts/bootstrap-collapse.js +136 -0
- data/vendor/assets/javascripts/bootstrap-dropdown.js +58 -21
- data/vendor/assets/javascripts/bootstrap-modal.js +63 -114
- data/vendor/assets/javascripts/bootstrap-popover.js +38 -33
- data/vendor/assets/javascripts/bootstrap-scrollspy.js +62 -44
- data/vendor/assets/javascripts/bootstrap-tab.js +130 -0
- data/vendor/assets/javascripts/bootstrap-tooltip.js +270 -0
- data/vendor/assets/javascripts/bootstrap-transition.js +51 -0
- data/vendor/assets/javascripts/bootstrap-typeahead.js +271 -0
- data/vendor/assets/javascripts/bootstrap.js +11 -6
- data/vendor/assets/stylesheets/bootstrap.css +2497 -1602
- data/vendor/assets/stylesheets/less/accordion.less +28 -0
- data/vendor/assets/stylesheets/less/alerts.less +70 -0
- data/vendor/assets/stylesheets/less/bootstrap.less +62 -0
- data/vendor/assets/stylesheets/less/breadcrumbs.less +22 -0
- data/vendor/assets/stylesheets/less/button-groups.less +147 -0
- data/vendor/assets/stylesheets/less/buttons.less +165 -0
- data/vendor/assets/stylesheets/less/carousel.less +121 -0
- data/vendor/assets/stylesheets/less/close.less +18 -0
- data/vendor/assets/stylesheets/less/code.less +44 -0
- data/vendor/assets/stylesheets/less/component-animations.less +18 -0
- data/vendor/assets/stylesheets/less/dropdowns.less +131 -0
- data/vendor/assets/stylesheets/less/forms.less +515 -0
- data/vendor/assets/stylesheets/less/grid.less +8 -0
- data/vendor/assets/stylesheets/less/hero-unit.less +20 -0
- data/vendor/assets/stylesheets/less/labels.less +16 -0
- data/vendor/assets/stylesheets/less/layouts.less +17 -0
- data/vendor/assets/stylesheets/less/mixins.less +537 -0
- data/vendor/assets/stylesheets/less/modals.less +72 -0
- data/vendor/assets/stylesheets/less/navbar.less +292 -0
- data/vendor/assets/stylesheets/less/navs.less +344 -0
- data/vendor/assets/stylesheets/less/pager.less +30 -0
- data/vendor/assets/stylesheets/less/pagination.less +55 -0
- data/vendor/assets/stylesheets/less/popovers.less +49 -0
- data/vendor/assets/stylesheets/less/progress-bars.less +95 -0
- data/vendor/assets/stylesheets/less/reset.less +126 -0
- data/vendor/assets/stylesheets/less/responsive.less +323 -0
- data/vendor/assets/stylesheets/less/scaffolding.less +29 -0
- data/vendor/assets/stylesheets/less/sprites.less +156 -0
- data/vendor/assets/stylesheets/less/tables.less +139 -0
- data/vendor/assets/stylesheets/less/thumbnails.less +35 -0
- data/vendor/assets/stylesheets/less/tooltip.less +35 -0
- data/vendor/assets/stylesheets/less/type.less +217 -0
- data/vendor/assets/stylesheets/less/utilities.less +23 -0
- data/vendor/assets/stylesheets/less/variables.less +99 -0
- data/vendor/assets/stylesheets/less/wells.less +17 -0
- metadata +62 -33
- data/lib/bootstrap/helpers/form_builder.rb +0 -26
- data/lib/generators/bootstrap/install/templates/app/inputs/boolean_input.rb +0 -12
- data/lib/generators/bootstrap/install/templates/app/inputs/collection_input.rb +0 -12
- data/lib/generators/bootstrap/install/templates/app/inputs/date_time_input.rb +0 -16
- data/lib/generators/bootstrap/install/templates/app/inputs/file_input.rb +0 -16
- data/lib/generators/bootstrap/install/templates/app/inputs/numeric_input.rb +0 -16
- data/lib/generators/bootstrap/install/templates/app/inputs/password_input.rb +0 -16
- data/lib/generators/bootstrap/install/templates/app/inputs/string_input.rb +0 -16
- data/lib/generators/bootstrap/install/templates/app/inputs/text_input.rb +0 -16
- data/lib/generators/bootstrap/install/templates/assets/stylesheets/container-app.css +0 -53
- data/lib/generators/bootstrap/install/templates/assets/stylesheets/container-app.css.scss +0 -55
- data/lib/generators/bootstrap/install/templates/layouts/container-app.html.erb +0 -58
- data/lib/generators/bootstrap/install/templates/layouts/container-app.html.haml +0 -46
- data/vendor/assets/javascripts/bootstrap-alerts.js +0 -113
- data/vendor/assets/javascripts/bootstrap-buttons.js +0 -62
- data/vendor/assets/javascripts/bootstrap-tabs.js +0 -80
- data/vendor/assets/javascripts/bootstrap-twipsy.js +0 -321
- data/vendor/assets/stylesheets/bootstrap.min.css +0 -356
@@ -4,6 +4,11 @@
|
|
4
4
|
|
5
5
|
body {
|
6
6
|
padding-top: 60px;
|
7
|
+
padding-bottom: 40px;
|
8
|
+
}
|
9
|
+
|
10
|
+
.sidebar-nav {
|
11
|
+
padding: 9px 0;
|
7
12
|
}
|
8
13
|
|
9
14
|
.page-header {
|
@@ -15,8 +20,3 @@ body {
|
|
15
20
|
margin-right: 8px;
|
16
21
|
}
|
17
22
|
}
|
18
|
-
|
19
|
-
.form-stacked div.alert-message {
|
20
|
-
margin-left: -10px;
|
21
|
-
}
|
22
|
-
|
@@ -0,0 +1,114 @@
|
|
1
|
+
@import "less/bootstrap";
|
2
|
+
|
3
|
+
body {
|
4
|
+
padding-top: 60px;
|
5
|
+
}
|
6
|
+
|
7
|
+
.page-header {
|
8
|
+
a.btn {
|
9
|
+
float: right;
|
10
|
+
}
|
11
|
+
|
12
|
+
a.btn + a.btn {
|
13
|
+
margin-right: 8px;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
// Variables to customize the look and feel of Bootstrap
|
18
|
+
// -----------------------------------------------------
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
// GLOBAL VALUES
|
23
|
+
// --------------------------------------------------
|
24
|
+
|
25
|
+
// Links
|
26
|
+
@linkColor: #08c;
|
27
|
+
@linkColorHover: darken(@linkColor, 15%);
|
28
|
+
|
29
|
+
// Grays
|
30
|
+
@black: #000;
|
31
|
+
@grayDarker: #222;
|
32
|
+
@grayDark: #333;
|
33
|
+
@gray: #555;
|
34
|
+
@grayLight: #999;
|
35
|
+
@grayLighter: #eee;
|
36
|
+
@white: #fff;
|
37
|
+
|
38
|
+
// Accent colors
|
39
|
+
@blue: #049cdb;
|
40
|
+
@blueDark: #0064cd;
|
41
|
+
@green: #46a546;
|
42
|
+
@red: #9d261d;
|
43
|
+
@yellow: #ffc40d;
|
44
|
+
@orange: #f89406;
|
45
|
+
@pink: #c3325f;
|
46
|
+
@purple: #7a43b6;
|
47
|
+
|
48
|
+
// Typography
|
49
|
+
@baseFontSize: 13px;
|
50
|
+
@baseFontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
51
|
+
@baseLineHeight: 18px;
|
52
|
+
@textColor: @grayDark;
|
53
|
+
|
54
|
+
// Buttons
|
55
|
+
@primaryButtonBackground: @linkColor;
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
// COMPONENT VARIABLES
|
60
|
+
// --------------------------------------------------
|
61
|
+
|
62
|
+
// Z-index master list
|
63
|
+
// Used for a bird's eye view of components dependent on the z-axis
|
64
|
+
// Try to avoid customizing these :)
|
65
|
+
@zindexDropdown: 1000;
|
66
|
+
@zindexPopover: 1010;
|
67
|
+
@zindexTooltip: 1020;
|
68
|
+
@zindexFixedNavbar: 1030;
|
69
|
+
@zindexModalBackdrop: 1040;
|
70
|
+
@zindexModal: 1050;
|
71
|
+
|
72
|
+
// Input placeholder text color
|
73
|
+
@placeholderText: @grayLight;
|
74
|
+
|
75
|
+
// Navbar
|
76
|
+
@navbarHeight: 40px;
|
77
|
+
@navbarBackground: @grayDarker;
|
78
|
+
@navbarBackgroundHighlight: @grayDark;
|
79
|
+
|
80
|
+
@navbarText: @grayLight;
|
81
|
+
@navbarLinkColor: @grayLight;
|
82
|
+
@navbarLinkColorHover: @white;
|
83
|
+
|
84
|
+
// Form states and alerts
|
85
|
+
@warningText: #c09853;
|
86
|
+
@warningBackground: #fcf8e3;
|
87
|
+
@warningBorder: darken(spin(@warningBackground, -10), 3%);
|
88
|
+
|
89
|
+
@errorText: #b94a48;
|
90
|
+
@errorBackground: #f2dede;
|
91
|
+
@errorBorder: darken(spin(@errorBackground, -10), 3%);
|
92
|
+
|
93
|
+
@successText: #468847;
|
94
|
+
@successBackground: #dff0d8;
|
95
|
+
@successBorder: darken(spin(@successBackground, -10), 5%);
|
96
|
+
|
97
|
+
@infoText: #3a87ad;
|
98
|
+
@infoBackground: #d9edf7;
|
99
|
+
@infoBorder: darken(spin(@infoBackground, -10), 7%);
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
// GRID
|
104
|
+
// --------------------------------------------------
|
105
|
+
|
106
|
+
// Default 940px grid
|
107
|
+
@gridColumns: 12;
|
108
|
+
@gridColumnWidth: 60px;
|
109
|
+
@gridGutterWidth: 20px;
|
110
|
+
@gridRowWidth: (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1));
|
111
|
+
|
112
|
+
// Fluid grid
|
113
|
+
@fluidGridColumnWidth: 6.382978723%;
|
114
|
+
@fluidGridGutterWidth: 2.127659574%;
|
@@ -1,53 +1,132 @@
|
|
1
1
|
# Use this setup block to configure all options available in SimpleForm.
|
2
2
|
SimpleForm.setup do |config|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
#
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
3
|
+
# Wrappers are used by the form builder to generate a
|
4
|
+
# complete input. You can remove any component from the
|
5
|
+
# wrapper, change the order or even add your own to the
|
6
|
+
# stack. The options given below are used to wrap the
|
7
|
+
# whole input.
|
8
|
+
config.wrappers :default, :class => :input,
|
9
|
+
:hint_class => :field_with_hint, :error_class => :field_with_errors do |b|
|
10
|
+
## Extensions enabled by default
|
11
|
+
# Any of these extensions can be disabled for a
|
12
|
+
# given input by passing: `f.input EXTENSION_NAME => false`.
|
13
|
+
# You can make any of these extensions optional by
|
14
|
+
# renaming `b.use` to `b.optional`.
|
15
|
+
|
16
|
+
# Determines whether to use HTML5 (:email, :url, ...)
|
17
|
+
# and required attributes
|
18
|
+
b.use :html5
|
19
|
+
|
20
|
+
# Calculates placeholders automatically from I18n
|
21
|
+
# You can also pass a string as f.input :placeholder => "Placeholder"
|
22
|
+
b.use :placeholder
|
23
|
+
|
24
|
+
## Optional extensions
|
25
|
+
# They are disabled unless you pass `f.input EXTENSION_NAME => :lookup`
|
26
|
+
# to the input. If so, they will retrieve the values from the model
|
27
|
+
# if any exists. If you want to enable the lookup for any of those
|
28
|
+
# extensions by default, you can change `b.optional` to `b.use`.
|
29
|
+
|
30
|
+
# Calculates maxlength from length validations for string inputs
|
31
|
+
b.optional :maxlength
|
32
|
+
|
33
|
+
# Calculates pattern from format validations for string inputs
|
34
|
+
b.optional :pattern
|
35
|
+
|
36
|
+
# Calculates min and max from length validations for numeric inputs
|
37
|
+
b.optional :min_max
|
38
|
+
|
39
|
+
# Calculates readonly automatically from readonly attributes
|
40
|
+
b.optional :readonly
|
41
|
+
|
42
|
+
## Inputs
|
43
|
+
b.use :label_input
|
44
|
+
b.use :hint, :tag => :span, :class => :hint
|
45
|
+
b.use :error, :tag => :span, :class => :error
|
46
|
+
end
|
47
|
+
|
48
|
+
config.wrappers :bootstrap, :tag => 'div', :class => 'control-group', :error_class => 'error' do |b|
|
49
|
+
b.use :placeholder
|
50
|
+
b.use :label, :class => 'control-label'
|
51
|
+
b.use :tag => 'div', :class => 'controls' do |ba|
|
52
|
+
ba.use :input
|
53
|
+
ba.use :error, :tag => 'span', :class => 'help-inline'
|
54
|
+
ba.use :hint, :tag => 'p', :class => 'help-block'
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
config.wrappers :prepend, :tag => 'div', :class => "control-group", :error_class => 'error' do |b|
|
59
|
+
b.use :placeholder
|
60
|
+
b.use :label, :class => 'control-label'
|
61
|
+
b.use :hint, :tag => 'span', :class => 'help-block'
|
62
|
+
b.use :tag => 'div', :class => 'controls' do |input|
|
63
|
+
input.use :tag => 'div', :class => 'input-prepend' do |prepend|
|
64
|
+
prepend.use :input
|
65
|
+
end
|
66
|
+
input.use :error, :tag => 'span', :class => 'help-inline'
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
config.wrappers :append, :tag => 'div', :class => "control-group", :error_class => 'error' do |b|
|
71
|
+
b.use :placeholder
|
72
|
+
b.use :label, :class => 'control-label'
|
73
|
+
b.use :hint, :tag => 'span', :class => 'help-block'
|
74
|
+
b.use :tag => 'div', :class => 'controls' do |input|
|
75
|
+
input.use :tag => 'div', :class => 'input-append' do |append|
|
76
|
+
append.use :input
|
77
|
+
end
|
78
|
+
input.use :error, :tag => 'span', :class => 'help-inline'
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# Wrappers for forms and inputs using the Twitter Bootstrap toolkit.
|
83
|
+
# Check the Bootstrap docs (http://twitter.github.com/bootstrap)
|
84
|
+
# to learn about the different styles for forms and inputs,
|
85
|
+
# buttons and other elements.
|
86
|
+
config.default_wrapper = :bootstrap
|
87
|
+
|
88
|
+
# Define the way to render check boxes / radio buttons with labels.
|
89
|
+
# Defaults to :nested for bootstrap config.
|
90
|
+
# :inline => input + label
|
91
|
+
# :nested => label > input
|
92
|
+
config.boolean_style = :nested
|
93
|
+
|
94
|
+
# Default class for buttons
|
95
|
+
config.button_class = 'btn'
|
18
96
|
|
19
97
|
# Method used to tidy up errors.
|
20
98
|
# config.error_method = :first
|
21
99
|
|
22
100
|
# Default tag used for error notification helper.
|
23
101
|
# config.error_notification_tag = :p
|
102
|
+
config.error_notification_tag = :span
|
24
103
|
|
25
104
|
# CSS class to add for error notification helper.
|
26
105
|
# config.error_notification_class = :error_notification
|
106
|
+
config.error_notification_class = nil
|
27
107
|
|
28
108
|
# ID to add for error notification helper.
|
29
109
|
# config.error_notification_id = nil
|
30
110
|
|
31
|
-
#
|
32
|
-
# config.
|
33
|
-
|
34
|
-
# CSS class to add to all wrapper tags.
|
35
|
-
config.wrapper_class = :clearfix
|
111
|
+
# Series of attempts to detect a default label method for collection.
|
112
|
+
# config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
|
36
113
|
|
37
|
-
#
|
38
|
-
config.
|
114
|
+
# Series of attempts to detect a default value method for collection.
|
115
|
+
# config.collection_value_methods = [ :id, :to_s ]
|
39
116
|
|
40
117
|
# You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
|
41
118
|
# config.collection_wrapper_tag = nil
|
42
119
|
|
43
|
-
# You can
|
44
|
-
# config.
|
120
|
+
# You can define the class to use on all collection wrappers. Defaulting to none.
|
121
|
+
# config.collection_wrapper_class = nil
|
45
122
|
|
46
|
-
#
|
47
|
-
#
|
123
|
+
# You can wrap each item in a collection of radio/check boxes with a tag,
|
124
|
+
# defaulting to :span. Please note that when using :boolean_style = :nested,
|
125
|
+
# SimpleForm will force this option to be a label.
|
126
|
+
# config.item_wrapper_tag = :span
|
48
127
|
|
49
|
-
#
|
50
|
-
# config.
|
128
|
+
# You can define a class to use in all item wrappers. Defaulting to none.
|
129
|
+
# config.item_wrapper_class = nil
|
51
130
|
|
52
131
|
# How the label text should be generated altogether with the required text.
|
53
132
|
# config.label_text = lambda { |label, required| "#{required} #{label}" }
|
@@ -56,7 +135,7 @@ SimpleForm.setup do |config|
|
|
56
135
|
# config.label_class = nil
|
57
136
|
|
58
137
|
# You can define the class to use on all forms. Default is simple_form.
|
59
|
-
|
138
|
+
config.form_class = 'form-horizontal'
|
60
139
|
|
61
140
|
# Whether attributes are required by default (or not). Default is true.
|
62
141
|
# config.required_by_default = true
|
@@ -65,20 +144,14 @@ SimpleForm.setup do |config|
|
|
65
144
|
# Default is enabled.
|
66
145
|
config.browser_validations = false
|
67
146
|
|
68
|
-
#
|
69
|
-
#
|
70
|
-
# Having this on in non-HTML5 compliant sites can cause odd behavior in
|
71
|
-
# HTML5-aware browsers such as Chrome.
|
72
|
-
# config.html5 = true
|
147
|
+
# Collection of methods to detect if a file type was given.
|
148
|
+
# config.file_methods = [ :mounted_as, :file?, :public_filename ]
|
73
149
|
|
74
150
|
# Custom mappings for input types. This should be a hash containing a regexp
|
75
151
|
# to match as key, and the input type that will be used when the field name
|
76
152
|
# matches the regexp as value.
|
77
153
|
# config.input_mappings = { /count/ => :integer }
|
78
154
|
|
79
|
-
# Collection of methods to detect if a file type was given.
|
80
|
-
# config.file_methods = [ :mounted_as, :file?, :public_filename ]
|
81
|
-
|
82
155
|
# Default priority for time_zone inputs.
|
83
156
|
# config.time_zone_priority = nil
|
84
157
|
|
@@ -88,7 +161,12 @@ SimpleForm.setup do |config|
|
|
88
161
|
# Default size for text inputs.
|
89
162
|
# config.default_input_size = 50
|
90
163
|
|
91
|
-
# When false, do not use translations for labels
|
92
|
-
# config.
|
93
|
-
end
|
164
|
+
# When false, do not use translations for labels.
|
165
|
+
# config.translate_labels = true
|
94
166
|
|
167
|
+
# Automatically discover new inputs in Rails' autoload path.
|
168
|
+
# config.inputs_discovery = true
|
169
|
+
|
170
|
+
# Cache simple form inputs discovery
|
171
|
+
# config.cache_discovery = !Rails.env.development?
|
172
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
en:
|
2
|
+
simple_form:
|
3
|
+
"yes": 'Yes'
|
4
|
+
"no": 'No'
|
5
|
+
required:
|
6
|
+
text: 'required'
|
7
|
+
mark: '*'
|
8
|
+
# You can uncomment the line below if you need to overwrite the whole required html.
|
9
|
+
# When using html, text and mark won't be used.
|
10
|
+
# html: '<abbr title="required">*</abbr>'
|
11
|
+
error_notification:
|
12
|
+
default_message: "Some errors were found, please take a look:"
|
13
|
+
# Labels and hints examples
|
14
|
+
# labels:
|
15
|
+
# password: 'Password'
|
16
|
+
# user:
|
17
|
+
# new:
|
18
|
+
# email: 'E-mail para efetuar o sign in.'
|
19
|
+
# edit:
|
20
|
+
# email: 'E-mail.'
|
21
|
+
# hints:
|
22
|
+
# username: 'User name to sign in.'
|
23
|
+
# password: 'No special characters, please.'
|
24
|
+
|
@@ -1,7 +1,8 @@
|
|
1
1
|
<%%= form_for(@<%= singular_table_name %>) do |f| %>
|
2
2
|
<%% if @<%= singular_table_name %>.errors.any? %>
|
3
|
-
<div class="alert
|
4
|
-
<
|
3
|
+
<div class="alert alert-error">
|
4
|
+
<a class="close" data-dismiss="alert" href="#">×</a>
|
5
|
+
<h4 class="alert-heading"><%%= pluralize(@<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h4>
|
5
6
|
|
6
7
|
<ul>
|
7
8
|
<%% @<%= singular_table_name %>.errors.full_messages.each do |msg| %>
|
@@ -12,14 +13,14 @@
|
|
12
13
|
<%% end %>
|
13
14
|
|
14
15
|
<% attributes.each do |attribute| -%>
|
15
|
-
<div class="
|
16
|
-
<%%= f.label :<%= attribute.name
|
17
|
-
<div class="
|
18
|
-
<%%= f.<%= attribute.field_type %> :<%= attribute.name
|
16
|
+
<div class="control-group">
|
17
|
+
<%%= f.label :<%= attribute.name %>, :class => "control-label" %>
|
18
|
+
<div class="controls">
|
19
|
+
<%%= f.<%= attribute.field_type %> :<%= attribute.name %>, :class => "input-xxlarge" %>
|
19
20
|
</div>
|
20
21
|
</div>
|
21
22
|
<% end -%>
|
22
|
-
<div class="actions">
|
23
|
-
<%%= f.submit %>
|
23
|
+
<div class="form-actions">
|
24
|
+
<%%= f.submit, :class => "btn btn-primary" %>
|
24
25
|
</div>
|
25
26
|
<%% end %>
|
@@ -1,17 +1,18 @@
|
|
1
1
|
= form_for @<%= singular_table_name %> do |f|
|
2
2
|
-if @<%= singular_table_name %>.errors.any?
|
3
|
-
.alert
|
4
|
-
%
|
3
|
+
.alert.alert-error
|
4
|
+
%a.close{:href => "#", :"data-dismiss" => "alert"} ×
|
5
|
+
%h4= "#{pluralize(@<%= singular_table_name %>.errors.count, "error")} prohibited this <%= singular_table_name %> from being saved:"
|
5
6
|
|
6
7
|
%ul
|
7
8
|
- @<%= singular_table_name %>.errors.full_messages.each do |msg|
|
8
9
|
%li= msg
|
9
10
|
|
10
11
|
<% for attribute in attributes -%>
|
11
|
-
.
|
12
|
-
= f.label :<%= attribute.name
|
13
|
-
.
|
14
|
-
= f.<%= attribute.field_type %> :<%= attribute.name
|
12
|
+
.control-group
|
13
|
+
= f.label :<%= attribute.name %>, :class => 'control-label'
|
14
|
+
.controls
|
15
|
+
= f.<%= attribute.field_type %> :<%= attribute.name %>, :class => 'input-xxlarge'
|
15
16
|
<% end -%>
|
16
17
|
.actions
|
17
|
-
= f.submit :class => 'btn primary'
|
18
|
+
= f.submit :class => 'btn btn-primary'
|