twitter-bootstrap-rails 2.2.8 → 4.0.0

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 (185) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +229 -322
  3. data/Rakefile +4 -6
  4. data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  5. data/app/assets/fonts/glyphicons-halflings-regular.svg +288 -0
  6. data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  7. data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  8. data/app/assets/fonts/glyphicons-halflings-regular.woff2 +0 -0
  9. data/app/assets/javascripts/twitter/bootstrap.js +12 -13
  10. data/app/assets/javascripts/twitter/bootstrap/affix.js +162 -0
  11. data/app/assets/javascripts/twitter/bootstrap/alert.js +94 -0
  12. data/app/assets/javascripts/twitter/bootstrap/button.js +120 -0
  13. data/app/assets/javascripts/twitter/bootstrap/carousel.js +237 -0
  14. data/app/assets/javascripts/twitter/bootstrap/collapse.js +211 -0
  15. data/app/assets/javascripts/twitter/bootstrap/dropdown.js +165 -0
  16. data/app/assets/javascripts/twitter/bootstrap/modal.js +337 -0
  17. data/app/assets/javascripts/twitter/bootstrap/popover.js +108 -0
  18. data/app/assets/javascripts/twitter/bootstrap/scrollspy.js +172 -0
  19. data/app/assets/javascripts/twitter/bootstrap/tab.js +155 -0
  20. data/app/assets/javascripts/twitter/bootstrap/tooltip.js +514 -0
  21. data/app/assets/javascripts/twitter/bootstrap/transition.js +59 -0
  22. data/app/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +1 -890
  23. data/app/assets/stylesheets/twitter-bootstrap-static/sprites.css.erb +1 -146
  24. data/app/helpers/bootstrap_flash_helper.rb +14 -7
  25. data/app/helpers/form_errors_helper.rb +22 -0
  26. data/app/helpers/glyph_helper.rb +12 -6
  27. data/app/helpers/modal_helper.rb +26 -22
  28. data/app/helpers/navbar_helper.rb +47 -32
  29. data/app/helpers/twitter_breadcrumbs_helper.rb +6 -2
  30. data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +8 -8
  31. data/lib/generators/bootstrap/install/install_generator.rb +3 -2
  32. data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.css +3 -4
  33. data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less +9 -18
  34. data/lib/generators/bootstrap/install/templates/en.bootstrap.yml +5 -0
  35. data/lib/generators/bootstrap/layout/layout_generator.rb +1 -4
  36. data/lib/generators/bootstrap/layout/templates/layout.html.erb +27 -48
  37. data/lib/generators/bootstrap/layout/templates/layout.html.haml +19 -34
  38. data/lib/generators/bootstrap/layout/templates/layout.html.slim +13 -30
  39. data/lib/generators/bootstrap/partial/templates/_login.html.erb +2 -3
  40. data/lib/generators/bootstrap/themed/templates/_form.html.erb +30 -10
  41. data/lib/generators/bootstrap/themed/templates/_form.html.haml +10 -8
  42. data/lib/generators/bootstrap/themed/templates/_form.html.slim +11 -9
  43. data/lib/generators/bootstrap/themed/templates/edit.html.slim +1 -1
  44. data/lib/generators/bootstrap/themed/templates/index.html.erb +4 -2
  45. data/lib/generators/bootstrap/themed/templates/index.html.haml +3 -2
  46. data/lib/generators/bootstrap/themed/templates/index.html.slim +6 -5
  47. data/lib/generators/bootstrap/themed/templates/new.html.slim +1 -1
  48. data/lib/generators/bootstrap/themed/templates/show.html.erb +5 -7
  49. data/lib/generators/bootstrap/themed/templates/show.html.haml +4 -4
  50. data/lib/generators/bootstrap/themed/templates/show.html.slim +6 -7
  51. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.erb +5 -5
  52. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.haml +3 -3
  53. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.slim +4 -4
  54. data/lib/generators/bootstrap/themed/themed_generator.rb +2 -2
  55. data/lib/twitter/bootstrap/rails/breadcrumbs.rb +69 -0
  56. data/lib/twitter/bootstrap/rails/engine.rb +17 -10
  57. data/lib/twitter/bootstrap/rails/version.rb +2 -2
  58. data/spec/lib/breadcrumbs_spec.rb +99 -0
  59. data/spec/lib/twitter_bootstrap_rails/badge_label_helper_spec.rb +12 -4
  60. data/spec/lib/twitter_bootstrap_rails/bootstrap_flash_helper_spec.rb +128 -0
  61. data/spec/lib/twitter_bootstrap_rails/form_errors_helper_spec.rb +148 -0
  62. data/spec/lib/twitter_bootstrap_rails/glyph_helper_spec.rb +24 -0
  63. data/spec/lib/twitter_bootstrap_rails/modal_helper_spec.rb +15 -15
  64. data/spec/lib/twitter_bootstrap_rails/navbar_helper_spec.rb +207 -173
  65. data/spec/lib/twitter_bootstrap_rails/uri_state_spec.rb +18 -16
  66. data/spec/spec_helper.rb +11 -1
  67. data/vendor/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +5796 -1
  68. data/vendor/static-source/bootstrap.less +0 -1
  69. data/vendor/static-source/sprites.less +1 -1
  70. data/vendor/toolkit/twitter/bootstrap/alerts.less +51 -57
  71. data/vendor/toolkit/twitter/bootstrap/badges.less +66 -0
  72. data/vendor/toolkit/twitter/bootstrap/bootstrap.less +29 -36
  73. data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +11 -9
  74. data/vendor/toolkit/twitter/bootstrap/button-groups.less +167 -152
  75. data/vendor/toolkit/twitter/bootstrap/buttons.less +107 -169
  76. data/vendor/toolkit/twitter/bootstrap/carousel.less +177 -65
  77. data/vendor/toolkit/twitter/bootstrap/close.less +21 -19
  78. data/vendor/toolkit/twitter/bootstrap/code.less +38 -30
  79. data/vendor/toolkit/twitter/bootstrap/component-animations.less +15 -4
  80. data/vendor/toolkit/twitter/bootstrap/dropdowns.less +120 -152
  81. data/vendor/toolkit/twitter/bootstrap/forms.less +470 -547
  82. data/vendor/toolkit/twitter/bootstrap/glyphicons.less +305 -0
  83. data/vendor/toolkit/twitter/bootstrap/grid.less +74 -11
  84. data/vendor/toolkit/twitter/bootstrap/input-groups.less +171 -0
  85. data/vendor/toolkit/twitter/bootstrap/jumbotron.less +54 -0
  86. data/vendor/toolkit/twitter/bootstrap/labels.less +64 -0
  87. data/vendor/toolkit/twitter/bootstrap/list-group.less +130 -0
  88. data/vendor/toolkit/twitter/bootstrap/media.less +40 -29
  89. data/vendor/toolkit/twitter/bootstrap/mixins.less +37 -699
  90. data/vendor/toolkit/twitter/bootstrap/mixins/alerts.less +14 -0
  91. data/vendor/toolkit/twitter/bootstrap/mixins/background-variant.less +9 -0
  92. data/vendor/toolkit/twitter/bootstrap/mixins/border-radius.less +18 -0
  93. data/vendor/toolkit/twitter/bootstrap/mixins/buttons.less +65 -0
  94. data/vendor/toolkit/twitter/bootstrap/mixins/center-block.less +7 -0
  95. data/vendor/toolkit/twitter/bootstrap/mixins/clearfix.less +22 -0
  96. data/vendor/toolkit/twitter/bootstrap/mixins/forms.less +85 -0
  97. data/vendor/toolkit/twitter/bootstrap/mixins/gradients.less +59 -0
  98. data/vendor/toolkit/twitter/bootstrap/mixins/grid-framework.less +91 -0
  99. data/vendor/toolkit/twitter/bootstrap/mixins/grid.less +122 -0
  100. data/vendor/toolkit/twitter/bootstrap/mixins/hide-text.less +21 -0
  101. data/vendor/toolkit/twitter/bootstrap/mixins/image.less +33 -0
  102. data/vendor/toolkit/twitter/bootstrap/mixins/labels.less +12 -0
  103. data/vendor/toolkit/twitter/bootstrap/mixins/list-group.less +30 -0
  104. data/vendor/toolkit/twitter/bootstrap/mixins/nav-divider.less +10 -0
  105. data/vendor/toolkit/twitter/bootstrap/mixins/nav-vertical-align.less +9 -0
  106. data/vendor/toolkit/twitter/bootstrap/mixins/opacity.less +8 -0
  107. data/vendor/toolkit/twitter/bootstrap/mixins/pagination.less +24 -0
  108. data/vendor/toolkit/twitter/bootstrap/mixins/panels.less +24 -0
  109. data/vendor/toolkit/twitter/bootstrap/mixins/progress-bar.less +10 -0
  110. data/vendor/toolkit/twitter/bootstrap/mixins/reset-filter.less +8 -0
  111. data/vendor/toolkit/twitter/bootstrap/mixins/reset-text.less +18 -0
  112. data/vendor/toolkit/twitter/bootstrap/mixins/resize.less +6 -0
  113. data/vendor/toolkit/twitter/bootstrap/mixins/responsive-visibility.less +15 -0
  114. data/vendor/toolkit/twitter/bootstrap/mixins/size.less +10 -0
  115. data/vendor/toolkit/twitter/bootstrap/mixins/tab-focus.less +9 -0
  116. data/vendor/toolkit/twitter/bootstrap/mixins/table-row.less +28 -0
  117. data/vendor/toolkit/twitter/bootstrap/mixins/text-emphasis.less +9 -0
  118. data/vendor/toolkit/twitter/bootstrap/mixins/text-overflow.less +8 -0
  119. data/vendor/toolkit/twitter/bootstrap/mixins/vendor-prefixes.less +227 -0
  120. data/vendor/toolkit/twitter/bootstrap/modals.less +109 -54
  121. data/vendor/toolkit/twitter/bootstrap/navbar.less +547 -384
  122. data/vendor/toolkit/twitter/bootstrap/navs.less +192 -359
  123. data/vendor/toolkit/twitter/bootstrap/normalize.less +424 -0
  124. data/vendor/toolkit/twitter/bootstrap/pager.less +45 -34
  125. data/vendor/toolkit/twitter/bootstrap/pagination.less +71 -105
  126. data/vendor/toolkit/twitter/bootstrap/panels.less +271 -0
  127. data/vendor/toolkit/twitter/bootstrap/popovers.less +66 -68
  128. data/vendor/toolkit/twitter/bootstrap/print.less +101 -0
  129. data/vendor/toolkit/twitter/bootstrap/progress-bars.less +40 -75
  130. data/vendor/toolkit/twitter/bootstrap/responsive-embed.less +35 -0
  131. data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +177 -42
  132. data/vendor/toolkit/twitter/bootstrap/scaffolding.less +131 -23
  133. data/vendor/toolkit/twitter/bootstrap/tables.less +172 -182
  134. data/vendor/toolkit/twitter/bootstrap/theme.less +291 -0
  135. data/vendor/toolkit/twitter/bootstrap/thumbnails.less +27 -44
  136. data/vendor/toolkit/twitter/bootstrap/tooltip.less +58 -27
  137. data/vendor/toolkit/twitter/bootstrap/type.less +209 -154
  138. data/vendor/toolkit/twitter/bootstrap/utilities.less +32 -7
  139. data/vendor/toolkit/twitter/bootstrap/variables.less +784 -216
  140. data/vendor/toolkit/twitter/bootstrap/wells.less +7 -7
  141. metadata +156 -141
  142. data/app/assets/fonts/fontawesome-webfont.eot +0 -0
  143. data/app/assets/fonts/fontawesome-webfont.svg +0 -399
  144. data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
  145. data/app/assets/fonts/fontawesome-webfont.woff +0 -0
  146. data/app/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
  147. data/app/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
  148. data/app/assets/javascripts/twitter/bootstrap/bootstrap-affix.js +0 -117
  149. data/app/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +0 -99
  150. data/app/assets/javascripts/twitter/bootstrap/bootstrap-button.js +0 -105
  151. data/app/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +0 -207
  152. data/app/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +0 -167
  153. data/app/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +0 -169
  154. data/app/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +0 -247
  155. data/app/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +0 -114
  156. data/app/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +0 -162
  157. data/app/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +0 -144
  158. data/app/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +0 -361
  159. data/app/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +0 -60
  160. data/app/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +0 -335
  161. data/app/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb +0 -787
  162. data/lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb +0 -42
  163. data/test/lib/breadcrumbs_test.rb +0 -75
  164. data/test/test_helper.rb +0 -11
  165. data/vendor/static-source/fontawesome.less +0 -9
  166. data/vendor/toolkit/fontawesome/bootstrap.less +0 -84
  167. data/vendor/toolkit/fontawesome/core.less +0 -129
  168. data/vendor/toolkit/fontawesome/extras.less +0 -93
  169. data/vendor/toolkit/fontawesome/font-awesome-ie7.less +0 -1953
  170. data/vendor/toolkit/fontawesome/font-awesome.less +0 -33
  171. data/vendor/toolkit/fontawesome/icons.less +0 -381
  172. data/vendor/toolkit/fontawesome/mixins.less +0 -48
  173. data/vendor/toolkit/fontawesome/path.less +0 -14
  174. data/vendor/toolkit/fontawesome/variables.less +0 -735
  175. data/vendor/toolkit/twitter/bootstrap/accordion.less +0 -34
  176. data/vendor/toolkit/twitter/bootstrap/hero-unit.less +0 -25
  177. data/vendor/toolkit/twitter/bootstrap/labels-badges.less +0 -84
  178. data/vendor/toolkit/twitter/bootstrap/layouts.less +0 -16
  179. data/vendor/toolkit/twitter/bootstrap/reset.less +0 -216
  180. data/vendor/toolkit/twitter/bootstrap/responsive-1200px-min.less +0 -28
  181. data/vendor/toolkit/twitter/bootstrap/responsive-767px-max.less +0 -193
  182. data/vendor/toolkit/twitter/bootstrap/responsive-768px-979px.less +0 -19
  183. data/vendor/toolkit/twitter/bootstrap/responsive-navbar.less +0 -189
  184. data/vendor/toolkit/twitter/bootstrap/responsive.less +0 -48
  185. data/vendor/toolkit/twitter/bootstrap/sprites.less +0 -197
