twitter-bootstrap-rails 1.4.3 → 2.0rc0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of twitter-bootstrap-rails might be problematic. Click here for more details.

Files changed (72) hide show
  1. data/README.md +85 -52
  2. data/lib/generators/bootstrap/install/templates/bootstrap.coffee +15 -12
  3. data/lib/generators/bootstrap/layout/layout_generator.rb +1 -1
  4. data/lib/generators/bootstrap/layout/templates/layout.html.erb +97 -50
  5. data/lib/generators/bootstrap/layout/templates/layout.html.slim +40 -0
  6. data/lib/generators/bootstrap/themed/templates/_form.html.erb +5 -1
  7. data/lib/generators/bootstrap/themed/templates/edit.html.erb +2 -1
  8. data/lib/generators/bootstrap/themed/templates/index.html.erb +1 -0
  9. data/lib/generators/bootstrap/themed/templates/new.html.erb +1 -1
  10. data/lib/generators/bootstrap/themed/templates/show.html.erb +7 -3
  11. data/lib/generators/bootstrap/themed/themed_generator.rb +0 -15
  12. data/lib/twitter-bootstrap-rails.rb +3 -3
  13. data/lib/twitter/bootstrap/rails/bootstrap.rb +1 -1
  14. data/lib/twitter/bootstrap/rails/version.rb +1 -1
  15. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
  16. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
  17. data/vendor/assets/javascripts/twitter/bootstrap.js +10 -6
  18. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +91 -0
  19. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-button.js +98 -0
  20. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +154 -0
  21. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +136 -0
  22. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +58 -21
  23. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +63 -114
  24. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +38 -33
  25. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +62 -44
  26. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +130 -0
  27. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +270 -0
  28. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +51 -0
  29. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +271 -0
  30. data/vendor/toolkit/twitter/bootstrap/accordion.less +28 -0
  31. data/vendor/toolkit/twitter/bootstrap/alerts.less +70 -0
  32. data/vendor/toolkit/twitter/bootstrap/bootstrap.less +41 -5
  33. data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +22 -0
  34. data/vendor/toolkit/twitter/bootstrap/button-groups.less +147 -0
  35. data/vendor/toolkit/twitter/bootstrap/buttons.less +165 -0
  36. data/vendor/toolkit/twitter/bootstrap/carousel.less +121 -0
  37. data/vendor/toolkit/twitter/bootstrap/close.less +18 -0
  38. data/vendor/toolkit/twitter/bootstrap/code.less +44 -0
  39. data/vendor/toolkit/twitter/bootstrap/component-animations.less +18 -0
  40. data/vendor/toolkit/twitter/bootstrap/dropdowns.less +131 -0
  41. data/vendor/toolkit/twitter/bootstrap/forms.less +335 -299
  42. data/vendor/toolkit/twitter/bootstrap/grid.less +8 -0
  43. data/vendor/toolkit/twitter/bootstrap/hero-unit.less +20 -0
  44. data/vendor/toolkit/twitter/bootstrap/labels.less +16 -0
  45. data/vendor/toolkit/twitter/bootstrap/layouts.less +17 -0
  46. data/vendor/toolkit/twitter/bootstrap/mixins.less +391 -76
  47. data/vendor/toolkit/twitter/bootstrap/modals.less +72 -0
  48. data/vendor/toolkit/twitter/bootstrap/navbar.less +292 -0
  49. data/vendor/toolkit/twitter/bootstrap/navs.less +344 -0
  50. data/vendor/toolkit/twitter/bootstrap/pager.less +30 -0
  51. data/vendor/toolkit/twitter/bootstrap/pagination.less +55 -0
  52. data/vendor/toolkit/twitter/bootstrap/popovers.less +49 -0
  53. data/vendor/toolkit/twitter/bootstrap/progress-bars.less +95 -0
  54. data/vendor/toolkit/twitter/bootstrap/reset.less +37 -52
  55. data/vendor/toolkit/twitter/bootstrap/responsive.less +323 -0
  56. data/vendor/toolkit/twitter/bootstrap/scaffolding.less +13 -123
  57. data/vendor/toolkit/twitter/bootstrap/sprites.less +156 -0
  58. data/vendor/toolkit/twitter/bootstrap/tables.less +75 -160
  59. data/vendor/toolkit/twitter/bootstrap/thumbnails.less +35 -0
  60. data/vendor/toolkit/twitter/bootstrap/tooltip.less +35 -0
  61. data/vendor/toolkit/twitter/bootstrap/type.less +100 -70
  62. data/vendor/toolkit/twitter/bootstrap/utilities.less +23 -0
  63. data/vendor/toolkit/twitter/bootstrap/variables.less +94 -55
  64. data/vendor/toolkit/twitter/bootstrap/wells.less +17 -0
  65. metadata +58 -49
  66. data/lib/generators/bootstrap/themed/templates/builders/builder.rb +0 -24
  67. data/lib/generators/bootstrap/themed/templates/builders/helper.rb +0 -6
  68. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-alerts.js +0 -124
  69. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-buttons.js +0 -64
  70. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tabs.js +0 -80
  71. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-twipsy.js +0 -321
  72. data/vendor/toolkit/twitter/bootstrap/patterns.less +0 -1063
