bootstrapped 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. data/.gitignore +0 -1
  2. data/Gemfile.lock +133 -0
  3. data/README.rdoc +101 -0
  4. data/bootstrapped.gemspec +4 -0
  5. data/features/bootstrap_layout.feature +13 -0
  6. data/features/bootstrap_scaffold.feature +80 -0
  7. data/features/step_definitions/common_steps.rb +62 -0
  8. data/features/step_definitions/rails_setup_steps.rb +6 -0
  9. data/features/support/env.rb +6 -0
  10. data/features/support/matchers.rb +7 -0
  11. data/lib/bootstrapped.rb +2 -1
  12. data/lib/bootstrapped/engine.rb +3 -1
  13. data/lib/bootstrapped/version.rb +1 -1
  14. data/lib/generators/bootstrapped/install/install_generator.rb +26 -0
  15. data/{vendor/assets/stylesheets/bootstrap.css.less → lib/generators/bootstrapped/install/templates/bootstrap.less} +2 -2
  16. data/{vendor/assets/stylesheets/forms.css.less → lib/generators/bootstrapped/install/templates/forms.less} +49 -35
  17. data/{vendor/assets/stylesheets/mixins.css.less → lib/generators/bootstrapped/install/templates/mixins.less} +35 -30
  18. data/{vendor/assets/stylesheets/patterns.css.less → lib/generators/bootstrapped/install/templates/patterns.less} +97 -42
  19. data/{vendor/assets/stylesheets/reset.css.less → lib/generators/bootstrapped/install/templates/reset.less} +0 -0
  20. data/{vendor/assets/stylesheets/scaffolding.css.less → lib/generators/bootstrapped/install/templates/scaffolding.less} +20 -18
  21. data/{vendor/assets/stylesheets/tables.css.less → lib/generators/bootstrapped/install/templates/tables.less} +68 -15
  22. data/{vendor/assets/stylesheets/type.css.less → lib/generators/bootstrapped/install/templates/type.less} +0 -0
  23. data/{vendor/assets/stylesheets/variables.css.less → lib/generators/bootstrapped/install/templates/variables.less} +0 -0
  24. data/lib/generators/bootstrapped/layout/templates/error_messages_helper.rb +7 -5
  25. data/lib/generators/bootstrapped/layout/templates/layout.html.erb +13 -7
  26. data/lib/generators/bootstrapped/layout/templates/layout_helper.rb +5 -1
  27. data/lib/generators/bootstrapped/scaffold/templates/views/erb/_form.html.erb +1 -0
  28. data/vendor/assets/javascripts/.DS_Store +0 -0
  29. data/vendor/assets/javascripts/{bootstrap-alerts.js → twitter/bootstrap/bootstrap-alerts.js} +18 -9
  30. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-buttons.js +62 -0
  31. data/vendor/assets/javascripts/{bootstrap-dropdown.js → twitter/bootstrap/bootstrap-dropdown.js} +17 -12
  32. data/vendor/assets/javascripts/{bootstrap-modal.js → twitter/bootstrap/bootstrap-modal.js} +57 -35
  33. data/vendor/assets/javascripts/{bootstrap-popover.js → twitter/bootstrap/bootstrap-popover.js} +20 -7
  34. data/vendor/assets/javascripts/{bootstrap-scrollspy.js → twitter/bootstrap/bootstrap-scrollspy.js} +4 -2
  35. data/vendor/assets/javascripts/{bootstrap-tabs.js → twitter/bootstrap/bootstrap-tabs.js} +25 -7
  36. data/vendor/assets/javascripts/{bootstrap-twipsy.js → twitter/bootstrap/bootstrap-twipsy.js} +30 -16
  37. data/vendor/assets/stylesheets/.DS_Store +0 -0
  38. data/vendor/assets/stylesheets/{bootstrap.css → twitter/bootstrap/bootstrap.css} +238 -133
  39. data/vendor/framework/bootstrap.less +26 -0
  40. data/vendor/framework/forms.less +479 -0
  41. data/vendor/framework/mixins.less +222 -0
  42. data/vendor/framework/patterns.less +1060 -0
  43. data/vendor/framework/reset.less +141 -0
  44. data/vendor/framework/scaffolding.less +137 -0
  45. data/vendor/framework/tables.less +224 -0
  46. data/vendor/framework/type.less +187 -0
  47. data/vendor/framework/variables.less +60 -0
  48. metadata +90 -29
  49. data/vendor/.DS_Store +0 -0
  50. data/vendor/assets/.DS_Store +0 -0