@@ -1,10 +1,14 @@
1
1
  module TwitterBreadcrumbsHelper
2
- def render_breadcrumbs(divider = '/', &block)
3
- content = render :partial => 'twitter-bootstrap/breadcrumbs', :layout => false, :locals => { :divider => divider }
2
+ def render_bootstrap_breadcrumbs(divider = '/', options={}, &block)
3
+ default_options = { :class => '', :item_class => '', :divider_class => '', :active_class => 'active' }.merge(options)
4
+ content = render :partial => 'twitter-bootstrap/breadcrumbs', :layout => false, :locals => { :divider => divider, options: options }
4
5
  if block_given?
5
6
  capture(content, &block)
6
7
  else
7
8
  content
8
9
  end
9
10
  end
11
+
12
+ # Add backward compatible alias unless BC on rails present
13
+ alias_method :render_breadcrumbs, :render_bootstrap_breadcrumbs unless defined?(::BreadcrumbsOnRails)
10
14
  end
@@ -1,14 +1,14 @@
1
- <% if @breadcrumbs.present? %>
2
- <ul class="breadcrumb">
3
- <% separator = divider.html_safe %>
4
- <% @breadcrumbs[0..-2].each do |crumb| %>
5
- <li>
1
+ <% if @__bs_breadcrumbs.present? %>
2
+ <ul class="breadcrumb <%= options[:class] %>">
3
+ <% separator = divider.html_safe if divider %>
4
+ <% @__bs_breadcrumbs[0..-2].each do |crumb| %>
5
+ <li class="<%= options[:item_class] %>">
6
6
  <%= link_to crumb[:name], crumb[:url], crumb[:options] %>
