twitter-bootstrap3-rails 3.2.7

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 (132) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +708 -0
  3. data/Rakefile +46 -0
  4. data/app/assets/fonts/fontawesome-webfont.eot +0 -0
  5. data/app/assets/fonts/fontawesome-webfont.svg +399 -0
  6. data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
  7. data/app/assets/fonts/fontawesome-webfont.woff +0 -0
  8. data/app/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
  9. data/app/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
  10. data/app/assets/javascripts/twitter/bootstrap.js +12 -0
  11. data/app/assets/javascripts/twitter/bootstrap/affix.js +126 -0
  12. data/app/assets/javascripts/twitter/bootstrap/alert.js +98 -0
  13. data/app/assets/javascripts/twitter/bootstrap/button.js +109 -0
  14. data/app/assets/javascripts/twitter/bootstrap/carousel.js +217 -0
  15. data/app/assets/javascripts/twitter/bootstrap/collapse.js +179 -0
  16. data/app/assets/javascripts/twitter/bootstrap/dropdown.js +154 -0
  17. data/app/assets/javascripts/twitter/bootstrap/modal.js +244 -0
  18. data/app/assets/javascripts/twitter/bootstrap/popover.js +117 -0
  19. data/app/assets/javascripts/twitter/bootstrap/scrollspy.js +158 -0
  20. data/app/assets/javascripts/twitter/bootstrap/tab.js +135 -0
  21. data/app/assets/javascripts/twitter/bootstrap/tooltip.js +382 -0
  22. data/app/assets/javascripts/twitter/bootstrap/transition.js +56 -0
  23. data/app/assets/javascripts/twitter/bootstrap_ujs.js +11 -0
  24. data/app/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +5579 -0
  25. data/app/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb +787 -0
  26. data/app/assets/stylesheets/twitter-bootstrap-static/sprites.css.erb +146 -0
  27. data/app/helpers/badge_label_helper.rb +16 -0
  28. data/app/helpers/bootstrap_flash_helper.rb +29 -0
  29. data/app/helpers/flash_block_helper.rb +17 -0
  30. data/app/helpers/glyph_helper.rb +17 -0
  31. data/app/helpers/modal_helper.rb +59 -0
  32. data/app/helpers/navbar_helper.rb +195 -0
  33. data/app/helpers/twitter_breadcrumbs_helper.rb +10 -0
  34. data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +12 -0
  35. data/lib/generators/bootstrap/install/install_generator.rb +82 -0
  36. data/lib/generators/bootstrap/install/templates/application.css +7 -0
  37. data/lib/generators/bootstrap/install/templates/application.js +10 -0
  38. data/lib/generators/bootstrap/install/templates/bootstrap.coffee +3 -0
  39. data/lib/generators/bootstrap/install/templates/bootstrap.js +4 -0
  40. data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.css +7 -0
  41. data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less +29 -0
  42. data/lib/generators/bootstrap/install/templates/en.bootstrap.yml +18 -0
  43. data/lib/generators/bootstrap/layout/layout_generator.rb +20 -0
  44. data/lib/generators/bootstrap/layout/templates/layout.html.erb +85 -0
  45. data/lib/generators/bootstrap/layout/templates/layout.html.haml +50 -0
  46. data/lib/generators/bootstrap/layout/templates/layout.html.slim +52 -0
  47. data/lib/generators/bootstrap/partial/partial_generator.rb +20 -0
  48. data/lib/generators/bootstrap/partial/templates/_login.html.erb +28 -0
  49. data/lib/generators/bootstrap/themed/templates/_form.html.erb +16 -0
  50. data/lib/generators/bootstrap/themed/templates/_form.html.haml +9 -0
  51. data/lib/generators/bootstrap/themed/templates/_form.html.slim +10 -0
  52. data/lib/generators/bootstrap/themed/templates/edit.html.erb +5 -0
  53. data/lib/generators/bootstrap/themed/templates/edit.html.haml +4 -0
  54. data/lib/generators/bootstrap/themed/templates/edit.html.slim +4 -0
  55. data/lib/generators/bootstrap/themed/templates/index.html.erb +40 -0
  56. data/lib/generators/bootstrap/themed/templates/index.html.haml +25 -0
  57. data/lib/generators/bootstrap/themed/templates/index.html.slim +27 -0
  58. data/lib/generators/bootstrap/themed/templates/new.html.erb +5 -0
  59. data/lib/generators/bootstrap/themed/templates/new.html.haml +4 -0
  60. data/lib/generators/bootstrap/themed/templates/new.html.slim +4 -0
  61. data/lib/generators/bootstrap/themed/templates/show.html.erb +21 -0
  62. data/lib/generators/bootstrap/themed/templates/show.html.haml +15 -0
  63. data/lib/generators/bootstrap/themed/templates/show.html.slim +16 -0
  64. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.erb +13 -0
  65. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.haml +10 -0
  66. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.slim +11 -0
  67. data/lib/generators/bootstrap/themed/themed_generator.rb +148 -0
  68. data/lib/twitter-bootstrap-rails.rb +10 -0
  69. data/lib/twitter/bootstrap/rails/bootstrap.rb +2 -0
  70. data/lib/twitter/bootstrap/rails/engine.rb +33 -0
  71. data/lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb +42 -0
  72. data/lib/twitter/bootstrap/rails/version.rb +7 -0
  73. data/spec/lib/twitter_bootstrap_rails/badge_label_helper_spec.rb +22 -0
  74. data/spec/lib/twitter_bootstrap_rails/modal_helper_spec.rb +62 -0
  75. data/spec/lib/twitter_bootstrap_rails/navbar_helper_spec.rb +331 -0
  76. data/spec/lib/twitter_bootstrap_rails/uri_state_spec.rb +47 -0
  77. data/spec/spec_helper.rb +11 -0
  78. data/test/lib/breadcrumbs_test.rb +75 -0
  79. data/test/test_helper.rb +11 -0
  80. data/vendor/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +5579 -0
  81. data/vendor/static-source/bootstrap.less +1 -0
  82. data/vendor/static-source/fontawesome.less +9 -0
  83. data/vendor/static-source/sprites.less +6 -0
  84. data/vendor/toolkit/fontawesome/bootstrap.less +84 -0
  85. data/vendor/toolkit/fontawesome/core.less +129 -0
  86. data/vendor/toolkit/fontawesome/extras.less +93 -0
  87. data/vendor/toolkit/fontawesome/font-awesome-ie7.less +1953 -0
  88. data/vendor/toolkit/fontawesome/font-awesome.less +33 -0
  89. data/vendor/toolkit/fontawesome/icons.less +381 -0
  90. data/vendor/toolkit/fontawesome/mixins.less +48 -0
  91. data/vendor/toolkit/fontawesome/path.less +14 -0
  92. data/vendor/toolkit/fontawesome/variables.less +735 -0
  93. data/vendor/toolkit/twitter/bootstrap/alerts.less +71 -0
  94. data/vendor/toolkit/twitter/bootstrap/badges.less +51 -0
  95. data/vendor/toolkit/twitter/bootstrap/bootstrap.less +63 -0
  96. data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +23 -0
  97. data/vendor/toolkit/twitter/bootstrap/button-groups.less +244 -0
  98. data/vendor/toolkit/twitter/bootstrap/buttons.less +159 -0
  99. data/vendor/toolkit/twitter/bootstrap/carousel.less +204 -0
  100. data/vendor/toolkit/twitter/bootstrap/close.less +33 -0
  101. data/vendor/toolkit/twitter/bootstrap/code.less +56 -0
  102. data/vendor/toolkit/twitter/bootstrap/component-animations.less +29 -0
  103. data/vendor/toolkit/twitter/bootstrap/dropdowns.less +176 -0
  104. data/vendor/toolkit/twitter/bootstrap/forms.less +332 -0
  105. data/vendor/toolkit/twitter/bootstrap/grid.less +340 -0
  106. data/vendor/toolkit/twitter/bootstrap/input-groups.less +127 -0
  107. data/vendor/toolkit/twitter/bootstrap/jumbotron.less +29 -0
  108. data/vendor/toolkit/twitter/bootstrap/labels.less +54 -0
  109. data/vendor/toolkit/twitter/bootstrap/list-group.less +88 -0
  110. data/vendor/toolkit/twitter/bootstrap/media.less +56 -0
  111. data/vendor/toolkit/twitter/bootstrap/mixins.less +693 -0
  112. data/vendor/toolkit/twitter/bootstrap/modals.less +133 -0
  113. data/vendor/toolkit/twitter/bootstrap/navbar.less +559 -0
  114. data/vendor/toolkit/twitter/bootstrap/navs.less +228 -0
  115. data/vendor/toolkit/twitter/bootstrap/normalize.less +396 -0
  116. data/vendor/toolkit/twitter/bootstrap/pager.less +55 -0
  117. data/vendor/toolkit/twitter/bootstrap/pagination.less +72 -0
  118. data/vendor/toolkit/twitter/bootstrap/panels.less +128 -0
  119. data/vendor/toolkit/twitter/bootstrap/popovers.less +133 -0
  120. data/vendor/toolkit/twitter/bootstrap/print.less +100 -0
  121. data/vendor/toolkit/twitter/bootstrap/progress-bars.less +99 -0
  122. data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +149 -0
  123. data/vendor/toolkit/twitter/bootstrap/scaffolding.less +111 -0
  124. data/vendor/toolkit/twitter/bootstrap/tables.less +211 -0
  125. data/vendor/toolkit/twitter/bootstrap/thumbnails.less +42 -0
  126. data/vendor/toolkit/twitter/bootstrap/tooltip.less +95 -0
  127. data/vendor/toolkit/twitter/bootstrap/type.less +238 -0
  128. data/vendor/toolkit/twitter/bootstrap/utilities.less +42 -0
  129. data/vendor/toolkit/twitter/bootstrap/variables.less +607 -0
  130. data/vendor/toolkit/twitter/bootstrap/wells.less +29 -0
  131. data/vendor/toolkit/twitter/bootstrap_base.less +2 -0
  132. metadata +297 -0