@@ -7,10 +7,8 @@
7
7
  // STRUCTURAL LAYOUT
8
8
  // -----------------
9
9
 
10
- html, body {
11
- background-color: @white;
12
- }
13
10
  body {
11
+ background-color: @white;
14
12
  margin: 0;
15
13
  #font > .sans-serif(normal,@basefont,@baseline);
16
14
  color: @grayDark;
@@ -29,7 +27,9 @@ body {
29
27
  padding-right: 20px;
30
28
  .clearfix();
31
29
  > .sidebar {
32
- float: left;
30
+ position: absolute;
31
+ top: 0;
32
+ left: 20px;
33
33
  width: 220px;
34
34
  }
35
35
  // TODO in v2: rename this and .popover .content to be more specific
@@ -77,12 +77,12 @@ a {
77
77
 
78
78
  .row {
79
79
  .clearfix();
80
- margin-left: -1 * @gridGutterWidth;
80
+ margin-left: -@gridGutterWidth;
81
81
  }
82
82
 
83
83
  // Find all .span# classes within .row and give them the necessary properties for grid columns (supported by all browsers back to IE7)
84
84
  // Credit to @dhg for the idea
85
- [class*="span"] {
85
+ .row > [class*="span"] {
86
86
  .gridColumn();
87
87
  }
88
88
 
@@ -115,18 +115,20 @@ a {
115
115
  .span24 { .columns(24); }
116
116
 
117
117
  // Offset column options
118
- .offset1 { .offset(1); }
119
- .offset2 { .offset(2); }
120
- .offset3 { .offset(3); }
121
- .offset4 { .offset(4); }
122
- .offset5 { .offset(5); }
123
- .offset6 { .offset(6); }
124
- .offset7 { .offset(7); }
125
- .offset8 { .offset(8); }
126
- .offset9 { .offset(9); }
127
- .offset10 { .offset(10); }
128
- .offset11 { .offset(11); }
129
- .offset12 { .offset(12); }
118
+ .row {
119
+ > .offset1 { .offset(1); }
120
+ > .offset2 { .offset(2); }
121
+ > .offset3 { .offset(3); }
122
+ > .offset4 { .offset(4); }
123
+ > .offset5 { .offset(5); }
124
+ > .offset6 { .offset(6); }
125
+ > .offset7 { .offset(7); }
126
+ > .offset8 { .offset(8); }
127
+ > .offset9 { .offset(9); }
128
+ > .offset10 { .offset(10); }
129
+ > .offset11 { .offset(11); }
130
+ > .offset12 { .offset(12); }
131
+ }
130
132
 
131
133
  // Unique column sizes for 16-column grid
132
134
  .span-one-third { width: 300px; }
@@ -11,12 +11,10 @@ table {
11
11
  width: 100%;
12
12
  margin-bottom: @baseline;
13
13
  padding: 0;
14
- border-collapse: separate; // Done so we can round those corners!
15
- *border-collapse: collapse; /* IE7, collapse table to remove spacing */
16
14
  font-size: @basefont;
17
- border: 1px solid #ddd;
18
- .border-radius(4px);
19
- th, td {
15
+ border-collapse: collapse;
16
+ th,
17
+ td {
20
18
  padding: 10px 10px 9px;
21
19
  line-height: @baseline;
22
20
  text-align: left;
@@ -25,21 +23,47 @@ table {
25
23
  padding-top: 9px;
26
24
  font-weight: bold;
27
25
  vertical-align: middle;
28
- border-bottom: 1px solid #ddd;
29
26
  }
30
27
  td {
31
28
  vertical-align: top;
29
+ border-top: 1px solid #ddd;
30
+ }
31
+ // When scoped to row, fix th in tbody
32
+ tbody th {
33
+ border-top: 1px solid #ddd;
34
+ vertical-align: top;
32
35
  }
36
+ }
37
+
38
+
39
+ // CONDENSED VERSION
40
+ // -----------------
41
+ .condensed-table {
42
+ th,
43
+ td {
44
+ padding: 5px 5px 4px;
45
+ }
46
+ }
47
+
48
+
49
+ // BORDERED VERSION
50
+ // ----------------
51
+
52
+ .bordered-table {
53
+ border: 1px solid #ddd;
54
+ border-collapse: separate; // Done so we can round those corners!
55
+ *border-collapse: collapse; /* IE7, collapse table to remove spacing */
56
+ .border-radius(4px);
33
57
  th + th,
34
- td + td {
58
+ td + td,
59
+ th + td {
35
60
  border-left: 1px solid #ddd;
36
61
  }
37
- tr + tr td {
38
- border-top: 1px solid #ddd;
39
- }
62
+ thead tr:first-child th:first-child,
40
63
  tbody tr:first-child td:first-child {
41
64
  .border-radius(4px 0 0 0);
42
65
  }
66
+ thead tr:first-child th:last-child,
43
67
  tbody tr:first-child td:last-child {
44
68
  .border-radius(0 4px 0 0);
45
69
  }
@@ -52,20 +76,52 @@ table {
52
76
  }
53
77
 
54
78
 
79
+ // TABLE CELL SIZES
80
+ // ----------------
81
+
82
+ // This is a duplication of the main grid .columns() mixin, but subtracts 20px to account for input padding and border
83
+ .tableColumns(@columnSpan: 1) {
84
+ width: ((@gridColumnWidth - 20) * @columnSpan) + ((@gridColumnWidth - 20) * (@columnSpan - 1));
85
+ }
86
+ table {
87
+ // Default columns
88
+ .span1 { .tableColumns(1); }
89
+ .span2 { .tableColumns(2); }
90
+ .span3 { .tableColumns(3); }
91
+ .span4 { .tableColumns(4); }
92
+ .span5 { .tableColumns(5); }
93
+ .span6 { .tableColumns(6); }
94
+ .span7 { .tableColumns(7); }
95
+ .span8 { .tableColumns(8); }
96
+ .span9 { .tableColumns(9); }
97
+ .span10 { .tableColumns(10); }
98
+ .span11 { .tableColumns(11); }
99
+ .span12 { .tableColumns(12); }
100
+ .span13 { .tableColumns(13); }
101
+ .span14 { .tableColumns(14); }
102
+ .span15 { .tableColumns(15); }
103
+ .span16 { .tableColumns(16); }
104
+ }
105
+
106
+
55
107
  // ZEBRA-STRIPING
56
108
  // --------------
57
109
 
58
110
  // Default zebra-stripe styles (alternating gray and transparent backgrounds)
59
111
  .zebra-striped {
60
112
  tbody {
61
- tr:nth-child(odd) td {
113
+ tr:nth-child(odd) td,
114
+ tr:nth-child(odd) th {
62
115
  background-color: #f9f9f9;
63
116
  }
64
- tr:hover td {
117
+ tr:hover td,
118
+ tr:hover th {
65
119
  background-color: #f5f5f5;
66
120
  }
67
121
  }
122
+ }
68
123
 
124
+ table {
69
125
  // Tablesorting styles w/ jQuery plugin
70
126
  .header {
71
127
  cursor: pointer;
@@ -111,9 +167,6 @@ table {
111
167
  .opacity(60);
112
168
  }
113
169
  }
114
- }
115
-
116
- table {
117
170
  // Blue Table Headings
118
171
  .blue {
119
172
  color: @blue;
@@ -6,7 +6,8 @@ module ErrorMessagesHelper
6
6
  options[:message] ||= I18n.t(:"activerecord.errors.message", :default => "Correct the following errors and try again.")
7
7
  messages = objects.compact.map { |o| o.errors.full_messages }.flatten
8
8
  unless messages.empty?
9
- content_tag(:div, :class => "error_messages") do
9
+ # forced as error but may not abstractly always be the case
10
+ content_tag(:div, :class => "alert-message block-message error") do
10
11
  list_items = messages.map { |msg| content_tag(:li, msg.html_safe) }
11
12
  content_tag(:h2, options[:header_message].html_safe) + content_tag(:p, options[:message].html_safe) + content_tag(:ul, list_items.join.html_safe)
12
13
  end
@@ -14,11 +15,12 @@ module ErrorMessagesHelper
14
15
  end
15
16
 
16
17
  def display_flash_message
17
- flash.each do |key, value|
18
- css_class = key.eql?('notice') ? 'success' : 'error'
19
- render :partial => 'share/flash', :locals => { :css => css_class, :message => value }
18
+ partials = String.new
19
+ flash.each do |key, value|
20
+ css_class = key.to_s.eql?('notice') ? 'success' : 'error'
21
+ partials << render( :partial => 'share/flash', :locals => { :css => css_class, :message => value })
20
22
  end
21
- nil
23
+ partials.html_safe
22
24
  end
23
25
 
24
26
  module FormBuilderAdditions
@@ -1,5 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <html>
2
+ <html lang="en">
3
3
  <head>
4
4
  <title><%%= content_for?(:title) ? yield(:title) : "Untitled" %></title>
5
5
  <%%= stylesheet_link_tag "application" %>
@@ -11,19 +11,25 @@
11
11
  <div class="topbar">
12
12
  <div class="fill">
13
13
  <div class="container">
14
- <h3><%%= link_to 'Project Name', '#' %></h3>
14
+ <%%= link_to app_name, '#', :class => "brand" %>
15
+ <ul class="nav">
16
+ <li class="active">
17
+ <a href='#'>Home</a>
18
+ </li>
19
+ <li>
20
+ <a href='#'>About</a>
21
+ </li>
22
+ </ul>
23
+ <p class="pull-right"><%%= text_field '#', '#'%></p>
15
24
  </div>
16
25
  </div>
17
26
  </div>
18
27
  <%%= display_flash_message %>
19
28
  <div class="container">
20
- <%% flash.each do |name, msg| %>
21
- <%%= content_tag :div, msg, :id => "flash_#{name}" %>
22
- <%% end %>
23
- <%%= content_tag :h1, yield(:title) if show_title? %>
29
+ <%%= content_tag :h1, yield(:title) if show_title %>
24
30
  <%%= yield %>
25
31
  <footer>
26
- <p>&copy; Company <%%= Time.now.year %></p>
32
+ <p><%%= app_name %> &copy; <%= Time.now.year %></p>
27
33
  </footer>
28
34
  </div>
29
35
  </body>
@@ -8,7 +8,7 @@ module LayoutHelper
8
8
  @show_title = show_title
9
9
  end
10
10
 
11
- def show_title?
11
+ def show_title
12
12
  @show_title
13
13
  end
14
14
 
@@ -19,4 +19,8 @@ module LayoutHelper
19
19
  def javascript(*args)
20
20
  content_for(:head) { javascript_include_tag(*args) }
21
21
  end
22
+
23
+ def app_name
24
+ Rails.application.class.to_s.split("::").first
25
+ end
22
26
  end
@@ -1,3 +1,4 @@
1
+ <%%= error_messages_for <%= item_path :instance_variable => true %> %>
1
2
  <%%= form_for <%= item_path :instance_variable => true %> do |f| %>
2
3
  <fieldset>
3
4
  <%- model_attributes.each do |attribute| -%>
Binary file
@@ -1,5 +1,5 @@
1
1
  /* ==========================================================
2
- * bootstrap-alerts.js v1.3.0
2
+ * bootstrap-alerts.js v1.4.0
3
3
  * http://twitter.github.com/bootstrap/javascript.html#alerts
4
4
  * ==========================================================
5
5
  * Copyright 2011 Twitter, Inc.
@@ -20,6 +20,8 @@
20
20
 
21
21
  !function( $ ){
22
22
 
23
+ "use strict"
24
+
23
25
  /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
24
26
  * ======================================================= */
25
27
 
@@ -38,11 +40,11 @@
38
40
  if ( $.support.transition ) {
39
41
  transitionEnd = "TransitionEnd"
40
42
  if ( $.browser.webkit ) {
41
- transitionEnd = "webkitTransitionEnd"
43
+ transitionEnd = "webkitTransitionEnd"
42
44
  } else if ( $.browser.mozilla ) {
43
- transitionEnd = "transitionend"
45
+ transitionEnd = "transitionend"
44
46
  } else if ( $.browser.opera ) {
45
- transitionEnd = "oTransitionEnd"
47
+ transitionEnd = "oTransitionEnd"
46
48
  }
47
49
  }
48
50
 
@@ -51,9 +53,10 @@
51
53
  /* ALERT CLASS DEFINITION
52
54
  * ====================== */
53
55
 
54
- var Alert = function ( content, selector ) {
56
+ var Alert = function ( content, options ) {
57
+ this.settings = $.extend({}, $.fn.alert.defaults, options)
55
58
  this.$element = $(content)
56
- .delegate(selector || '.close', 'click', this.close)
59
+ .delegate(this.settings.selector, 'click', this.close)
57
60
  }
58
61
 
59
62
  Alert.prototype = {
@@ -92,13 +95,19 @@
92
95
  return $this.data('alert')[options]()
93
96
  }
94
97
 
95
- $(this).data('alert', new Alert( this ))
98
+ $(this).data('alert', new Alert( this, options ))
96
99
 
97
100
  })
98
101
  }
99
102
 
103
+ $.fn.alert.defaults = {
104
+ selector: '.close'
105
+ }
106
+
100
107
  $(document).ready(function () {
101
- new Alert($('body'), '.alert-message[data-alert] .close')
108
+ new Alert($('body'), {
109
+ selector: '.alert-message[data-alert] .close'
110
+ })
102
111
  })
103
112
 
104
- }( window.jQuery || window.ender )
113
+ }( window.jQuery || window.ender );
@@ -0,0 +1,62 @@
1
+ /* ============================================================
2
+ * bootstrap-buttons.js v1.4.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#buttons
4
+ * ============================================================
5
+ * Copyright 2011 Twitter, Inc.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ * ============================================================ */
19
+
20
+ !function( $ ){
21
+
22
+ "use strict"
23
+
24
+ function setState(el, state) {
25
+ var d = 'disabled'
26
+ , $el = $(el)
27
+ , data = $el.data()
28
+
29
+ state = state + 'Text'
30
+ data.resetText || $el.data('resetText', $el.html())
31
+
32
+ $el.html( data[state] || $.fn.button.defaults[state] )
33
+
34
+ state == 'loadingText' ?
35
+ $el.addClass(d).attr(d, d) :
36
+ $el.removeClass(d).removeAttr(d)
37
+ }
38
+
39
+ function toggle(el) {
40
+ $(el).toggleClass('active')
41
+ }
42
+
43
+ $.fn.button = function(options) {
44
+ return this.each(function () {
45
+ if (options == 'toggle') {
46
+ return toggle(this)
47
+ }
48
+ options && setState(this, options)
49
+ })
50
+ }
51
+
52
+ $.fn.button.defaults = {
53
+ loadingText: 'loading...'
54
+ }
55
+
56
+ $(function () {
57
+ $('body').delegate('.btn[data-toggle]', 'click', function () {
58
+ $(this).button('toggle')
59
+ })
60
+ })
61
+
62
+ }( window.jQuery || window.ender );
@@ -1,5 +1,5 @@
1
1
  /* ============================================================
2
- * bootstrap-dropdown.js v1.3.0
2
+ * bootstrap-dropdown.js v1.4.0
3
3
  * http://twitter.github.com/bootstrap/javascript.html#dropdown
4
4
  * ============================================================
5
5
  * Copyright 2011 Twitter, Inc.
@@ -20,16 +20,7 @@
20
20
 
21
21
  !function( $ ){
22
22
 
23
- var d = 'a.menu, .dropdown-toggle'
24
-
25
- function clearMenus() {
26
- $(d).parent('li').removeClass('open')
27
- }
28
-
29
- $(function () {
30
- $('html').bind("click", clearMenus)
31
- $('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
32
- })
23
+ "use strict"
33
24
 
34
25
  /* DROPDOWN PLUGIN DEFINITION
35
26
  * ========================== */
@@ -47,4 +38,18 @@
47
38
  })
48
39
  }
49
40
 
50
- }( window.jQuery || window.ender )
41
+ /* APPLY TO STANDARD DROPDOWN ELEMENTS
42
+ * =================================== */
43
+
44
+ var d = 'a.menu, .dropdown-toggle'
45
+
46
+ function clearMenus() {
47
+ $(d).parent('li').removeClass('open')
48
+ }
49
+
50
+ $(function () {
51
+ $('html').bind("click", clearMenus)
52
+ $('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
53
+ })
54
+
55
+ }( window.jQuery || window.ender );