7
- <span class="divider"><%= separator %></span>
7
+ <span class="divider <%= options[:divider_class] %>"><%= separator if separator %></span>
8
8
  </li>
9
9
  <% end %>
10
- <li class="active">
11
- <%= @breadcrumbs.last[:name] %>
10
+ <li class="<%= options[:active_class] %>">
11
+ <%= @__bs_breadcrumbs.last[:name] %>
12
12
  </li>
13
13
  </ul>
14
14
  <% end %>
@@ -5,8 +5,9 @@ module Bootstrap
5
5
  class InstallGenerator < ::Rails::Generators::Base
6
6
 
7
7
  source_root File.expand_path("../templates", __FILE__)
8
- desc "This generator installs Twitter Bootstrap to Asset Pipeline"
8
+ desc "This generator installs Bootstrap to Asset Pipeline"
9
9
  argument :stylesheets_type, :type => :string, :default => 'less', :banner => '*less or static'
10
+ class_option :'no-coffeescript', :type => :boolean, :default => false, :desc => 'Skips coffeescript replacement into app generators'
10
11
 
11
12
  def add_assets
12
13
 
@@ -60,7 +61,6 @@ module Bootstrap
60
61
  def cleanup_legacy
61
62
  # Remove old requires (if any) that included twitter/bootstrap directly:
62
63
  gsub_file("app/assets/stylesheets/application.css", %r|\s*\*=\s*twitter/bootstrap\s*\n|, "")
63
- gsub_file("app/assets/stylesheets/application.css", %r|\s*\*=\s*twitter/bootstrap_responsive\s*\n|, "")
64
64
  if File.exist?('app/assets/stylesheets/bootstrap_override.css.less')
65
65
  puts <<-EOM
66
66
  Warning:
@@ -76,6 +76,7 @@ module Bootstrap
76
76
  end
77
77
 
78
78
  def use_coffeescript?
79
+ return false if options[:'no-coffeescript']
79
80
  ::Rails.configuration.app_generators.rails[:javascript_engine] == :coffee
80
81
  end
81
82
  end
@@ -1,7 +1,6 @@
1
1
  /*
2
2
  =require twitter-bootstrap-static/bootstrap
3
3
 
4
- Use Font Awesome icons (default)
5
- To use Glyphicons sprites instead of Font Awesome, replace with "require twitter-bootstrap-static/sprites"
6
- =require twitter-bootstrap-static/fontawesome
7
- */
4
+ Static version of css will use Glyphicons sprites by default
5
+ =require twitter-bootstrap-static/sprites
6
+ */
@@ -1,22 +1,13 @@
1
1
  @import "twitter/bootstrap/bootstrap";
