twitter-bootstrap-rails 2.1.7 → 2.2.8
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.
- data/README.md +428 -21
- data/Rakefile +15 -3
- 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/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-affix.js +12 -1
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +12 -1
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-button.js +12 -1
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +42 -11
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +18 -7
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +32 -11
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +25 -12
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +17 -6
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +13 -2
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +12 -1
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +115 -30
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +1 -1
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +38 -13
- data/app/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +890 -0
- data/app/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb +787 -0
- data/{vendor → app}/assets/stylesheets/twitter-bootstrap-static/sprites.css.erb +2 -2
- data/app/helpers/badge_label_helper.rb +16 -0
- data/app/helpers/bootstrap_flash_helper.rb +22 -16
- data/app/helpers/glyph_helper.rb +7 -2
- data/app/helpers/modal_helper.rb +29 -16
- data/app/helpers/navbar_helper.rb +194 -0
- data/app/helpers/twitter_breadcrumbs_helper.rb +7 -2
- data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +2 -2
- data/lib/generators/bootstrap/install/install_generator.rb +19 -6
- data/lib/generators/bootstrap/install/templates/bootstrap.coffee +2 -3
- data/lib/generators/bootstrap/install/templates/bootstrap.js +2 -3
- data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less +8 -10
- data/lib/generators/bootstrap/install/templates/en.bootstrap.yml +18 -0
- data/lib/generators/bootstrap/layout/templates/layout.html.erb +10 -12
- data/lib/generators/bootstrap/layout/templates/layout.html.haml +8 -11
- data/lib/generators/bootstrap/layout/templates/layout.html.slim +10 -11
- data/lib/generators/bootstrap/themed/templates/edit.html.erb +1 -2
- data/lib/generators/bootstrap/themed/templates/edit.html.haml +1 -1
- data/lib/generators/bootstrap/themed/templates/edit.html.slim +1 -1
- data/lib/generators/bootstrap/themed/templates/index.html.erb +1 -1
- data/lib/generators/bootstrap/themed/templates/index.html.haml +1 -1
- data/lib/generators/bootstrap/themed/templates/index.html.slim +1 -1
- data/lib/generators/bootstrap/themed/templates/new.html.erb +1 -2
- data/lib/generators/bootstrap/themed/templates/new.html.haml +1 -1
- data/lib/generators/bootstrap/themed/templates/new.html.slim +1 -1
- data/lib/generators/bootstrap/themed/templates/show.html.erb +1 -1
- data/lib/generators/bootstrap/themed/templates/show.html.haml +1 -1
- data/lib/generators/bootstrap/themed/templates/show.html.slim +1 -1
- data/lib/generators/bootstrap/themed/themed_generator.rb +2 -2
- data/lib/twitter/bootstrap/rails/engine.rb +3 -0
- data/lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb +14 -2
- data/lib/twitter/bootstrap/rails/version.rb +2 -2
- data/lib/twitter-bootstrap-rails.rb +4 -4
- 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 +362 -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 +316 -294
- data/vendor/static-source/fontawesome.less +8 -6
- data/vendor/static-source/sprites.less +3 -2
- 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 +14 -0
- data/vendor/toolkit/twitter/bootstrap/bootstrap.less +4 -4
- data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +6 -6
- data/vendor/toolkit/twitter/bootstrap/button-groups.less +31 -44
- data/vendor/toolkit/twitter/bootstrap/buttons.less +13 -17
- data/vendor/toolkit/twitter/bootstrap/carousel.less +48 -21
- data/vendor/toolkit/twitter/bootstrap/close.less +2 -1
- data/vendor/toolkit/twitter/bootstrap/code.less +3 -0
- data/vendor/toolkit/twitter/bootstrap/dropdowns.less +32 -21
- data/vendor/toolkit/twitter/bootstrap/forms.less +17 -10
- data/vendor/toolkit/twitter/bootstrap/labels-badges.less +12 -2
- data/vendor/toolkit/twitter/bootstrap/media.less +2 -2
- data/vendor/toolkit/twitter/bootstrap/mixins.less +25 -9
- data/vendor/toolkit/twitter/bootstrap/modals.less +4 -3
- data/vendor/toolkit/twitter/bootstrap/navbar.less +35 -13
- data/vendor/toolkit/twitter/bootstrap/navs.less +45 -21
- data/vendor/toolkit/twitter/bootstrap/pager.less +3 -1
- data/vendor/toolkit/twitter/bootstrap/pagination.less +3 -1
- data/vendor/toolkit/twitter/bootstrap/popovers.less +55 -39
- data/vendor/toolkit/twitter/bootstrap/reset.less +82 -4
- data/vendor/toolkit/twitter/bootstrap/responsive-767px-max.less +2 -2
- data/vendor/toolkit/twitter/bootstrap/responsive-navbar.less +6 -2
- data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +16 -0
- data/vendor/toolkit/twitter/bootstrap/responsive.less +1 -1
- data/vendor/toolkit/twitter/bootstrap/scaffolding.less +2 -1
- data/vendor/toolkit/twitter/bootstrap/sprites.less +9 -5
- data/vendor/toolkit/twitter/bootstrap/tables.less +54 -46
- data/vendor/toolkit/twitter/bootstrap/thumbnails.less +3 -2
- data/vendor/toolkit/twitter/bootstrap/tooltip.less +6 -6
- data/vendor/toolkit/twitter/bootstrap/type.less +44 -24
- data/vendor/toolkit/twitter/bootstrap/variables.less +3 -3
- metadata +130 -44
- data/lib/generators/bootstrap/partial/templates/_navbar.html.erb +0 -13
- data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.svg +0 -255
- data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
- data/vendor/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb +0 -218
- data/vendor/toolkit/font-awesome-ie7.less +0 -245
- data/vendor/toolkit/fontawesome.less +0 -327
- /data/{vendor → app}/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
- /data/{vendor → app}/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
- /data/{vendor → app}/assets/javascripts/twitter/bootstrap.js +0 -0
- /data/{vendor → app}/assets/javascripts/twitter/bootstrap_ujs.js +0 -0
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'action_view'
|
3
|
+
require 'active_support'
|
4
|
+
require_relative '../../../app/helpers/navbar_helper'
|
5
|
+
|
6
|
+
include ActionView::Helpers
|
7
|
+
include ActionView::Context
|
8
|
+
include NavbarHelper
|
9
|
+
|
10
|
+
describe NavbarHelper, 'uri_state', type: :helper do
|
11
|
+
before do
|
12
|
+
subject.stub_chain("request.host_with_port").and_return("#{HOST}")
|
13
|
+
subject.stub_chain("request.protocol").and_return("http://")
|
14
|
+
subject.stub_chain("request.url").and_return("#{HOST}/a/b")
|
15
|
+
subject.stub_chain("request.path").and_return('/a/b')
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'must return active state' do
|
19
|
+
subject.uri_state('/a/b').should == :active
|
20
|
+
subject.uri_state("#{HOST}/a/b").should == :active
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'must not return chosen for non get method' do
|
24
|
+
subject.uri_state('/a/b', :method => 'delete').should == :inactive
|
25
|
+
subject.uri_state("#{HOST}/a/b", :method => 'delete').should == :inactive
|
26
|
+
subject.uri_state('/a/b', "data-method" => 'delete').should == :inactive
|
27
|
+
subject.uri_state("#{HOST}/a/b", "data-method" => 'delete').should == :inactive
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'must return chosen state' do
|
31
|
+
subject.uri_state('/a').should == :chosen
|
32
|
+
subject.uri_state("#{HOST}/a").should == :chosen
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'must return inactive state' do
|
36
|
+
subject.uri_state('/test').should == :inactive
|
37
|
+
subject.uri_state("#{HOST}/test").should == :inactive
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'must not return chosen for root url' do
|
41
|
+
subject.uri_state('/').should == :inactive
|
42
|
+
subject.uri_state("#{HOST}/").should == :inactive
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
HOST = "http://example.com:80"
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# Require this file using `require "spec_helper"` to ensure that it is only
|
4
|
+
# loaded once.
|
5
|
+
#
|
6
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
7
|
+
require 'rubygems'
|
8
|
+
require 'bundler/setup'
|
9
|
+
require 'action_view'
|
10
|
+
require 'active_support'
|
11
|
+
require 'twitter-bootstrap-rails'
|
@@ -0,0 +1,75 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
module AbstractController
|
4
|
+
module Testing
|
5
|
+
|
6
|
+
class TestHelper
|
7
|
+
BREADCRUMB_NAMES = [:class_level, :class_level_i18n, :instance_level,
|
8
|
+
:instance_level_i18n, :base_level, :base_level_i18n]
|
9
|
+
|
10
|
+
class << self
|
11
|
+
BREADCRUMB_NAMES.each do |name|
|
12
|
+
define_method "#{name}_name" do
|
13
|
+
"test-breadcrumb-#{name}"
|
14
|
+
end
|
15
|
+
|
16
|
+
define_method "#{name}_path" do
|
17
|
+
"/test/breadcrumb/#{name}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
class BaseTestController < AbstractController::Base
|
24
|
+
include Twitter::Bootstrap::BreadCrumbs
|
25
|
+
include AbstractController::Callbacks
|
26
|
+
|
27
|
+
add_breadcrumb TestHelper.base_level_name, TestHelper.base_level_path
|
28
|
+
add_breadcrumb :base_level_i18n, TestHelper.base_level_i18n_path
|
29
|
+
|
30
|
+
def breadcrumbs
|
31
|
+
@breadcrumbs
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
class TestController < BaseTestController
|
36
|
+
add_breadcrumb TestHelper.class_level_name, TestHelper.class_level_path
|
37
|
+
add_breadcrumb :class_level_i18n, TestHelper.class_level_i18n_path
|
38
|
+
|
39
|
+
def index
|
40
|
+
add_breadcrumb TestHelper.instance_level_name, TestHelper.instance_level_path
|
41
|
+
add_breadcrumb :instance_level_i18n, TestHelper.instance_level_i18n_path
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
class BreadcrumbsTest < MiniTest::Unit::TestCase
|
46
|
+
def setup
|
47
|
+
options = { :scope => [:breadcrumbs, 'abstract_controller', 'testing', 'test'] }
|
48
|
+
[:class_level_i18n, :instance_level_i18n].each do |name|
|
49
|
+
I18n.expects(:t).with(name, options).returns(TestHelper.send("#{name}_name"))
|
50
|
+
end
|
51
|
+
|
52
|
+
name = :base_level_i18n
|
53
|
+
options = { :scope => [:breadcrumbs, 'abstract_controller', 'testing', 'base_test'] }
|
54
|
+
I18n.expects(:t).with(name, options).returns(TestHelper.send("#{name}_name"))
|
55
|
+
|
56
|
+
@controller = TestController.new
|
57
|
+
@controller.process(:index)
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_should_have_breadcrumbs
|
61
|
+
TestHelper::BREADCRUMB_NAMES.each do |name|
|
62
|
+
assert include_breadcrumb?(name), "#{name} breadcrumb not found"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def include_breadcrumb?(name)
|
67
|
+
selected = @controller.breadcrumbs.select { |b|
|
68
|
+
b[:name] == TestHelper.send("#{name}_name") &&
|
69
|
+
b[:url] == TestHelper.send("#{name}_path")
|
70
|
+
}
|
71
|
+
selected.any?
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
data/test/test_helper.rb
ADDED