twitter-bootstrap-rails 2.0.7 → 2.0.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 CHANGED
@@ -176,6 +176,8 @@ gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootst
176
176
  <li>Added SimpleForm support</li>
177
177
  <li>Added FontAwesome support</li>
178
178
  <li>Released gem v.2.0.6</li>
179
+ <li>Released gem v.2.0.7</li>
180
+ <li>Released gem v.2.0.8</li>
179
181
  </ul>
180
182
 
181
183
 
@@ -0,0 +1,42 @@
1
+ module ModalHelper
2
+ def modal_dialog(options = {}, escape = true, &block)
3
+ default_options = {:class => "bootstrap-modal modal"}
4
+ content_tag :div, nil, options.merge(default_options), escape, &block
5
+ end
6
+
7
+ def modal_header(options = {}, escape = true, &block)
8
+ default_options = {:class => 'modal-header'}
9
+ content_tag :div, nil, options.merge(default_options), escape do
10
+ raw("<button class=\"close\" data-dismiss=\"modal\">&times;</button>" + capture(&block))
11
+ end
12
+ end
13
+
14
+ def modal_body(options = {}, escape = true, &block)
15
+ default_options = {:class => 'modal-body'}
16
+ content_tag :div, nil, options.merge(default_options), escape, &block
17
+ end
18
+
19
+ def modal_footer(options = {}, escape = true, &block)
20
+ default_options = {:class => 'modal-footer'}
21
+ content_tag :div, nil, options.merge(default_options), escape, &block
22
+ end
23
+
24
+ def modal_toggle(content_or_options = nil, options = {}, &block)
25
+ if block_given?
26
+ options = content_or_options if content_or_options.is_a?(Hash)
27
+ default_options = {:class => 'btn', "data-toggle" => "modal", "href" => options[:dialog]}.merge(options)
28
+
29
+ content_tag :a, nil, default_options, true, &block
30
+ else
31
+ default_options = {:class => 'btn', "data-toggle" => "modal", "href" => options[:dialog]}.merge(options)
32
+ content_tag :a, content_or_options, default_options, true
33
+ end
34
+ end
35
+
36
+ def modal_cancel_button content, options = {}
37
+ default_options = {:class => "btn bootstrap-modal-cancel-button"}
38
+
39
+ content_tag_string "a", content, default_options.merge(options)
40
+ end
41
+ end
42
+
@@ -1,5 +1,5 @@
1
1
  module TwitterBreadcrumbsHelper
2
2
  def render_breadcrumbs(divider = '/')
3
- render partial: 'twitter-bootstrap/breadcrumbs', locals: {divider: divider}
3
+ render :partial => 'twitter-bootstrap/breadcrumbs', :locals => { :divider => divider }
4
4
  end
5
- end
5
+ end
@@ -3,12 +3,12 @@
3
3
  <% separator = divider %>
4
4
  <% @breadcrumbs[0..-2].each do |crumb| %>
5
5
  <li>
6
- <a href="<%= crumb[:url] %>"><%= crumb[:name] %></a>
6
+ <%= link_to crumb[:name], crumb[:url] %>
7
7
  <span class="divider"><%= separator %></span>
8
8
  </li>
9
9
  <% end %>
10
10
  <li class="active">
11
- <a href="<%= @breadcrumbs.last[:url] %>"><%= @breadcrumbs.last[:name] %></a>
11
+ <%= link_to @breadcrumbs.last[:name], @breadcrumbs.last[:url] %>
12
12
  </li>
13
13
  </ul>
14
14
  <% end %>
@@ -1,4 +1,6 @@
1
1
  <%%- model_class = @<%= resource_name %>.class -%>
2
- <h1><%%=t '.title', :default => t('helpers.titles.edit', :model => model_class.model_name.human,
3
- :default => "Edit #{model_class.model_name.human}") %></h1>
2
+ <div class="page-header">
3
+ <h1><%%=t '.title', :default => t('helpers.titles.edit', :model => model_class.model_name.human,
4
+ :default => "Edit #{model_class.model_name.human}") %></h1>
5
+ </div>
4
6
  <%%= render :partial => 'form' %>
@@ -1,3 +1,4 @@
1
1
  - model_class = @<%= resource_name %>.class
2
- %h1=t '.title', :default => t('helpers.titles.edit', :model => model_class.model_name.human, :default => "Edit #{model_class.model_name.human}")
2
+ .page-header
3
+ %h1=t '.title', :default => t('helpers.titles.edit', :model => model_class.model_name.human, :default => "Edit #{model_class.model_name.human}")
3
4
  = render :partial => "form"