2
- @import "twitter/bootstrap/responsive";
3
2
 
4
- // Set the correct sprite paths
5
- @iconSpritePath: image-url("twitter/bootstrap/glyphicons-halflings.png");
6
- @iconWhiteSpritePath: image-url("twitter/bootstrap/glyphicons-halflings-white.png");
7
-
8
- // Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
9
- @fontAwesomeEotPath: asset-url("fontawesome-webfont.eot");
10
- @fontAwesomeEotPath_iefix: asset-url("fontawesome-webfont.eot?#iefix");
11
- @fontAwesomeWoffPath: asset-url("fontawesome-webfont.woff");
12
- @fontAwesomeTtfPath: asset-url("fontawesome-webfont.ttf");
13
- @fontAwesomeSvgPath: asset-url("fontawesome-webfont.svg#fontawesomeregular");
14
-
15
- // Font Awesome
16
- @import "fontawesome/font-awesome";
17
-
18
- // Glyphicons
19
- //@import "twitter/bootstrap/sprites.less";
3
+ // Glyphicons are not required by default, uncomment the following lines to enable them.
4
+ //@glyphiconsEotPath: font-url("glyphicons-halflings-regular.eot");
5
+ //@glyphiconsEotPath_iefix: font-url("glyphicons-halflings-regular.eot?#iefix");
6
+ //@glyphiconsWoffPath: font-url("glyphicons-halflings-regular.woff");
7
+ //@glyphiconsTtfPath: font-url("glyphicons-halflings-regular.ttf");
8
+ //@glyphiconsSvgPath: font-url("glyphicons-halflings-regular.svg#glyphicons_halflingsregular");
9
+ //
10
+ //@import "twitter/bootstrap/glyphicons.less";
20
11
 
21
12
  // Your custom LESS stylesheets goes here
22
13
  //
@@ -27,4 +18,4 @@
27
18
  // See http://twitter.github.com/bootstrap/customize.html#variables for their names and documentation
28
19
  //
29
20
  // Example:
30
- // @linkColor: #ff0000;
21
+ // @link-color: #ff0000;
@@ -2,6 +2,11 @@
2
2
  # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
3
 
4
4
  en:
5
+ breadcrumbs:
6
+ application:
7
+ root: "Index"
8
+ pages:
9
+ pages: "Pages"
5
10
  helpers:
6
11
  actions: "Actions"
7
12
  links:
@@ -6,15 +6,12 @@ module Bootstrap
6
6
  source_root File.expand_path("../templates", __FILE__)
7
7
  desc "This generator generates layout file with navigation."
8
8
  argument :layout_name, :type => :string, :default => "application"
9
- argument :layout_type, :type => :string, :default => "fixed",
10
- :banner => "*fixed or fluid"
11
9
 
12
- attr_reader :app_name, :container_class
10
+ attr_reader :app_name
13
11
 
14
12
  def generate_layout
15
13
  app = ::Rails.application
16
14
  @app_name = app.class.to_s.split("::").first
17
- @container_class = layout_type == "fluid" ? "container-fluid" : "container"
18
15
  ext = app.config.generators.options[:rails][:template_engine] || :erb
19
16
  template "layout.html.#{ext}", "app/views/layouts/#{layout_name}.html.#{ext}"
20
17
  end
@@ -7,11 +7,6 @@
7
7
  <title><%%= content_for?(:title) ? yield(:title) : "<%= app_name %>" %></title>
8
8
  <%%= csrf_meta_tags %>
9
9
 
10
- <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
11
- <!--[if lt IE 9]>
12
- <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js" type="text/javascript"></script>
13
- <![endif]-->
14
-
15
10
  <%%= stylesheet_link_tag "application", :media => "all" %>