data/README.md CHANGED
@@ -1,6 +1,5 @@
1
1
  # Twitter Bootstrap for Rails 3.1 Asset Pipeline
2
- Bootstrap is a toolkit from Twitter designed to kickstart development of webapps and sites.
3
- It includes base CSS and HTML for typography, forms, buttons, tables, grids, navigation, and more.
2
+ Bootstrap is a toolkit from Twitter designed to kickstart development of webapps and sites. It includes base CSS and HTML for typography, forms, buttons, tables, grids, navigation, and more.
4
3
 
5
4
 
6
5
  twitter-bootstrap-rails project integrates Bootstrap CSS toolkit for Rails 3.1 Asset Pipeline
@@ -10,7 +9,7 @@ twitter-bootstrap-rails project integrates Bootstrap CSS toolkit for Rails 3.1 A
10
9
 
11
10
  Include Bootstrap in Gemfile;
12
11
 
13
- gem 'twitter-bootstrap-rails'
12
+ gem 'twitter-bootstrap-rails', :group => :assets
14
13
 
15
14
  or you can install from latest build;
16
15
 
@@ -25,42 +24,47 @@ You can run bundle from command line
25
24
 
26
25
  You can run following generators to get started with Twitter Bootstrap quickly.
27
26
 
28
- 1. Install (requires directives to Asset pipeline.)
27
+
28
+ Install (requires directives to Asset pipeline.)
29
29
 
30
30
 
31
31
  Usage:
32
32
 
33
- rails g bootstrap:install
33
+
34
+ rails g bootstrap:install
34
35
 
35
36
 
36
- 2. Layout (generates Twitter Bootstrap compatible layout.)
37
+ Layout (generates Twitter Bootstrap compatible layout.) - (Slim supported)
37
38
 
38
39
 
39
40
  Usage:
40
41
 
41
- rails g bootstrap:layout [LAYOUT_NAME] [*fixed or fluid] [options]
42
+
43
+ rails g bootstrap:layout [LAYOUT_NAME] [*fixed or fluid] [options]
42
44
 
43
45
 
44
46
  Example:
45
47
 
46
48
 
47
- rails g bootstrap:layout application fixed
49
+ rails g bootstrap:layout application fixed
48
50
 
49
51
 
50
- 3. Themed (generates Twitter Bootstrap compatible scaffold views.)
52
+ Themed (generates Twitter Bootstrap compatible scaffold views.)
51
53
 
52
54
 
53
55
  Usage:
54
56
 
55
57
 
56
- rails g bootstrap:themed [RESOURCE_NAME] [LAYOUT] [options]
58
+ rails g bootstrap:themed [RESOURCE_NAME] [LAYOUT] [options]
57
59
 
58
60
 
59
61
  Example:
60
62
 
61
63
 
62
- rails g scaffold post title:string description:text
63
- rails g bootstrap:themed posts
64
+ rails g scaffold post title:string description:text
65
+ rake db:migrate
66
+ rails g bootstrap:themed posts
67
+
64
68
 
65
69
 
66
70
  ## Using with Less
@@ -104,45 +108,28 @@ Using Twitter Bootstrap with the CoffeeScript is easy.
104
108
  twitter-bootstrap-rails generates a "bootstrap.js.coffee" file for you
105
109
  to /app/assets/javascripts/ folder.
106
110
 