@@ -1,3 +1,4 @@
1
1
  - model_class = @<%= resource_name %>.class
2
- h1=t '.title', :default => t('helpers.titles.edit', :model => model_class.model_name.human, :default => "Edit #{model_class.model_name.human}")
3
- = render :partial => "form"
2
+ div class="page-header"
3
+ h1=t '.title', :default => t('helpers.titles.edit', :model => model_class.model_name.human, :default => "Edit #{model_class.model_name.human}")
4
+ = render :partial => "form"
@@ -1,5 +1,7 @@
1
1
  <%%- model_class = <%= resource_name.classify %>.new.class -%>
2
- <h1><%%=t '.title', :default => model_class.model_name.human.pluralize %></h1>
2
+ <div class="page-header">
3
+ <h1><%%=t '.title', :default => model_class.model_name.human.pluralize %></h1>
4
+ </div>
3
5
  <table class="table table-striped">
4
6
  <thead>
5
7
  <tr>
@@ -1,5 +1,6 @@
1
1
  - model_class = <%= resource_name.classify %>.new.class
2
- %h1=t '.title', :default => model_class.model_name.human.pluralize
2
+ .page-header
3
+ %h1=t '.title', :default => model_class.model_name.human.pluralize
3
4
  %table.table.table-striped
4
5
  %thead
5
6
  %tr
@@ -1,5 +1,6 @@
1
1
  - model_class = <%= resource_name.classify %>.new.class
2
- h1=t '.title', :default => model_class.model_name.human.pluralize
2
+ div class="page-header"
3
+ h1=t '.title', :default => model_class.model_name.human.pluralize
3
4
  table class="table table-striped"
4
5
  thead
5
6
  tr
@@ -1,4 +1,6 @@
1
1
  <%%- model_class = @<%= resource_name %>.class -%>
2
- <h1><%%=t '.title', :default => t('helpers.titles.new', :model => model_class.model_name.human,
3
- :default => "New #{model_class.model_name.human}") %></h1>
2
+ <div class="page-header">
3
+ <h1><%%=t '.title', :default => t('helpers.titles.new', :model => model_class.model_name.human,
4
+ :default => "New #{model_class.model_name.human}") %></h1>
5
+ </div>
4
6
  <%%= render :partial => 'form' %>
@@ -1,3 +1,4 @@
1
1
  - model_class = @<%= resource_name %>.class
2
- %h1=t '.title', :default => t('helpers.titles.new', :model => model_class.model_name.human, :default => "New #{model_class.model_name.human}")
2
+ .page-header
3
+ %h1=t '.title', :default => t('helpers.titles.new', :model => model_class.model_name.human, :default => "New #{model_class.model_name.human}")
3
4
  = render :partial => "form"
@@ -1,3 +1,4 @@
1
1
  - model_class = @<%= resource_name %>.class
2
- h1=t '.title', :default => t('helpers.titles.new', :model => model_class.model_name.human, :default => "New #{model_class.model_name.human}")
2
+ div class="page-header"
3
+ h1=t '.title', :default => t('helpers.titles.new', :model => model_class.model_name.human, :default => "New #{model_class.model_name.human}")
3
4
  = render :partial => "form"
@@ -1,5 +1,7 @@
1
1
  <%%- model_class = @<%= resource_name %>.class -%>
2
- <h1><%%=t '.title', :default => model_class.model_name.human %></h1>
2
+ <div class="page-header">
3
+ <h1><%%=t '.title', :default => model_class.model_name.human %></h1>
4
+ </div>
3
5
 
4
6
  <dl class="dl-horizontal">
5
7
  <%- columns.each do |column| -%>
@@ -1,5 +1,6 @@
1
1
  - model_class = @<%= resource_name %>.class
2
- %h1=t '.title', :default => model_class.model_name.human
2
+ .page-header
3
+ %h1=t '.title', :default => model_class.model_name.human
3
4
 
4
5
  <%- columns.each do |column| -%>
5
6
  %p
@@ -1,5 +1,6 @@
1
1
  - model_class = @<%= resource_name %>.class
2
- h1=t '.title', :default => model_class.model_name.human
2
+ div class="page-header"
3
+ h1=t '.title', :default => model_class.model_name.human
3
4
 
4
5
  <%- columns.each do |column| -%>
5
6
  p
@@ -1,5 +1,8 @@
1
1
  require 'rails'
2
+
2
3
  require File.dirname(__FILE__) + '/twitter-bootstrap-breadcrumbs.rb'
4
+ require File.dirname(__FILE__) + '/../../../../app/helpers/flash_block_helper.rb'
5
+ require File.dirname(__FILE__) + '/../../../../app/helpers/modal_helper.rb'
3
6
 