16
11
 
17
12
  <!-- For third-generation iPad with high-resolution Retina display: -->
@@ -35,34 +30,41 @@
35
30
  <%%= favicon_link_tag 'favicon.ico', :rel => 'shortcut icon' %>
36
31
 
37
32
  <%%= javascript_include_tag "application" %>
33
+
34
+ <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
35
+ <!--[if lt IE 9]>
36
+ <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js" type="text/javascript"></script>
37
+ <![endif]-->
38
38
  </head>
39
39
  <body>
40
40
 
41
- <div class="navbar navbar-<%= layout_type %>-top">
42
- <div class="navbar-inner">
43
- <div class="<%= container_class %>">
44
- <a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
45
- <span class="icon-bar"></span>
46
- <span class="icon-bar"></span>
47
- <span class="icon-bar"></span>
48
- </a>
49
- <a class="brand" href="#"><%= app_name %></a>
50
- <div class="<%= container_class %> nav-collapse">
51
- <ul class="nav">
52
- <li><%%= link_to "Link1", "/path1" %></li>
53
- <li><%%= link_to "Link2", "/path2" %></li>
54
- <li><%%= link_to "Link3", "/path3" %></li>
55
- </ul>
56
- </div><!--/.nav-collapse -->
41
+ <div class="navbar navbar-default navbar-static-top">
42
+ <div class="container">
43
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
44
+ <span class="icon-bar"></span>
45
+ <span class="icon-bar"></span>
46
+ <span class="icon-bar"></span>
47
+ </button>
48
+ <a class="navbar-brand" href="#"><%= app_name %></a>
49
+ <div class="navbar-collapse collapse navbar-responsive-collapse">
50
+ <ul class="nav navbar-nav">
51
+ <li><%%= link_to "Link1", "/path1" %></li>
52
+ <li><%%= link_to "Link2", "/path2" %></li>
53
+ <li><%%= link_to "Link3", "/path3" %></li>
54
+ </ul>
57
55
  </div>
58
56
  </div>
59
57
  </div>
60
58
 
61
- <div class="<%= container_class %>">
62
- <%- if layout_type == "fluid" -%>
63
- <div class="row-fluid">
64
- <div class="span3">
59
+ <div class="container">
60
+ <div class="row">
61
+ <div class="col-lg-9">
62
+ <%%= bootstrap_flash %>
63
+ <%%= yield %>
64
+ </div>
65
+ <div class="col-lg-3">
65
66
  <div class="well sidebar-nav">
67
+ <h3>Sidebar</h3>
66
68
  <ul class="nav nav-list">
67
69
  <li class="nav-header">Sidebar</li>
68
70
  <li><%%= link_to "Link1", "/path1" %></li>
@@ -71,30 +73,7 @@
71
73
  </ul>
72
74
  </div><!--/.well -->
73
75
  </div><!--/span-->
74
- <div class="span9">
75
- <%%= bootstrap_flash %>
76
- <%%= yield %>
77
- </div>
78
76
  </div><!--/row-->
79
- <%- else -%>
80
- <div class="row">
81
- <div class="span9">
82
- <%%= bootstrap_flash %>
83
- <%%= yield %>
84
- </div>
85
- <div class="span3">
86
- <div class="well sidebar-nav">
87
- <h3>Sidebar</h3>
88
- <ul class="nav nav-list">
89
- <li class="nav-header">Sidebar</li>
90
- <li><%%= link_to "Link1", "/path1" %></li>
91
- <li><%%= link_to "Link2", "/path2" %></li>
92
- <li><%%= link_to "Link3", "/path3" %></li>
93
- </ul>
94
- </div><!--/.well -->
95
- </div><!--/span-->
96
- </div><!--/row-->
97
- <%- end -%>
98
77
 
99
78
  <footer>
100
79
  <p>&copy; Company <%= Date.today.year %></p>
@@ -6,9 +6,6 @@
6
6
  %meta(name="viewport" content="width=device-width, initial-scale=1.0")
7
7
  %title= content_for?(:title) ? yield(:title) : "<%= app_name %>"
8
8
  = csrf_meta_tags
9
- / Le HTML5 shim, for IE6-8 support of HTML elements
10
- /[if lt IE 9]
11
- = javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js"
12
9
  = stylesheet_link_tag "application", :media => "all"
13
10
  = favicon_link_tag 'apple-touch-icon-144x144-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '144x144'
14
11
  = favicon_link_tag 'apple-touch-icon-114x114-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '114x114'
