bootstrap_builder 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.DS_Store +0 -0
- data/LICENSE.txt +20 -0
- data/README.md +63 -0
- data/Rakefile +14 -0
- data/VERSION +1 -0
- data/app/.DS_Store +0 -0
- data/app/assets/images/glyphicons-halflings-white.png +0 -0
- data/app/assets/images/glyphicons-halflings.png +0 -0
- data/app/assets/javascripts/bootstrap.js +1722 -0
- data/app/assets/javascripts/formatted_form.js +17 -0
- data/app/assets/stylesheets/bootstrap-responsive.css +567 -0
- data/app/assets/stylesheets/bootstrap.css +3365 -0
- data/app/views/bootstrap_builder/_check_box.html.haml +14 -0
- data/app/views/bootstrap_builder/_default_field.html.haml +33 -0
- data/app/views/bootstrap_builder/_radio_button.html.haml +24 -0
- data/app/views/bootstrap_builder/_submit.html.haml +9 -0
- data/bootstrap_builder.gemspec +62 -0
- data/lib/bootstrap_builder/.DS_Store +0 -0
- data/lib/bootstrap_builder/builder.rb +168 -0
- data/lib/bootstrap_builder/configuration.rb +17 -0
- data/lib/bootstrap_builder/engine.rb +14 -0
- data/lib/bootstrap_builder/helper.rb +13 -0
- data/lib/bootstrap_builder/railtie.rb +12 -0
- data/lib/bootstrap_builder.rb +20 -0
- data/rails-bootstrap-builder.gemspec +52 -0
- data/vendor/.DS_Store +0 -0
- metadata +74 -0
data/.DS_Store
ADDED
Binary file
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2012 Jack Neto, The Working Group
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# Bootstrap Builder
|
2
|
+
Author: [The Working Group](http://www.theworkinggroup.ca)
|
3
|
+
|
4
|
+
---
|
5
|
+
|
6
|
+
## What is it?
|
7
|
+
|
8
|
+
A Rails form builder that generates [Twitter Bootstrap](http://twitter.github.com/bootstrap) markup and helps keep your code clean.
|
9
|
+
|
10
|
+
* Uses existing Rails helpers
|
11
|
+
* Autogenerates labels
|
12
|
+
|
13
|
+
|
14
|
+
## Installation
|
15
|
+
|
16
|
+
Add gem definition to your Gemfile:
|
17
|
+
|
18
|
+
gem 'bootstrap_builder'
|
19
|
+
|
20
|
+
Then from the Rails project's root run:
|
21
|
+
|
22
|
+
bundle install
|
23
|
+
|
24
|
+
## Usage (with haml)
|
25
|
+
|
26
|
+
### A sample user form
|
27
|
+
|
28
|
+
Override the autogenerated label by using the `:label` option on any element
|
29
|
+
|
30
|
+
= bootstrap_form_for @user, :url => [:admin, @user] do |f|
|
31
|
+
= f.text_field :name
|
32
|
+
= f.text_field :email
|
33
|
+
= f.password_field :password
|
34
|
+
= f.password_field :password_confirmation
|
35
|
+
= f.select :role, User::ROLES
|
36
|
+
= f.time_zone_select :time_zone
|
37
|
+
= f.check_box :reminder, :label => 'Send Daily Reminder?'
|
38
|
+
= f.submit 'Save'
|
39
|
+
|
40
|
+
### A login form
|
41
|
+
|
42
|
+
Add a class to the form or any field to change the way it is rendered.
|
43
|
+
|
44
|
+
= bootstrap_form_for @session_user, :url => login_path, :class => 'form-horizontal' do |f|
|
45
|
+
= f.text_field :email
|
46
|
+
= f.password_field :password
|
47
|
+
= f.check_box :remember_me, :label => 'Remember me when I come back'
|
48
|
+
= f.submit 'Log In'
|
49
|
+
|
50
|
+
### A search form
|
51
|
+
|
52
|
+
Hide the label by passing `:label => ''` on any field.
|
53
|
+
|
54
|
+
Useful for inline search forms.
|
55
|
+
|
56
|
+
|
57
|
+
= bootstrap_form_for @search, :url => [:admin, :users], :html => {:method => :get, :class => 'form-search'} do |f|
|
58
|
+
= f.text_field :name_equals, :label => 'Find by', :placeholder => 'Name'
|
59
|
+
= f.select :role_equals, User::ROLES, :label => ''
|
60
|
+
= f.submit 'Search', :class => 'btn-default'
|
61
|
+
|
62
|
+
*(Example using [MetaSearch](https://github.com/ernie/meta_search) helpers)*
|
63
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'jeweler'
|
4
|
+
|
5
|
+
Jeweler::Tasks.new do |gem|
|
6
|
+
gem.name = "bootstrap_builder"
|
7
|
+
gem.homepage = "http://github.com/twg/bootstrap_builder"
|
8
|
+
gem.license = "MIT"
|
9
|
+
gem.summary = "A Rails form builder that generates Twitter Bootstrap markup"
|
10
|
+
gem.description = ''
|
11
|
+
gem.email = "jack@twg.ca"
|
12
|
+
gem.authors = ["Jack Neto", 'The Working Group Inc.']
|
13
|
+
end
|
14
|
+
Jeweler::RubygemsDotOrgTasks.new
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.0
|
data/app/.DS_Store
ADDED
Binary file
|
Binary file
|
Binary file
|