4
7
  module Twitter
5
8
  module Bootstrap
@@ -15,6 +18,8 @@ module Twitter
15
18
  initializer 'twitter-bootstrap-rails.setup_helpers' do |app|
16
19
  app.config.to_prepare do
17
20
  ActionController::Base.send :include, BreadCrumbs
21
+ ActionController::Base.send :helper, FlashBlockHelper
22
+ ActionController::Base.send :helper, ModalHelper
18
23
  #ActionController::Base.send :helper_method, :render_breadcrumbs
19
24
  end
20
25
  end
@@ -1,7 +1,7 @@
1
1
  module Twitter
2
2
  module Bootstrap
3
3
  module Rails
4
- VERSION = "2.0.7"
4
+ VERSION = "2.0.8"
5
5
  end
6
6
  end
7
7
  end
@@ -0,0 +1,11 @@
1
+ (function($, undefined) {
2
+ $(function () {
3
+ $('div.bootstrap-modal').modal();
4
+ $('div.bootstrap-modal').modal('hide').addClass('fade');
5
+
6
+ $("a.bootstrap-modal-cancel-button").click(function(event) {
7
+ $(event.target).closest("div.modal").modal("hide");
8
+ });
9
+ });
10
+ })( jQuery );
11
+
@@ -23,6 +23,10 @@
23
23
  .badge-error { background-color: @errorText; }
24
24
  .badge-error:hover { background-color: darken(@errorText, 10%); }
25
25
 
26
+ // Colors
27
+ .badge-important { background-color: @errorText; }
28
+ .badge-important:hover { background-color: darken(@errorText, 10%); }
29
+
26
30
  .badge-warning { background-color: @orange; }
27
31
  .badge-warning:hover { background-color: darken(@orange, 10%); }
28
32
 
@@ -33,4 +37,4 @@
33
37
  .badge-info:hover { background-color: darken(@infoText, 10%); }
34
38
 
35
39
  .badge-inverse { background-color: @grayDark; }
36
- .badge-inverse:hover { background-color: darken(@grayDark, 10%); }
40
+ .badge-inverse:hover { background-color: darken(@grayDark, 10%); }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter-bootstrap-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.7
4
+ version: 2.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-07 00:00:00.000000000 Z
12
+ date: 2012-05-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
16
- requirement: &70182731757680 !ruby/object:Gem::Requirement
16
+ requirement: &70356824137920 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70182731757680
24
+ version_requirements: *70356824137920
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: actionpack
27
- requirement: &70182731755340 !ruby/object:Gem::Requirement
27
+ requirement: &70356824137300 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3.1'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70182731755340
35
+ version_requirements: *70356824137300
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: therubyracer
38
- requirement: &70182731770260 !ruby/object:Gem::Requirement
38
+ requirement: &70356824136700 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.10.1
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70182731770260
46
+ version_requirements: *70356824136700
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: less-rails
49
- requirement: &70182731767820 !ruby/object:Gem::Requirement
49
+ requirement: &70356824136040 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 2.2.2
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70182731767820
57
+ version_requirements: *70356824136040
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rails
60
- requirement: &70182731765800 !ruby/object:Gem::Requirement
60
+ requirement: &70356824135300 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '3.1'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70182731765800
68
+ version_requirements: *70356824135300
69
69
  description: twitter-bootstrap-rails project integrates Bootstrap CSS toolkit for
70
70
  Rails 3.1 Asset Pipeline
71
71
  email:
@@ -127,6 +127,7 @@ files:
127
127
  - vendor/assets/javascripts/twitter/bootstrap/bootstrap-transition.js
128
128
  - vendor/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js
129
129
  - vendor/assets/javascripts/twitter/bootstrap.js
130
+ - vendor/assets/javascripts/twitter/bootstrap_ujs.js
130
131
  - vendor/toolkit/fontawesome.less
131
132
  - vendor/toolkit/twitter/bootstrap/accordion.less
132
133
  - vendor/toolkit/twitter/bootstrap/alerts.less
@@ -172,6 +173,7 @@ files:
172
173
  - vendor/toolkit/twitter/bootstrap/wells.less
173
174
  - vendor/toolkit/twitter/bootstrap_base.less
174
175
  - app/helpers/flash_block_helper.rb
176
+ - app/helpers/modal_helper.rb
175
177
  - app/helpers/twitter_breadcrumbs_helper.rb
176
178
  - app/views/twitter-bootstrap/_breadcrumbs.html.erb
177
179
  - Rakefile