@@ -16,43 +13,32 @@
16
13
  = favicon_link_tag 'apple-touch-icon-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png'
17
14
  = favicon_link_tag 'favicon.ico', :rel => 'shortcut icon'
18
15
  = javascript_include_tag "application"
16
+ / Le HTML5 shim, for IE6-8 support of HTML elements
17
+ /[if lt IE 9]
18
+ = javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"
19
19
 
20
20
 
21
21
  %body
22
- .navbar.navbar-<%= layout_type %>-top
23
- .navbar-inner
24
- .<%= container_class %>
25
- %a.btn.btn-navbar(data-target=".nav-collapse" data-toggle="collapse")
26
- %span.icon-bar
27
- %span.icon-bar
28
- %span.icon-bar
29
- %a.brand(href="#") <%= app_name %>
30
- .container.nav-collapse
31
- %ul.nav
32
- %li= link_to "Link 1", "/path1"
33
- %li= link_to "Link 2", "/path2"
34
- %li= link_to "Link 3", "/path3"
35
-
36
- .<%= container_class %>
37
- <%- if layout_type == "fluid" -%>
22
+ .navbar.navbar-default.navbar-static-top
23
+ .container
24
+ %button.navbar-toggle(type="button" data-toggle="collapse" data-target=".navbar-responsive-collapse")
25
+ %span.icon-bar
26
+ %span.icon-bar
27
+ %span.icon-bar
28
+ %a.navbar-brand(href="#") <%= app_name %>
29
+ .navbar-collapse.collapse.navbar-responsive-collapse
30
+ %ul.nav.navbar-nav
31
+ %li= link_to "Link 1", "/path1"
32
+ %li= link_to "Link 2", "/path2"
33
+ %li= link_to "Link 3", "/path3"
34
+ %li= link_to "Link 3", "/path3"
38
35
 
39
- .row-fluid
40
- .span3
41
- .well.sidebar-nav
42
- %ul.nav.nav-list
43
- %li.nav-header Sidebar
44
- %li= link_to "Link 1", "/path1"
45
- %li= link_to "Link 2", "/path2"
46
- %li= link_to "Link 3", "/path3"
47
- .span9
48
- = bootstrap_flash
49
- = yield
50
- <% else %>
36
+ .container
51
37
  .row
52
- .span9
38
+ .col-lg-9
53
39
  = bootstrap_flash
54
40
  = yield
55
- .span3
41
+ .col-lg-3
56
42
  .well.sidebar-nav
57
43
  %h3 Sidebar
58
44
  %ul.nav.nav-list
@@ -60,6 +46,5 @@
60
46
  %li= link_to "Link 1", "/path1"
61
47
  %li= link_to "Link 2", "/path2"
62
48
  %li= link_to "Link 3", "/path3"
63
- <% end %>
64
49
  %footer
65
50
  %p &copy; Company <%= Date.today.year %>
@@ -6,10 +6,6 @@ html lang="en"
6
6
  meta name="viewport" content="width=device-width, initial-scale=1.0"
7
7
  title= content_for?(:title) ? yield(:title) : "<%= app_name %>"
8
8
  = csrf_meta_tags
9
-
10
- /! Le HTML5 shim, for IE6-8 support of HTML elements
11
- /[if lt IE 9]
12
- = javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js"
13
9
  = stylesheet_link_tag "application", :media => "all"
14
10
  = favicon_link_tag 'apple-touch-icon-144x144-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '144x144'
15
11
  = favicon_link_tag 'apple-touch-icon-114x114-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '114x114'
@@ -17,44 +13,31 @@ html lang="en"
17
13
  = favicon_link_tag 'apple-touch-icon-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png'
18
14
  = favicon_link_tag 'favicon.ico', :rel => 'shortcut icon'
19
15
  = javascript_include_tag "application"
20
-
16
+ /! Le HTML5 shim, for IE6-8 support of HTML elements
17
+ /[if lt IE 9]
18
+ = javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"
21
19
 
22
20
 
23
21
  body
24
- .navbar.navbar-<%= layout_type %>-top
25
- .navbar-inner
26
- .<%= container_class %>
27
- a.btn.btn-navbar data-target=".nav-collapse" data-toggle="collapse"
22
+ .navbar.navbar-default.navbar-static-top
23
+ .container
24
+ button.navbar-toggle type="button" data-toggle="collapse" data-target=".navbar-responsive-collapse"
28
25
  span.icon-bar
29
26
  span.icon-bar
