twitter-bootstrap3-rails 3.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +708 -0
- data/Rakefile +46 -0
- data/app/assets/fonts/fontawesome-webfont.eot +0 -0
- data/app/assets/fonts/fontawesome-webfont.svg +399 -0
- data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/app/assets/fonts/fontawesome-webfont.woff +0 -0
- data/app/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
- data/app/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
- data/app/assets/javascripts/twitter/bootstrap.js +12 -0
- data/app/assets/javascripts/twitter/bootstrap/affix.js +126 -0
- data/app/assets/javascripts/twitter/bootstrap/alert.js +98 -0
- data/app/assets/javascripts/twitter/bootstrap/button.js +109 -0
- data/app/assets/javascripts/twitter/bootstrap/carousel.js +217 -0
- data/app/assets/javascripts/twitter/bootstrap/collapse.js +179 -0
- data/app/assets/javascripts/twitter/bootstrap/dropdown.js +154 -0
- data/app/assets/javascripts/twitter/bootstrap/modal.js +244 -0
- data/app/assets/javascripts/twitter/bootstrap/popover.js +117 -0
- data/app/assets/javascripts/twitter/bootstrap/scrollspy.js +158 -0
- data/app/assets/javascripts/twitter/bootstrap/tab.js +135 -0
- data/app/assets/javascripts/twitter/bootstrap/tooltip.js +382 -0
- data/app/assets/javascripts/twitter/bootstrap/transition.js +56 -0
- data/app/assets/javascripts/twitter/bootstrap_ujs.js +11 -0
- data/app/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +5579 -0
- data/app/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb +787 -0
- data/app/assets/stylesheets/twitter-bootstrap-static/sprites.css.erb +146 -0
- data/app/helpers/badge_label_helper.rb +16 -0
- data/app/helpers/bootstrap_flash_helper.rb +29 -0
- data/app/helpers/flash_block_helper.rb +17 -0
- data/app/helpers/glyph_helper.rb +17 -0
- data/app/helpers/modal_helper.rb +59 -0
- data/app/helpers/navbar_helper.rb +195 -0
- data/app/helpers/twitter_breadcrumbs_helper.rb +10 -0
- data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +12 -0
- data/lib/generators/bootstrap/install/install_generator.rb +82 -0
- data/lib/generators/bootstrap/install/templates/application.css +7 -0
- data/lib/generators/bootstrap/install/templates/application.js +10 -0
- data/lib/generators/bootstrap/install/templates/bootstrap.coffee +3 -0
- data/lib/generators/bootstrap/install/templates/bootstrap.js +4 -0
- data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.css +7 -0
- data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less +29 -0
- data/lib/generators/bootstrap/install/templates/en.bootstrap.yml +18 -0
- data/lib/generators/bootstrap/layout/layout_generator.rb +20 -0
- data/lib/generators/bootstrap/layout/templates/layout.html.erb +85 -0
- data/lib/generators/bootstrap/layout/templates/layout.html.haml +50 -0
- data/lib/generators/bootstrap/layout/templates/layout.html.slim +52 -0
- data/lib/generators/bootstrap/partial/partial_generator.rb +20 -0
- data/lib/generators/bootstrap/partial/templates/_login.html.erb +28 -0
- data/lib/generators/bootstrap/themed/templates/_form.html.erb +16 -0
- data/lib/generators/bootstrap/themed/templates/_form.html.haml +9 -0
- data/lib/generators/bootstrap/themed/templates/_form.html.slim +10 -0
- data/lib/generators/bootstrap/themed/templates/edit.html.erb +5 -0
- data/lib/generators/bootstrap/themed/templates/edit.html.haml +4 -0
- data/lib/generators/bootstrap/themed/templates/edit.html.slim +4 -0
- data/lib/generators/bootstrap/themed/templates/index.html.erb +40 -0
- data/lib/generators/bootstrap/themed/templates/index.html.haml +25 -0
- data/lib/generators/bootstrap/themed/templates/index.html.slim +27 -0
- data/lib/generators/bootstrap/themed/templates/new.html.erb +5 -0
- data/lib/generators/bootstrap/themed/templates/new.html.haml +4 -0
- data/lib/generators/bootstrap/themed/templates/new.html.slim +4 -0
- data/lib/generators/bootstrap/themed/templates/show.html.erb +21 -0
- data/lib/generators/bootstrap/themed/templates/show.html.haml +15 -0
- data/lib/generators/bootstrap/themed/templates/show.html.slim +16 -0
- data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.erb +13 -0
- data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.haml +10 -0
- data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.slim +11 -0
- data/lib/generators/bootstrap/themed/themed_generator.rb +148 -0
- data/lib/twitter-bootstrap-rails.rb +10 -0
- data/lib/twitter/bootstrap/rails/bootstrap.rb +2 -0
- data/lib/twitter/bootstrap/rails/engine.rb +33 -0
- data/lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb +42 -0
- data/lib/twitter/bootstrap/rails/version.rb +7 -0
- data/spec/lib/twitter_bootstrap_rails/badge_label_helper_spec.rb +22 -0
- data/spec/lib/twitter_bootstrap_rails/modal_helper_spec.rb +62 -0
- data/spec/lib/twitter_bootstrap_rails/navbar_helper_spec.rb +331 -0
- data/spec/lib/twitter_bootstrap_rails/uri_state_spec.rb +47 -0
- data/spec/spec_helper.rb +11 -0
- data/test/lib/breadcrumbs_test.rb +75 -0
- data/test/test_helper.rb +11 -0
- data/vendor/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +5579 -0
- data/vendor/static-source/bootstrap.less +1 -0
- data/vendor/static-source/fontawesome.less +9 -0
- data/vendor/static-source/sprites.less +6 -0
- data/vendor/toolkit/fontawesome/bootstrap.less +84 -0
- data/vendor/toolkit/fontawesome/core.less +129 -0
- data/vendor/toolkit/fontawesome/extras.less +93 -0
- data/vendor/toolkit/fontawesome/font-awesome-ie7.less +1953 -0
- data/vendor/toolkit/fontawesome/font-awesome.less +33 -0
- data/vendor/toolkit/fontawesome/icons.less +381 -0
- data/vendor/toolkit/fontawesome/mixins.less +48 -0
- data/vendor/toolkit/fontawesome/path.less +14 -0
- data/vendor/toolkit/fontawesome/variables.less +735 -0
- data/vendor/toolkit/twitter/bootstrap/alerts.less +71 -0
- data/vendor/toolkit/twitter/bootstrap/badges.less +51 -0
- data/vendor/toolkit/twitter/bootstrap/bootstrap.less +63 -0
- data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +23 -0
- data/vendor/toolkit/twitter/bootstrap/button-groups.less +244 -0
- data/vendor/toolkit/twitter/bootstrap/buttons.less +159 -0
- data/vendor/toolkit/twitter/bootstrap/carousel.less +204 -0
- data/vendor/toolkit/twitter/bootstrap/close.less +33 -0
- data/vendor/toolkit/twitter/bootstrap/code.less +56 -0
- data/vendor/toolkit/twitter/bootstrap/component-animations.less +29 -0
- data/vendor/toolkit/twitter/bootstrap/dropdowns.less +176 -0
- data/vendor/toolkit/twitter/bootstrap/forms.less +332 -0
- data/vendor/toolkit/twitter/bootstrap/grid.less +340 -0
- data/vendor/toolkit/twitter/bootstrap/input-groups.less +127 -0
- data/vendor/toolkit/twitter/bootstrap/jumbotron.less +29 -0
- data/vendor/toolkit/twitter/bootstrap/labels.less +54 -0
- data/vendor/toolkit/twitter/bootstrap/list-group.less +88 -0
- data/vendor/toolkit/twitter/bootstrap/media.less +56 -0
- data/vendor/toolkit/twitter/bootstrap/mixins.less +693 -0
- data/vendor/toolkit/twitter/bootstrap/modals.less +133 -0
- data/vendor/toolkit/twitter/bootstrap/navbar.less +559 -0
- data/vendor/toolkit/twitter/bootstrap/navs.less +228 -0
- data/vendor/toolkit/twitter/bootstrap/normalize.less +396 -0
- data/vendor/toolkit/twitter/bootstrap/pager.less +55 -0
- data/vendor/toolkit/twitter/bootstrap/pagination.less +72 -0
- data/vendor/toolkit/twitter/bootstrap/panels.less +128 -0
- data/vendor/toolkit/twitter/bootstrap/popovers.less +133 -0
- data/vendor/toolkit/twitter/bootstrap/print.less +100 -0
- data/vendor/toolkit/twitter/bootstrap/progress-bars.less +99 -0
- data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +149 -0
- data/vendor/toolkit/twitter/bootstrap/scaffolding.less +111 -0
- data/vendor/toolkit/twitter/bootstrap/tables.less +211 -0
- data/vendor/toolkit/twitter/bootstrap/thumbnails.less +42 -0
- data/vendor/toolkit/twitter/bootstrap/tooltip.less +95 -0
- data/vendor/toolkit/twitter/bootstrap/type.less +238 -0
- data/vendor/toolkit/twitter/bootstrap/utilities.less +42 -0
- data/vendor/toolkit/twitter/bootstrap/variables.less +607 -0
- data/vendor/toolkit/twitter/bootstrap/wells.less +29 -0
- data/vendor/toolkit/twitter/bootstrap_base.less +2 -0
- metadata +297 -0
@@ -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,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>© 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 © 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 © 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" %>
|