107
- $ ->
108
- $("body > .topbar").scrollSpy()
109
- $ ->
110
- $(".tabs").tabs()
111
- $ ->
112
- $("a[rel=twipsy]").twipsy live: true
113
- $ ->
114
- $("a[rel=popover]").popover offset: 10
115
- $ ->
116
- $(".topbar-wrapper").dropdown()
117
- $ ->
118
- $(".alert-message").alert()
119
- $ ->
120
- domModal = $(".modal").modal(
121
- backdrop: true
122
- closeOnEscape: true
123
- )
124
- $(".open-modal").click ->
125
- domModal.toggle()
126
- $ ->
127
- $(".btn").button "complete"
128
-
129
-
130
- ## Using simple_form and integrating Twitter Bootstrap (optionally)
131
-
132
- First, include simple_form in Gemfile;
133
-
134
- gem 'simple_form'
135
-
136
-
137
- Create initializer for simple_form to ("/config/initializers/simple_form.rb")
138
-
139
-
140
- Check this gist;
141
-
142
- https://gist.github.com/1479043
143
-
144
-
145
- Note: Don't forget to reboot server.
111
+ $ ->
112
+ $(".alert-message").alert()
113
+ $ ->
114
+ $(".tabs").button()
115
+ $ ->
116
+ $(".carousel").carousel()
117
+ $ ->
118
+ $(".collapse").collapse()
119
+ $ ->
120
+ $(".dropdown-toggle").dropdown()
121
+ $ ->
122
+ $(".modal").modal
123
+ $ ->
124
+ $("a[rel]").popover
125
+ $ ->
126
+ $(".navbar").scrollspy()
127
+ $ ->
128
+ $(".tab").tab "show"
129
+ $ ->
130
+ $(".tooltip").tooltip
131
+ $ ->
132
+ $(".typeahead").typeahead()
146
133
 
147
134
 
148
135
  ## Using Static CSS, JS (w/o Less)
@@ -154,14 +141,60 @@ twitter-bootstrap-rails has seperate branch (w/o Less) that just serves latest s
154
141
  gem 'twitter-bootstrap-rails', :git => "git://github.com/seyhunak/twitter-bootstrap-rails.git", :branch => "static"
155
142
 
156
143
 
144
+ ## Changelog
145
+ <ul>
146
+ <li>Version 0.0.5 deprecated</li>
147
+ <li>Asset files updated to latest and removed version numbers</li>
148
+ <li>Implemented Less::Rails Railtie to use with LESS</li>
149
+ <li>Fixed railtie to only initialize Less when installed</li>
150
+ <li>New branch for the static version of Bootstrap (w/o Less) - check static branch</li>
151
+ <li>Added path to support heroku deploy</li>
152
+ <li>Rake precompile issue fixed</li>
153
+ <li>Updated asset files to 1.4.0</li>
154
+ <li>Updated dependency less-rails (now requires 2.1.0)</li>
155
+ <li>Added generators</li>
156
+ <li>Fixed generators</li>
157
+ <li>Fixed class name conflicts from (bootstrap.js.coffee)</li>
158
+ <li>Fixed jquery-rails gem version dependency</li>
159
+ <li>Updated asset files</li>
160
+ <li>Added new generators (install, layout and themed)</li>
161
+ <li>Compability to Rails 3.2</li>
162
+ <li>Transitioning to 2.0</li>
163
+ <li>Released gem v.2.0rc0</li>
164
+ </ul>
165
+
166
+
167
+ ## Contributors & Patches & Forks
168
+ <ul>
169
+ <li>Daniel Morris</li>
170
+ <li>Bradly Feeley</li>
171
+ <li>Guilherme Moreira</li>
172
+ <li>Alex Behar</li>
173
+ <li>Brandon Keene</li>
174
+ <li>Anthony Corcutt</li>
175
+ <li>Colin Warren</li>
176
+ <li>Giovanni Cappellotto</li>
177
+ <li>Masakuni Kato</li>
178
+ <li>Gudleik Rasch</li>
179
+ </ul>
180
+
181
+
182
+ ## Future
183
+ <ul>
184
+ <li>Writing tests (not implemented yet)</li>
185
+ <li>Markup Helpers (alert, tabs, pagination, breadcrumbs etc.)</li>
186
+ </ul>
187
+
188
+
157
189
  ## Credits
158
190
  Seyhun Akyürek - seyhunak [at] gmail com
159
191
 