30
27
  span.icon-bar
31
- a.brand href="#"<%= app_name %>
32
- .<%=container_class%>.nav-collapse
33
- ul.nav
28
+ a.navbar-brand href="#"<%= app_name %>
29
+ .navbar-collapse.collapse.navbar-responsive-collapse
30
+ ul.nav.navbar-nav
34
31
  li= link_to "Link 1", "/path1"
35
32
  li= link_to "Link 2", "/path2"
36
33
  li= link_to "Link 3", "/path3"
37
34
 
38
- .<%= container_class %>
39
- <%- if layout_type == "fluid" -%>
40
-
41
- .row-fluid
42
- .span3
43
- .well.sidebar-nav
44
- ul.nav.nav-list
45
- li.nav-header Sidebar
46
- li= link_to "Link 1", "/path1"
47
- li= link_to "Link 2", "/path2"
48
- li= link_to "Link 3", "/path3"
49
- .span9
50
- = bootstrap_flash
51
- = yield
52
- <% else %>
35
+ .container
53
36
  .row
54
- .span9
37
+ .col-lg-9
55
38
  = bootstrap_flash
56
39
  = yield
57
- .span3
40
+ .col-lg-3
58
41
  .well.sidebar-nav
59
42
  h3 Sidebar
60
43
  ul.nav.nav-list
@@ -62,6 +45,6 @@ html lang="en"
62
45
  li= link_to "Link 1", "/path1"
63
46
  li= link_to "Link 2", "/path2"
64
47
  li= link_to "Link 3", "/path3"
65
- <% end %>
48
+
66
49
  footer
67
50
  p &copy; Company <%= Date.today.year %>
@@ -21,9 +21,8 @@
21
21
  </div>
22
22
  <% end -%>
23
23
 
24
- <div class="form-actions">
25
- <%= f.submit "Sign in", :class => 'btn' %>
26
- </div>
24
+ <%= f.submit "Sign in", :class => 'btn btn-default' %>
25
+
27
26
  <% end %>
28
27
 
29
28
  <%= render :partial => "devise/shared/links" %>
@@ -1,16 +1,36 @@
1
- <%%= form_for @<%= resource_name %>, :html => { :class => 'form-horizontal' } do |f| %>
2
- <%- columns.each do |column| -%>
3
- <div class="control-group">
4
- <%%= f.label :<%= column.name %>, :class => 'control-label' %>
5
- <div class="controls">
6
- <%%= f.<%= column.field_type %> :<%= column.name %>, :class => '<%= column.field_type %>' %>
1
+ <%%= form_for @<%= resource_name %>, :html => { :class => "form-horizontal <%= resource_name %>" } do |f| %>
2
+
3
+ <%% if @<%= resource_name %>.errors.any? %>
4
+ <div id="error_expl" class="panel panel-danger">
5
+ <div class="panel-heading">
6
+ <h3 class="panel-title"><%%= pluralize(@<%= resource_name %>.errors.count, "error") %> prohibited this <%= resource_name %> from being saved:</h3>
7
+ </div>
8
+ <div class="panel-body">
9
+ <ul>
10
+ <%% @<%= resource_name %>.errors.full_messages.each do |msg| %>
11
+ <li><%%= msg %></li>
12
+ <%% end %>
13
+ </ul>
14
+ </div>
15
+ </div>
16
+ <%% end %>
17
+
18
+ <%- columns.each do |column| -%>
19
+ <div class="form-group">
20
+ <%%= f.label :<%= column.name %>, :class => 'control-label col-lg-2' %>
21
+ <div class="col-lg-10">
22
+ <%%= f.<%= column.field_type %> :<%= column.name %>, :class => 'form-control' %>
7
23
  </div>
24
+ <%%=f.error_span(:<%= column.name %>) %>
8
25
  </div>
9
26
  <%- end -%>
10
27
 
11
- <div class="form-actions">
12
- <%%= f.submit nil, :class => 'btn btn-primary' %>
13
- <%%= link_to t('.cancel', :default => t("helpers.links.cancel")),
14
- <%= controller_routing_path %>_path, :class => 'btn' %>
28
+ <div class="form-group">
29
+ <div class="col-lg-offset-2 col-lg-10">
30
+ <%%= f.submit nil, :class => 'btn btn-primary' %>
31
+ <%%= link_to t('.cancel', :default => t("helpers.links.cancel")),
32
+ <%= controller_routing_path %>_path, :class => 'btn btn-default' %>
33
+ </div>
15
34
  </div>
35
+
16
36
  <%% end %>