@@ -0,0 +1,10 @@
1
+ module TwitterBreadcrumbsHelper
2
+ def render_breadcrumbs(&block)
3
+ content = render :partial => 'twitter-bootstrap/breadcrumbs', :layout => false
4
+ if block_given?
5
+ capture(content, &block)
6
+ else
7
+ content
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,12 @@
1
+ <% if @breadcrumbs.present? %>
2
+ <ul class="breadcrumb">
3
+ <% @breadcrumbs[0..-2].each do |crumb| %>
4
+ <li>
5
+ <%= link_to crumb[:name], crumb[:url], crumb[:options] %>
6
+ </li>
7
+ <% end %>
8
+ <li class="active">
9
+ <%= @breadcrumbs.last[:name] %>
10
+ </li>
11
+ </ul>
12
+ <% end %>
@@ -0,0 +1,82 @@
1
+ require 'rails/generators'
2
+
3
+ module Bootstrap
4
+ module Generators
5
+ class InstallGenerator < ::Rails::Generators::Base
6
+
7
+ source_root File.expand_path("../templates", __FILE__)
8
+ desc "This generator installs Twitter Bootstrap to Asset Pipeline"
9
+ argument :stylesheets_type, :type => :string, :default => 'less', :banner => '*less or static'
10
+
11
+ def add_assets
12
+
13
+ js_manifest = 'app/assets/javascripts/application.js'
14
+
15
+ if File.exist?(js_manifest)
16
+ insert_into_file js_manifest, "//= require twitter/bootstrap\n", :after => "jquery_ujs\n"
17
+ else
18
+ copy_file "application.js", js_manifest
19
+ end
20
+
21
+ css_manifest = 'app/assets/stylesheets/application.css'
22
+
23
+ if File.exist?(css_manifest)
24
+ # Add our own require:
25
+ content = File.read(css_manifest)
26
+ if content.match(/require_tree\s+\.\s*$/)
27
+ # Good enough - that'll include our bootstrap_and_overrides.css.less
28
+ else
29
+ style_require_block = " *= require bootstrap_and_overrides\n"
30
+ insert_into_file css_manifest, style_require_block, :after => "require_self\n"
31
+ end
32
+ else
33
+ copy_file "application.css", "app/assets/stylesheets/application.css"
34
+ end
35
+
36
+ end
37
+
38
+ def add_bootstrap
39
+ if use_coffeescript?
40
+ copy_file "bootstrap.coffee", "app/assets/javascripts/bootstrap.js.coffee"
41
+ else
42
+ copy_file "bootstrap.js", "app/assets/javascripts/bootstrap.js"
43
+ end
44
+ if use_less?
45
+ copy_file "bootstrap_and_overrides.less", "app/assets/stylesheets/bootstrap_and_overrides.css.less"
46
+ else
47
+ copy_file "bootstrap_and_overrides.css", "app/assets/stylesheets/bootstrap_and_overrides.css"
48
+ end
49
+ end
50
+
51
+ def add_locale
52
+ if File.exist?("config/locales/en.bootstrap.yml")
53
+ localez = File.read("config/locales/en.bootstrap.yml")
54
+ insert_into_file "config/locales/en.bootstrap.yml", localez, :after => "en\n"
55
+ else
56
+ copy_file "en.bootstrap.yml", "config/locales/en.bootstrap.yml"
57
+ end
58
+ end
59
+
60
+ def cleanup_legacy
61
+ # Remove old requires (if any) that included twitter/bootstrap directly:
62
+ gsub_file("app/assets/stylesheets/application.css", %r|\s*\*=\s*twitter/bootstrap\s*\n|, "")
63
+ if File.exist?('app/assets/stylesheets/bootstrap_override.css.less')
64
+ puts <<-EOM
65
+ Warning:
66
+ app/assets/stylesheets/bootstrap_override.css.less exists
67
+ It should be removed, as it has been superceded by app/assets/stylesheets/bootstrap_and_overrides.css.less
68
+ EOM
69
+ end
70
+ end
71
+
72
+ private
73
+ def use_less?
74
+ (defined?(Less) && (stylesheets_type!='static') ) || (stylesheets_type=='less')
75
+ end
76
+
77
+ def use_coffeescript?
78
+ ::Rails.configuration.app_generators.rails[:javascript_engine] == :coffee
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,7 @@
1
+ /*
2
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
3
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
5
+ *= require_self
6
+ *= require_tree .
7
+ */
@@ -0,0 +1,10 @@
1
+ // This is a manifest file that'll be compiled into including all the files listed below.
2
+ // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
+ // be included in the compiled file accessible from http://example.com/assets/application.js
4
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ // the compiled file.
6
+ //
7
+ //= require jquery
8
+ //= require jquery_ujs
9
+ //= require twitter/bootstrap
10
+ //= require_tree .
@@ -0,0 +1,3 @@
1
+ jQuery ->
2
+ $("a[rel~=popover], .has-popover").popover()
3
+ $("a[rel~=tooltip], .has-tooltip").tooltip()
@@ -0,0 +1,4 @@
1
+ jQuery(function() {
2
+ $("a[rel~=popover], .has-popover").popover();
3
+ $("a[rel~=tooltip], .has-tooltip").tooltip();
4
+ });
@@ -0,0 +1,7 @@
1
+ /*
2
+ =require twitter-bootstrap-static/bootstrap
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
+ */
@@ -0,0 +1,29 @@
1
+ @import "twitter/bootstrap/bootstrap";
2
+
3
+ // Set the correct sprite paths
4
+ @iconSpritePath: image-url("twitter/bootstrap/glyphicons-halflings.png");
5
+ @iconWhiteSpritePath: image-url("twitter/bootstrap/glyphicons-halflings-white.png");
6
+
7
+ // Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
8
+ @fontAwesomeEotPath: asset-url("fontawesome-webfont.eot");
9
+ @fontAwesomeEotPath_iefix: asset-url("fontawesome-webfont.eot?#iefix");
10
+ @fontAwesomeWoffPath: asset-url("fontawesome-webfont.woff");
11
+ @fontAwesomeTtfPath: asset-url("fontawesome-webfont.ttf");
12
+ @fontAwesomeSvgPath: asset-url("fontawesome-webfont.svg#fontawesomeregular");
13
+
14
+ // Font Awesome
15
+ @import "fontawesome/font-awesome";
16
+
17
+ // Glyphicons
18
+ //@import "twitter/bootstrap/sprites.less";
19
+
20
+ // Your custom LESS stylesheets goes here
21
+ //
22
+ // Since bootstrap was imported above you have access to its mixins which
23
+ // you may use and inherit here
24
+ //
25
+ // If you'd like to override bootstrap's own variables, you can do so here as well
26
+ // See http://twitter.github.com/bootstrap/customize.html#variables for their names and documentation
27
+ //
28
+ // Example:
29
+ // @linkColor: #ff0000;
@@ -0,0 +1,18 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ helpers:
6
+ actions: "Actions"
7
+ links:
8
+ back: "Back"
9
+ cancel: "Cancel"
10
+ confirm: "Are you sure?"
11
+ destroy: "Delete"
12
+ new: "New"
13
+ edit: "Edit"
14
+ titles:
15
+ edit: "Edit %{model}"
16
+ save: "Save %{model}"
17
+ new: "New %{model}"
18
+ delete: "Delete %{model}"
@@ -0,0 +1,20 @@
1
+ require 'rails/generators'
2
+
3
+ module Bootstrap
4
+ module Generators
5
+ class LayoutGenerator < ::Rails::Generators::Base
6
+ source_root File.expand_path("../templates", __FILE__)
7
+ desc "This generator generates layout file with navigation."
8
+ argument :layout_name, :type => :string, :default => "application"
9
+
10
+ attr_reader :app_name
11
+
12
+ def generate_layout
13
+ app = ::Rails.application
14
+ @app_name = app.class.to_s.split("::").first
15
+ ext = app.config.generators.options[:rails][:template_engine] || :erb
16
+ template "layout.html.#{ext}", "app/views/layouts/#{layout_name}.html.#{ext}"
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,85 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title><%%= content_for?(:title) ? yield(:title) : "<%= app_name %>" %></title>
8
+ <%%= csrf_meta_tags %>
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
+ <%%= stylesheet_link_tag "application", :media => "all" %>
16
+
17
+ <!-- For third-generation iPad with high-resolution Retina display: -->
18
+ <!-- Size should be 144 x 144 pixels -->
19
+ <%%= favicon_link_tag 'apple-touch-icon-144x144-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '144x144' %>
20
+
21
+ <!-- For iPhone with high-resolution Retina display: -->
22
+ <!-- Size should be 114 x 114 pixels -->
23
+ <%%= favicon_link_tag 'apple-touch-icon-114x114-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '114x114' %>
24
+
25
+ <!-- For first- and second-generation iPad: -->
26
+ <!-- Size should be 72 x 72 pixels -->
27
+ <%%= favicon_link_tag 'apple-touch-icon-72x72-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '72x72' %>
28
+
29
+ <!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
30
+ <!-- Size should be 57 x 57 pixels -->
31
+ <%%= favicon_link_tag 'apple-touch-icon-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png' %>
32
+
33
+ <!-- For all other devices -->
34
+ <!-- Size should be 32 x 32 pixels -->
35
+ <%%= favicon_link_tag 'favicon.ico', :rel => 'shortcut icon' %>
36
+
37
+ <%%= javascript_include_tag "application" %>
38
+ </head>
39
+ <body>
40
+
41
+ <div class="navbar 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="nav-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>
55
+ </div>
56
+ </div>
57
+ </div>
58
+
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">
66
+ <div class="well sidebar-nav">
67
+ <h3>Sidebar</h3>
68
+ <ul class="nav nav-list">
69
+ <li class="nav-header">Sidebar</li>
70
+ <li><%%= link_to "Link1", "/path1" %></li>
71
+ <li><%%= link_to "Link2", "/path2" %></li>
72
+ <li><%%= link_to "Link3", "/path3" %></li>
73
+ </ul>
74
+ </div><!--/.well -->
75
+ </div><!--/span-->
76
+ </div><!--/row-->
77
+
78
+ <footer>
79
+ <p>&copy; Company <%= Date.today.year %></p>
80
+ </footer>
81
+
82
+ </div> <!-- /container -->
83
+
84
+ </body>
85
+ </html>
@@ -0,0 +1,50 @@
1
+ !!! 5
2
+ %html(lang="en")
3
+ %head
4
+ %meta(charset="utf-8")
5
+ %meta(http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1")
6
+ %meta(name="viewport" content="width=device-width, initial-scale=1.0")
7
+ %title= content_for?(:title) ? yield(:title) : "<%= app_name %>"
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
+ = stylesheet_link_tag "application", :media => "all"
13
+ = favicon_link_tag 'apple-touch-icon-144x144-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '144x144'
14
+ = favicon_link_tag 'apple-touch-icon-114x114-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '114x114'
15
+ = favicon_link_tag 'apple-touch-icon-72x72-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '72x72'
16
+ = favicon_link_tag 'apple-touch-icon-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png'
17
+ = favicon_link_tag 'favicon.ico', :rel => 'shortcut icon'
18
+ = javascript_include_tag "application"
19
+
20
+
21
+ %body
22
+ .navbar.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
+ .nav-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"
35
+
36
+ .container
37
+ .row
38
+ .col-lg-9
39
+ = bootstrap_flash
40
+ = yield
41
+ .col-lg-3
42
+ .well.sidebar-nav
43
+ %h3 Sidebar
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
+ %footer
50
+ %p &copy; Company <%= Date.today.year %>
@@ -0,0 +1,52 @@
1
+ doctype html
2
+ html lang="en"
3
+ head
4
+ meta charset="utf-8"
5
+ meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"
6
+ meta name="viewport" content="width=device-width, initial-scale=1.0"
7
+ title= content_for?(:title) ? yield(:title) : "<%= app_name %>"
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
+ = stylesheet_link_tag "application", :media => "all"
14
+ = favicon_link_tag 'apple-touch-icon-144x144-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '144x144'
15
+ = favicon_link_tag 'apple-touch-icon-114x114-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '114x114'
16
+ = favicon_link_tag 'apple-touch-icon-72x72-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '72x72'
17
+ = favicon_link_tag 'apple-touch-icon-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png'
18
+ = favicon_link_tag 'favicon.ico', :rel => 'shortcut icon'
19
+ = javascript_include_tag "application"
20
+
21
+
22
+
23
+ body
24
+ .navbar.navbar-static-top
25
+ .container
26
+ button.navbar-toggle type="button" data-toggle="collapse" data-target=".navbar-responsive-collapse"
27
+ span.icon-bar
28
+ span.icon-bar
29
+ span.icon-bar
30
+ a.navbar-brand href="#"<%= app_name %>
31
+ .nav-collapse.collapse.navbar-responsive-collapse
32
+ ul.nav.navbar-nav
33
+ li= link_to "Link 1", "/path1"
34
+ li= link_to "Link 2", "/path2"
35
+ li= link_to "Link 3", "/path3"
36
+
37
+ .container
38
+ .row
39
+ .col-lg-9
40
+ = bootstrap_flash
41
+ = yield
42
+ .col-lg-3
43
+ .well.sidebar-nav
44
+ h3 Sidebar
45
+ ul.nav.nav-list
46
+ li.nav-header Sidebar
47
+ li= link_to "Link 1", "/path1"
48
+ li= link_to "Link 2", "/path2"
49
+ li= link_to "Link 3", "/path3"
50
+
51
+ footer
52
+ p &copy; Company <%= Date.today.year %>
@@ -0,0 +1,20 @@
1
+ require 'rails/generators'
2
+
3
+ module Bootstrap
4
+ module Generators
5
+ class PartialGenerator < ::Rails::Generators::Base
6
+ source_root File.expand_path("../templates", __FILE__)
7
+ desc "This generator generates bootstrap HTML partials"
8
+ argument :component_name, :type => :string, :default => "application",
9
+ :banner => "navbar, navbar-devise, carousel"
10
+
11
+ attr_reader :app_name
12
+
13
+ def generate_partial
14
+ app = ::Rails.application
15
+ ext = app.config.generators.options[:rails][:template_engine] || :erb
16
+ copy_file "_#{component_name}.html.#{ext}", "app/views/shared/_#{component_name}.html.#{ext}"
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,28 @@
1
+ <h2>Sign in</h2>
2
+
3
+ <%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => 'form-horizontal' }) do |f| %>
4
+ <div class="control-group">
5
+ <%= f.label :email, :class => 'control-label' %>
6
+ <div class="controls">
7
+ <%= f.email_field :email %>
8
+ </div>
9
+ </div>
10
+ <div class="control-group">
11
+ <%= f.label :password, :class => 'control-label' %>
12
+ <div class="controls">
13
+ <%= f.password_field :password %>
14
+ </div>
15
+ </div>
16
+
17
+ <% if devise_mapping.rememberable? -%>
18
+ <div class='control-group' >
19
+ <%= f.label :remember_me, :class => 'control-label' %>
20
+ <%= f.check_box :remember_me %>
21
+ </div>
22
+ <% end -%>
23
+
24
+ <%= f.submit "Sign in", :class => 'btn btn-default' %>
25
+
26
+ <% end %>
27
+
28
+ <%= render :partial => "devise/shared/links" %>