bootstrap-sass-extras 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +9 -0
- data/CHANGELOG.md +48 -5
- data/Gemfile +4 -1
- data/Gemfile.lock +147 -87
- data/README.md +142 -34
- data/Rakefile +11 -1
- data/app/helpers/badge_helper.rb +13 -0
- data/app/helpers/bootstrap_flash_helper.rb +18 -10
- data/app/helpers/bootstrap_viewport_meta_helper.rb +27 -0
- data/app/helpers/glyph_helper.rb +10 -7
- data/app/helpers/modal_helper.rb +19 -15
- data/app/helpers/nav_helper.rb +40 -0
- data/app/helpers/twitter_breadcrumbs_helper.rb +8 -2
- data/app/helpers/url_helper.rb +28 -0
- data/app/views/bootstrap_sass_extras/_breadcrumbs.html.erb +6 -0
- data/bootstrap-sass-extras.gemspec +1 -0
- data/lib/bootstrap-sass-extras/breadcrumbs.rb +57 -0
- data/lib/bootstrap-sass-extras/engine.rb +6 -0
- data/lib/bootstrap-sass-extras/version.rb +1 -1
- data/lib/generators/bootstrap/install/templates/en.bootstrap.yml +1 -0
- data/lib/generators/bootstrap/layout/layout_generator.rb +1 -4
- data/lib/generators/bootstrap/layout/templates/layout.html.erb +39 -57
- data/lib/generators/bootstrap/layout/templates/layout.html.haml +27 -45
- data/lib/generators/bootstrap/layout/templates/layout.html.slim +27 -46
- data/lib/generators/bootstrap/partial/templates/_login.html.erb +6 -6
- data/lib/generators/bootstrap/themed/templates/_form.html.erb +11 -9
- data/lib/generators/bootstrap/themed/templates/_form.html.haml +9 -8
- data/lib/generators/bootstrap/themed/templates/_form.html.slim +9 -9
- data/lib/generators/bootstrap/themed/templates/edit.html.erb +2 -2
- data/lib/generators/bootstrap/themed/templates/edit.html.haml +2 -2
- data/lib/generators/bootstrap/themed/templates/edit.html.slim +2 -2
- data/lib/generators/bootstrap/themed/templates/index.html.erb +16 -14
- data/lib/generators/bootstrap/themed/templates/index.html.haml +11 -7
- data/lib/generators/bootstrap/themed/templates/index.html.slim +13 -11
- data/lib/generators/bootstrap/themed/templates/new.html.erb +2 -2
- data/lib/generators/bootstrap/themed/templates/new.html.haml +2 -2
- data/lib/generators/bootstrap/themed/templates/new.html.slim +3 -3
- data/lib/generators/bootstrap/themed/templates/show.html.erb +19 -17
- data/lib/generators/bootstrap/themed/templates/show.html.haml +12 -12
- data/lib/generators/bootstrap/themed/templates/show.html.slim +12 -11
- data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.erb +9 -7
- data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.haml +6 -5
- data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.slim +6 -6
- data/spec/dummy/README.rdoc +15 -248
- data/spec/dummy/Rakefile +1 -2
- data/spec/dummy/app/assets/config/manifest.js +3 -0
- data/spec/dummy/app/{mailers/.gitkeep → assets/images/.keep} +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +4 -6
- data/spec/dummy/app/assets/stylesheets/application.css +6 -4
- data/spec/dummy/app/controllers/application_controller.rb +3 -1
- data/spec/dummy/app/{models/.gitkeep → controllers/concerns/.keep} +0 -0
- data/spec/dummy/{lib/assets/.gitkeep → app/mailers/.keep} +0 -0
- data/spec/dummy/{log/.gitkeep → app/models/.keep} +0 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/views/application/_custom_breadcrumbs.html.erb +1 -0
- data/spec/dummy/app/views/layouts/application.html.erb +2 -2
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +2 -2
- data/spec/dummy/config/application.rb +1 -37
- data/spec/dummy/config/boot.rb +4 -9
- data/spec/dummy/config/database.yml +8 -8
- data/spec/dummy/config/environment.rb +3 -3
- data/spec/dummy/config/environments/development.rb +22 -18
- data/spec/dummy/config/environments/production.rb +46 -34
- data/spec/dummy/config/environments/test.rb +19 -14
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +6 -5
- data/spec/dummy/config/initializers/mime_types.rb +0 -1
- data/spec/dummy/config/initializers/session_store.rb +1 -6
- data/spec/dummy/config/initializers/wrap_parameters.rb +6 -6
- data/spec/dummy/config/locales/en.yml +20 -2
- data/spec/dummy/config/routes.rb +23 -25
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/log/.keep +0 -0
- data/spec/dummy/public/404.html +54 -13
- data/spec/dummy/public/422.html +54 -13
- data/spec/dummy/public/500.html +53 -12
- data/spec/helpers/badge_helper_spec.rb +16 -0
- data/spec/helpers/bootstrap_flash_helper_spec.rb +52 -12
- data/spec/helpers/bootstrap_viewport_meta_helper_spec.rb +17 -0
- data/spec/helpers/button_to_helper_spec.rb +33 -0
- data/spec/helpers/glyph_helper_spec.rb +15 -0
- data/spec/helpers/nav_helper_spec.rb +79 -0
- data/spec/helpers/twitter_breadcrumbs_helper_spec.rb +161 -0
- data/spec/spec_helper.rb +1 -1
- metadata +69 -30
- data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +0 -14
- data/spec/dummy/config/initializers/secret_token.rb +0 -7
- data/spec/dummy/script/rails +0 -6
data/Rakefile
CHANGED
@@ -1 +1,11 @@
|
|
1
|
-
require
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
require 'rspec/core/rake_task'
|
4
|
+
|
5
|
+
desc "Run all examples"
|
6
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
7
|
+
#t.rspec_path = 'bin/rspec'
|
8
|
+
t.rspec_opts = %w[--color]
|
9
|
+
end
|
10
|
+
|
11
|
+
task :default => [:spec]
|
@@ -1,17 +1,25 @@
|
|
1
1
|
module BootstrapFlashHelper
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
ALERT_TYPES_MAP = {
|
3
|
+
notice: :success,
|
4
|
+
alert: :danger,
|
5
|
+
error: :danger,
|
6
|
+
info: :info,
|
7
|
+
warning: :warning
|
8
|
+
}.freeze
|
7
9
|
|
8
|
-
|
10
|
+
def bootstrap_flash
|
11
|
+
safe_join(flash.each_with_object([]) do |(type, message), messages|
|
12
|
+
next if message.blank? || !message.respond_to?(:to_str)
|
13
|
+
type = ALERT_TYPES_MAP.fetch(type.to_sym, type)
|
14
|
+
messages << flash_container(type, message)
|
15
|
+
end, "\n").presence
|
9
16
|
end
|
10
17
|
|
11
18
|
def flash_container(type, message)
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
19
|
+
content_tag :div, class: "alert alert-#{type} alert-dismissable" do
|
20
|
+
button_tag type: "button", class: "close", data: { dismiss: "alert" } do
|
21
|
+
"×".html_safe
|
22
|
+
end.safe_concat(message)
|
23
|
+
end
|
16
24
|
end
|
17
25
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module BootstrapViewportMetaHelper
|
2
|
+
#
|
3
|
+
# Creates the meta tag for Bootstrap with the specified parameters:
|
4
|
+
#
|
5
|
+
# <%= viewport_meta_tag %>
|
6
|
+
#
|
7
|
+
# Renders:
|
8
|
+
#
|
9
|
+
# <meta content="width=device-width,initial-scale=1.0" name="viewport" />
|
10
|
+
#
|
11
|
+
# You can change the content value by passing a hash as an argument:
|
12
|
+
#
|
13
|
+
# <%= viewport_meta_tag(:maximum_scale => "1.0") %>
|
14
|
+
#
|
15
|
+
# Renders:
|
16
|
+
#
|
17
|
+
# <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0" name="viewport" />
|
18
|
+
#
|
19
|
+
def viewport_meta_tag(*args)
|
20
|
+
options = {
|
21
|
+
width: "device-width",
|
22
|
+
initial_scale: "1.0" }.merge(args[0] || {})
|
23
|
+
|
24
|
+
content = options.collect {|key,value| "#{key.to_s.dasherize}=#{value}"}.join(",")
|
25
|
+
raw(tag(:meta, name: "viewport", content: content))
|
26
|
+
end
|
27
|
+
end
|
data/app/helpers/glyph_helper.rb
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
module GlyphHelper
|
2
2
|
# ==== Examples
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
3
|
+
#
|
4
|
+
# glyph(:search)
|
5
|
+
# => <span class="glyphicon glyphicon-search"></span>
|
6
|
+
# glyph(:search, :paperclip)
|
7
|
+
# => <span class="glyphicon glyphicon-search"></span><span class="glyphicon glyphicon-paperclip"></span>
|
7
8
|
|
8
|
-
def glyph(*
|
9
|
-
|
9
|
+
def glyph(*glyphicon_names)
|
10
|
+
safe_join(glyphicon_names.map do |name|
|
11
|
+
content_tag :span, nil, class: "glyphicon glyphicon-#{name.to_s.parameterize}"
|
12
|
+
end, "")
|
10
13
|
end
|
11
|
-
end
|
14
|
+
end
|
data/app/helpers/modal_helper.rb
CHANGED
@@ -2,21 +2,26 @@ module ModalHelper
|
|
2
2
|
|
3
3
|
#modals have a header, a body, a footer for options.
|
4
4
|
def modal_dialog(options = {}, &block)
|
5
|
-
content_tag :div, :id => options[:id], :class => "
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
content_tag :div, :id => options[:id], :class => "modal fade", :role => "dialog" do
|
6
|
+
content_tag :div, class: 'modal-dialog' do
|
7
|
+
content_tag :div, class: 'modal-content' do
|
8
|
+
modal_header(options[:header]) +
|
9
|
+
modal_body(options[:body]) +
|
10
|
+
modal_footer(options[:footer])
|
11
|
+
end
|
12
|
+
end
|
9
13
|
end
|
10
14
|
end
|
11
15
|
|
12
16
|
def modal_header(options = {}, &block)
|
17
|
+
dismiss = options.delete(:dismiss) || 'modal'
|
13
18
|
content_tag :div, :class => 'modal-header' do
|
14
|
-
if options[:show_close]
|
15
|
-
close_button(
|
16
|
-
content_tag(:
|
19
|
+
if options[:show_close]
|
20
|
+
close_button(dismiss) +
|
21
|
+
content_tag(:h4, options[:title], :class => 'modal-title', &block)
|
17
22
|
else
|
18
|
-
content_tag(:
|
19
|
-
end
|
23
|
+
content_tag(:h4, options[:title], :class => 'modal-title', &block)
|
24
|
+
end
|
20
25
|
end
|
21
26
|
end
|
22
27
|
|
@@ -29,26 +34,25 @@ module ModalHelper
|
|
29
34
|
end
|
30
35
|
|
31
36
|
def close_button(dismiss)
|
32
|
-
|
33
|
-
raw("<button class=\"close\" data-dismiss=\"#{dismiss}\">×</button>")
|
37
|
+
content_tag :button, "×".html_safe, :class => "close", "data-dismiss" => "#{dismiss}", "aria-hidden" => "true"
|
34
38
|
end
|
35
39
|
|
36
40
|
def modal_toggle(content_or_options = nil, options = {}, &block)
|
37
41
|
if block_given?
|
38
42
|
options = content_or_options if content_or_options.is_a?(Hash)
|
39
|
-
default_options = { :class => 'btn', "data-toggle" => "modal", "
|
43
|
+
default_options = { :class => 'btn', "data-toggle" => "modal", "data-target" => options.delete[:dialog] }.merge(options)
|
40
44
|
|
41
45
|
content_tag :a, nil, default_options, true, &block
|
42
46
|
else
|
43
|
-
default_options = { :class => 'btn', "data-toggle" => "modal", "
|
47
|
+
default_options = { :class => 'btn', "data-toggle" => "modal", "data-target" => options.delete(:dialog) }.merge(options)
|
44
48
|
content_tag :a, content_or_options, default_options, true
|
45
49
|
end
|
46
50
|
end
|
47
51
|
|
48
52
|
def modal_cancel_button content, options = {}
|
49
|
-
default_options = { :class => "btn
|
53
|
+
default_options = { :class => "btn btn-default", :data => { dismiss: "modal" } }
|
50
54
|
|
51
|
-
content_tag_string
|
55
|
+
content_tag_string :button, content, default_options.merge(options)
|
52
56
|
end
|
53
57
|
|
54
58
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module NavHelper
|
2
|
+
NAV_CLASS = 'nav'.freeze
|
3
|
+
NAV_TABS_CLASS = 'nav-tabs'.freeze
|
4
|
+
NAV_PILLS_CLASS = 'nav-pills'.freeze
|
5
|
+
NAV_CLASSES = [NAV_TABS_CLASS, NAV_PILLS_CLASS]
|
6
|
+
|
7
|
+
def nav(options = {}, type = NAV_TABS_CLASS, &block)
|
8
|
+
options, type = {}, options unless options.is_a?(Hash)
|
9
|
+
options[:class] ||= []
|
10
|
+
options[:class] = [*options[:class]]
|
11
|
+
options[:class].unshift(NAV_CLASS) unless options[:class].include?(NAV_CLASS)
|
12
|
+
options[:class] << type unless NAV_CLASSES.any? { |c| options[:class].include?(c) }
|
13
|
+
|
14
|
+
content_or_options_with_block = options if block_given?
|
15
|
+
content_tag(:ul, content_or_options_with_block, options, &block)
|
16
|
+
end
|
17
|
+
alias_method(:tabs, :nav)
|
18
|
+
|
19
|
+
def pills(*args, &block)
|
20
|
+
nav(*args, NAV_PILLS_CLASS, &block)
|
21
|
+
end
|
22
|
+
|
23
|
+
def nav_to(name = nil, options = nil, html_options = nil, &block)
|
24
|
+
if block_given?
|
25
|
+
url_options, html_options = name, options
|
26
|
+
else
|
27
|
+
url_options = options
|
28
|
+
end
|
29
|
+
|
30
|
+
url_options ||= {}
|
31
|
+
|
32
|
+
active = html_options.try(:delete, :active)
|
33
|
+
active = current_page?(url_options) if active.nil?
|
34
|
+
tab_class = active ? 'active' : nil
|
35
|
+
|
36
|
+
content_tag(:li, role: 'presentation', class: tab_class) do
|
37
|
+
link_to(name, options, html_options, &block)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -1,5 +1,11 @@
|
|
1
1
|
module TwitterBreadcrumbsHelper
|
2
|
-
def render_breadcrumbs(
|
3
|
-
|
2
|
+
def render_breadcrumbs(options = {}, &block)
|
3
|
+
return unless breadcrumbs?
|
4
|
+
content = render(options[:partial] || 'bootstrap_sass_extras/breadcrumbs')
|
5
|
+
if block_given?
|
6
|
+
capture(content, &block)
|
7
|
+
else
|
8
|
+
content
|
9
|
+
end
|
4
10
|
end
|
5
11
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module UrlHelper
|
2
|
+
BUTTON_CLASSES = ['btn-default', 'btn-primary', 'btn-success', 'btn-info', 'btn-warning',
|
3
|
+
'btn-danger', 'btn-link'].freeze
|
4
|
+
|
5
|
+
def self.included(class_)
|
6
|
+
class_.class_eval do
|
7
|
+
def button_to(*args, &proc)
|
8
|
+
args << nil if args.length < 2
|
9
|
+
args << {} if args.length < 3
|
10
|
+
button_to_with_bootstrap(*args, &proc)
|
11
|
+
super(*args, &proc)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def button_to_with_bootstrap(name = nil, options = nil, html_options = {}, &block)
|
17
|
+
html_options[:class] ||= []
|
18
|
+
html_options[:class] = [*html_options[:class]]
|
19
|
+
|
20
|
+
# Expand space-separated class strings so that each has its own spot in the class array
|
21
|
+
html_options[:class] = html_options[:class].map { |c| c.split }.flatten
|
22
|
+
|
23
|
+
html_options[:class].unshift('btn') unless html_options[:class].include?('btn')
|
24
|
+
if html_options[:class].select { |cls| UrlHelper::BUTTON_CLASSES.include?(cls) }.empty?
|
25
|
+
html_options[:class] << 'btn-default'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -16,6 +16,7 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
|
+
|
19
20
|
gem.add_dependency "rails", ">= 3.1.0"
|
20
21
|
|
21
22
|
gem.add_development_dependency "rspec-rails"
|
@@ -0,0 +1,57 @@
|
|
1
|
+
module BootstrapSassExtras
|
2
|
+
module BreadCrumbs
|
3
|
+
def self.included(base)
|
4
|
+
base.extend(ClassMethods)
|
5
|
+
base.helper_method :breadcrumbs?,
|
6
|
+
:breadcrumb_names,
|
7
|
+
:last_breadcrumb_name
|
8
|
+
end
|
9
|
+
|
10
|
+
module ClassMethods
|
11
|
+
def add_breadcrumb(name, url, options = {})
|
12
|
+
class_name = self.name
|
13
|
+
before_action options do |controller|
|
14
|
+
if name.is_a?(Symbol)
|
15
|
+
name = controller.send :translate_breadcrumb, name, class_name
|
16
|
+
end
|
17
|
+
controller.send :add_breadcrumb, name, url
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
protected
|
23
|
+
|
24
|
+
def add_breadcrumb(name, url = '', options = {})
|
25
|
+
@breadcrumbs ||= []
|
26
|
+
name = translate_breadcrumb(name, self.class.name) if name.is_a?(Symbol)
|
27
|
+
url = send(url) if url.is_a?(Symbol)
|
28
|
+
@breadcrumbs << { name: name, url: url, options: options }
|
29
|
+
end
|
30
|
+
|
31
|
+
def translate_breadcrumb(name, class_name)
|
32
|
+
scope = [:breadcrumbs]
|
33
|
+
namespace = class_name.underscore.split('/')
|
34
|
+
namespace.last.sub!('_controller', '')
|
35
|
+
scope << namespace
|
36
|
+
|
37
|
+
I18n.t name, scope: scope
|
38
|
+
end
|
39
|
+
|
40
|
+
def clear_breadcrumbs
|
41
|
+
@breadcrumbs = nil
|
42
|
+
end
|
43
|
+
|
44
|
+
def breadcrumbs?
|
45
|
+
Array(@breadcrumbs).any?
|
46
|
+
end
|
47
|
+
|
48
|
+
def breadcrumb_names
|
49
|
+
Array(@breadcrumbs).map { |breadcrumb| breadcrumb[:name] }
|
50
|
+
end
|
51
|
+
|
52
|
+
def last_breadcrumb_name
|
53
|
+
return unless crumb = Array(@breadcrumbs).last
|
54
|
+
crumb[:name]
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -1,11 +1,17 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/breadcrumbs.rb'
|
1
2
|
module BootstrapSassExtras
|
2
3
|
class Engine < ::Rails::Engine
|
3
4
|
initializer 'bootstrap-sass-extras.setup_helpers' do |app|
|
4
5
|
app.config.to_prepare do
|
5
6
|
ActionController::Base.send :helper, BootstrapFlashHelper
|
7
|
+
ActionController::Base.send :helper, BootstrapViewportMetaHelper
|
6
8
|
ActionController::Base.send :helper, GlyphHelper
|
9
|
+
ActionController::Base.send :helper, BadgeHelper
|
7
10
|
ActionController::Base.send :helper, ModalHelper
|
11
|
+
ActionController::Base.send :helper, NavHelper
|
8
12
|
ActionController::Base.send :helper, TwitterBreadcrumbsHelper
|
13
|
+
ActionController::Base.send :helper, UrlHelper
|
14
|
+
ActionController::Base.send :include, BootstrapSassExtras::BreadCrumbs
|
9
15
|
end
|
10
16
|
end
|
11
17
|
end
|
@@ -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
|
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
|
@@ -3,107 +3,89 @@
|
|
3
3
|
<head>
|
4
4
|
<meta charset="utf-8">
|
5
5
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
6
|
-
|
6
|
+
<%%= viewport_meta_tag %>
|
7
7
|
<title><%%= content_for?(:title) ? yield(:title) : "<%= app_name %>" %></title>
|
8
8
|
<%%= csrf_meta_tags %>
|
9
9
|
|
10
10
|
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
|
11
11
|
<!--[if lt IE 9]>
|
12
12
|
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js" type="text/javascript"></script>
|
13
|
+
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.3.0/respond.js" type="text/javascript"></script>
|
13
14
|
<![endif]-->
|
14
15
|
|
15
|
-
<%%= stylesheet_link_tag "application", :
|
16
|
+
<%%= stylesheet_link_tag "application", media: "all" %>
|
16
17
|
|
17
18
|
<!-- For third-generation iPad with high-resolution Retina display: -->
|
18
19
|
<!-- Size should be 144 x 144 pixels -->
|
19
|
-
<%%= favicon_link_tag 'apple-touch-icon-144x144-precomposed.png', :
|
20
|
+
<%%= favicon_link_tag 'apple-touch-icon-144x144-precomposed.png', rel: 'apple-touch-icon-precomposed', type: 'image/png', sizes: '144x144' %>
|
20
21
|
|
21
22
|
<!-- For iPhone with high-resolution Retina display: -->
|
22
23
|
<!-- Size should be 114 x 114 pixels -->
|
23
|
-
<%%= favicon_link_tag 'apple-touch-icon-114x114-precomposed.png', :
|
24
|
+
<%%= favicon_link_tag 'apple-touch-icon-114x114-precomposed.png', rel: 'apple-touch-icon-precomposed', type: 'image/png', sizes: '114x114' %>
|
24
25
|
|
25
26
|
<!-- For first- and second-generation iPad: -->
|
26
27
|
<!-- Size should be 72 x 72 pixels -->
|
27
|
-
<%%= favicon_link_tag 'apple-touch-icon-72x72-precomposed.png', :
|
28
|
+
<%%= favicon_link_tag 'apple-touch-icon-72x72-precomposed.png', rel: 'apple-touch-icon-precomposed', type: 'image/png', sizes: '72x72' %>
|
28
29
|
|
29
30
|
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
|
30
31
|
<!-- Size should be 57 x 57 pixels -->
|
31
|
-
<%%= favicon_link_tag 'apple-touch-icon-precomposed.png', :
|
32
|
+
<%%= favicon_link_tag 'apple-touch-icon-precomposed.png', rel: 'apple-touch-icon-precomposed', type: 'image/png' %>
|
32
33
|
|
33
34
|
<!-- For all other devices -->
|
34
35
|
<!-- Size should be 32 x 32 pixels -->
|
35
|
-
<%%= favicon_link_tag 'favicon.ico', :
|
36
|
+
<%%= favicon_link_tag 'favicon.ico', rel: 'shortcut icon' %>
|
37
|
+
<%%= javascript_include_tag "application" %>
|
36
38
|
</head>
|
37
39
|
<body>
|
38
40
|
|
39
|
-
<
|
40
|
-
<div class="
|
41
|
-
|
42
|
-
|
41
|
+
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
|
42
|
+
<div class="container">
|
43
|
+
<!-- Brand and toggle get grouped for better mobile display -->
|
44
|
+
<div class="navbar-header">
|
45
|
+
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
|
46
|
+
<span class="sr-only">Toggle navigation</span>
|
43
47
|
<span class="icon-bar"></span>
|
44
48
|
<span class="icon-bar"></span>
|
45
49
|
<span class="icon-bar"></span>
|
46
|
-
</
|
47
|
-
<a class="brand" href="#"><%= app_name
|
48
|
-
<div class="<%= container_class %> nav-collapse">
|
49
|
-
<ul class="nav">
|
50
|
-
<li><%%= link_to "Link1", "/path1" %></li>
|
51
|
-
<li><%%= link_to "Link2", "/path2" %></li>
|
52
|
-
<li><%%= link_to "Link3", "/path3" %></li>
|
53
|
-
</ul>
|
54
|
-
</div><!--/.nav-collapse -->
|
50
|
+
</button>
|
51
|
+
<a class="navbar-brand" href="#"><%= app_name%></a>
|
55
52
|
</div>
|
53
|
+
|
54
|
+
<!-- Collect the nav links, forms, and other content for toggling -->
|
55
|
+
<div class="navbar-collapse collapse navbar-responsive-collapse">
|
56
|
+
<ul class="nav navbar-nav">
|
57
|
+
<li class="active"><%%= link_to "Link1", '#' %></li>
|
58
|
+
<li><%%= link_to "Link2", '#' %></li>
|
59
|
+
<li><%%= link_to "Link3", '#' %></li>
|
60
|
+
</ul>
|
61
|
+
</div><!-- /.navbar-collapse -->
|
56
62
|
</div>
|
57
|
-
</
|
63
|
+
</nav>
|
58
64
|
|
59
|
-
<div class="
|
60
|
-
|
61
|
-
|
62
|
-
|
65
|
+
<div class="container">
|
66
|
+
<div class="row">
|
67
|
+
<div class="col-md-9">
|
68
|
+
<%%= bootstrap_flash %>
|
69
|
+
<%%= yield %>
|
70
|
+
</div>
|
71
|
+
<div class="col-md-3">
|
63
72
|
<div class="well sidebar-nav">
|
73
|
+
<h3>Sidebar</h3>
|
64
74
|
<ul class="nav nav-list">
|
65
75
|
<li class="nav-header">Sidebar</li>
|
66
|
-
<li><%%= link_to "Link1", "
|
67
|
-
<li><%%= link_to "Link2", "
|
68
|
-
<li><%%= link_to "Link3", "
|
76
|
+
<li><%%= link_to "Link1", "#" %></li>
|
77
|
+
<li><%%= link_to "Link2", "#" %></li>
|
78
|
+
<li><%%= link_to "Link3", "#" %></li>
|
69
79
|
</ul>
|
70
80
|
</div><!--/.well -->
|
71
81
|
</div><!--/span-->
|
72
|
-
<div class="span9">
|
73
|
-
<%%= bootstrap_flash %>
|
74
|
-
<%%= yield %>
|
75
|
-
</div>
|
76
82
|
</div><!--/row-->
|
77
|
-
<%- else -%>
|
78
|
-
<div class="row">
|
79
|
-
<div class="span9">
|
80
|
-
<%%= bootstrap_flash %>
|
81
|
-
<%%= yield %>
|
82
|
-
</div>
|
83
|
-
<div class="span3">
|
84
|
-
<div class="well sidebar-nav">
|
85
|
-
<h3>Sidebar</h3>
|
86
|
-
<ul class="nav nav-list">
|
87
|
-
<li class="nav-header">Sidebar</li>
|
88
|
-
<li><%%= link_to "Link1", "/path1" %></li>
|
89
|
-
<li><%%= link_to "Link2", "/path2" %></li>
|
90
|
-
<li><%%= link_to "Link3", "/path3" %></li>
|
91
|
-
</ul>
|
92
|
-
</div><!--/.well -->
|
93
|
-
</div><!--/span-->
|
94
|
-
</div><!--/row-->
|
95
|
-
<%- end -%>
|
96
83
|
|
97
84
|
<footer>
|
98
|
-
<p>© Company
|
85
|
+
<p>© Company <%= Date.today.year %></p>
|
99
86
|
</footer>
|
100
87
|
|
101
88
|
</div> <!-- /container -->
|
102
89
|
|
103
|
-
<!-- Javascripts
|
104
|
-
================================================== -->
|
105
|
-
<!-- Placed at the end of the document so the pages load faster -->
|
106
|
-
<%%= javascript_include_tag "application" %>
|
107
|
-
|
108
90
|
</body>
|
109
91
|
</html>
|