160
192
  [Follow me on Twitter](http://twitter.com/seyhunak "Twitter")
193
+ [Follow me on Google+](http://plus.ly/seyhunak "Google+")
161
194
 
162
195
 
163
196
  ## Thanks
164
- Twitter Bootstrap
197
+ Twitter Bootstrap and all twitter-bootstrap-rails contributors
165
198
  http://twitter.github.com/bootstrap
166
199
 
167
200
 
@@ -1,19 +1,22 @@
1
1
  $ ->
2
- $("body > .topbar").scrollSpy()
2
+ $(".alert-message").alert()
3
3
  $ ->
4
- $(".tabs").tabs()
4
+ $(".tabs").button()
5
5
  $ ->
6
- $("a[rel=twipsy]").twipsy live: true
6
+ $(".carousel").carousel()
7
7
  $ ->
8
- $("a[rel=popover]").popover offset: 10
8
+ $(".collapse").collapse()
9
9
  $ ->
10
- $(".topbar-wrapper").dropdown()
10
+ $(".dropdown-toggle").dropdown()
11
11
  $ ->
12
- $(".alert-message").alert()
12
+ $(".modal").modal
13
+ $ ->
14
+ $("a[rel]").popover
15
+ $ ->
16
+ $(".navbar").scrollspy()
17
+ $ ->
18
+ $(".tab").tab "show"
19
+ $ ->
20
+ $(".tooltip").tooltip
13
21
  $ ->
14
- domModal = $(".modal").modal(
15
- backdrop: true
16
- closeOnEscape: true
17
- )
18
- $(".open-modal").click ->
19
- domModal.toggle()
22
+ $(".typeahead").typeahead()
@@ -16,7 +16,7 @@ module Bootstrap
16
16
  @app_name = app.class.to_s.split("::").first
17
17
  @container_class = layout_type == "fluid" ? "container-fluid" : "container"
18
18
  ext = app.config.generators.options[:rails][:template_engine] || :erb
19
- template "layout.html.erb", "app/views/layouts/#{layout_name}.html.erb"
19
+ template "layout.html.#{ext}", "app/views/layouts/#{layout_name}.html.#{ext}"
20
20
  end
21
21
  end
22
22
  end
@@ -1,57 +1,104 @@
1
1
  <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title><%= app_name %></title>
5
- <%%= stylesheet_link_tag "application" %>
6
- <%%= javascript_include_tag "application" %>
7
- <%%= csrf_meta_tags %>
8
- </head>
9
- <body style="padding-top: 60px">
10
- <div class="topbar">
11
- <div class="topbar-inner">
12
- <div class="<%= container_class %>">
13
- <h3><%%= link_to "<%= app_name %>", "/" %></h3>
14
- <ul class="nav">
15
- <%- (1..3).each do |i| -%>
16
- <li><%%= link_to "Link<%= i %>", "/path<%= i %>" %></li>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title><%= app_name %></title>
6
+ <%%= csrf_meta_tags %>
7
+
8
+ <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
9
+ <!--[if lt IE 9]>
10
+ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
11
+ <![endif]-->
12
+
13
+ <!-- Le styles -->
14
+ <%%= stylesheet_link_tag "application" %>
15
+ <style>
16
+ body {
17
+ padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
18
+ }
19
+ </style>
20
+
21
+ <!-- Le fav and touch icons -->
22
+ <link rel="shortcut icon" href="images/favicon.ico">
23
+ <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
24
+ <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
25
+ <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
26
+ </head>
27
+ <body>
28
+
29
+ <div class="navbar navbar-fixed-top">
30
+ <div class="navbar-inner">
31
+ <%- if layout_type == "fluid" -%>
32
+ <div class="container-fluid">
33
+ <%- else -%>
34
+ <div class="container">
17
35
  <%- end -%>
18
- </ul>
19
- </div>
20
- </div>
21
- </div>
22
- <div class="<%= container_class %>">
23
- <%- if layout_type == "fluid" -%>
24
- <div class="sidebar">
25
- <div class="well">
26
- <h5>Sidebar</h5>
27
- <ul>
28
- <%- (1..3).each do |i| -%>
29
- <li><%%= link_to "Link<%= i %>", "/path<%= i %>" %></li>
30
- <%- end -%>
31
- </ul>
36
+ <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
37
+ <span class="i-bar"></span>
38
+ <span class="i-bar"></span>
39
+ <span class="i-bar"></span>
40
+ </a>
41
+ <a class="brand" href="#"><%= app_name %></a>
42
+ <div class="<%= container_class %> nav-collapse">
43
+ <ul class="nav">
44
+ <%- (1..3).each do |i| -%>
45
+ <li><%%= link_to "Link<%= i %>", "/path<%= i %>" %></li>
46
+ <%- end -%>
47
+ </ul>
48
+ </div><!--/.nav-collapse -->
49
+ </div>
32
50
  </div>
33
51
  </div>
34
- <div class="content">
35
- <%%= yield %>
36
- </div>
37
- <%- else -%>
38
- <div class="content">
39
- <div class="row">
40
- <div class="span11">
52
+
53
+ <div class="<%= container_class %>">
54
+ <%- if layout_type == "fluid" -%>
55
+ <div class="row-fluid">
56
+ <div class="span3">
57
+ <div class="well sidebar-nav">
58
+ <ul class="nav nav-list">
59
+ <li class="nav-header">Sidebar</li>
60
+ <%- (1..3).each do |i| -%>
61
+ <li><%%= link_to "Link<%= i %>", "/path<%= i %>" %></li>
62
+ <%- end -%>
63
+ </ul>
64
+ </div><!--/.well -->
65
+ </div><!--/span-->
66
+ <div class="span9">
41
67
  <%%= yield %>
42
68
  </div>
43
- <div class="span1">&nbsp;</div>
44
- <div class="span4">
45
- <h3>Sidebar</h3>
46
- <ul>
47
- <%- (1..3).each do |i| -%>
48
- <li><%%= link_to "Link<%= i %>", "/path<%= i %>" %></li>
49
- <%- end -%>
50
- </ul>
69
+ </div><!--/row-->
70
+ <%- else -%>
71
+ <div class="content">
72
+ <div class="row">
73
+ <div class="span9">
74
+ <%%= yield %>
75
+ </div>
76
+ <div class="span1">&nbsp;</div>
77
+ <div class="span3">
78
+ <div class="well sidebar-nav">
79
+ <h3>Sidebar</h3>
80
+ <ul class="nav nav-list">
81
+ <li class="nav-header">Sidebar</li>
82
+ <%- (1..3).each do |i| -%>
83
+ <li><%%= link_to "Link<%= i %>", "/path<%= i %>" %></li>
84
+ <%- end -%>
85
+ </ul>
86
+ </div>
87
+ </div>
88
+ </div>
51
89
  </div>
52
- </div>
53
- </div>
54
- <%- end -%>
55
- </div>
56
- </body>
57
- </html>
90
+ <%- end -%>
91
+
92
+ <footer>
93
+ <p>&copy; Company 2012</p>
94
+ </footer>
95
+
96
+ </div> <!-- /container -->
97
+
98
+ <!-- Le javascript
99
+ ================================================== -->
100
+ <!-- Placed at the end of the document so the pages load faster -->
101
+ <%%= javascript_include_tag "application" %>
102
+
103
+ </body>
104
+ </html>
@@ -0,0 +1,40 @@
1
+ doctype html
2
+ html lang="en"
3
+ head
4
+ meta charset="utf-8"
5
+ title= content_for?(:title) ? yield(:title) : "<%= app_name %>"
6
+ = javascript_include_tag "application"
7
+ = stylesheet_link_tag "application"
8
+
9
+ body
10
+ .navbar
11
+ .navbar-inner
12
+ .<%= container_class %>
13
+ h3= link_to "<%= app_name %>", root_path, :class => "brand"
14
+ ul.nav
15
+ li= link_to "Link 1", "/path1"
16
+ li= link_to "Link 2", "/path2"
17
+ li= link_to "Link 3", "/path3"
18
+
19
+ .<%= container_class %>
20
+ <%- if layout_type == "fluid" -%>
21
+ .sidebar
22
+ .well
23
+ h5 Sidebar
24
+ ul
25
+ li= link_to "Link 1", "/path1"
26
+ li= link_to "Link 2", "/path2"
27
+ li= link_to "Link 3", "/path3"
28
+ .content= yield
29
+ <% else %>
30
+ .content
31
+ .row
32
+ .span9= yield
33
+ .span1 &nbsp;
34
+ .span3
35
+ h3 Sidebar
36
+ ul
37
+ li= link_to "Link 1", "/path1"
38
+ li= link_to "Link 2", "/path2"
39
+ li= link_to "Link 3", "/path3"
40
+ <% end %>
@@ -1,6 +1,10 @@
1
1
  <% columns.each do |column| %>
2
- <%%= f.label :<%= column.name %>, t("activerecord.attributes.<%= model_name.underscore %>.<%= column.name %>", :default => "<%= column.name.humanize %>"), :class => :label %>
2
+ <div class="clearfix">
3
+ <%%= f.label :<%= column.name %>, t("activerecord.attributes.<%= model_name.underscore %>.<%= column.name %>", :default => "<%= column.name.humanize %>"), :class => :label %>
4
+ <div class="input">
3
5
  <%%= f.<%= column.field_type %> :<%= column.name %>, :class => '<%= column.field_type %>' %>
6
+ </div>
7
+ </div>
4
8
  <%- end -%>
5
9
  <div class="actions">
6
10
  <button class="btn primary" type="submit">Save</button> or