bootstrap-sass-extras 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +14 -0
- data/Gemfile.lock +4 -3
- data/README.md +49 -0
- data/app/helpers/glyph_helper.rb +11 -0
- data/app/helpers/modal_helper.rb +55 -0
- data/app/helpers/twitter_breadcrumbs_helper.rb +5 -0
- data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +14 -0
- data/lib/bootstrap-sass-extras/engine.rb +3 -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/templates/layout.html.erb +4 -4
- data/lib/generators/bootstrap/layout/templates/layout.html.haml +5 -5
- data/lib/generators/bootstrap/layout/templates/layout.html.slim +7 -5
- data/lib/generators/bootstrap/themed/templates/edit.html.erb +1 -1
- 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 -1
- 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
- metadata +7 -5
- data/lib/.DS_Store +0 -0
- data/lib/generators/.DS_Store +0 -0
- data/lib/generators/bootstrap/install/templates/.DS_Store +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3fb89b0dac2bdbce1b2c0b80f970f8c2f8f4b4f
|
4
|
+
data.tar.gz: ff4cb7955a581564fa9f33b1e2a7d3cd20bff4a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 991f34f1c4b0c695d9aca47d7604fe04b33e5397b807d99940d1f89384c0fe9ba44945a8b30d8e48157ef9c0c409fa6054909fb95d52ea809be7d17cc27953bb
|
7
|
+
data.tar.gz: 10f5f1afbdbcb87cd455a0cceef1fc73adada250b1a6e2fca9d8e663a1889bc2c182cf3c44de3894c8e13c8591c7b8b098c4ae762da0f825d63676aa0d0c7867
|
data/.gitignore
CHANGED
data/CHANGELOG.md
ADDED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bootstrap-sass-extras (0.0.
|
4
|
+
bootstrap-sass-extras (0.0.1)
|
5
5
|
rails (>= 3.1.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -42,10 +42,11 @@ GEM
|
|
42
42
|
i18n (0.6.1)
|
43
43
|
journey (1.0.4)
|
44
44
|
json (1.7.7)
|
45
|
-
mail (2.5.
|
45
|
+
mail (2.5.3)
|
46
|
+
i18n (>= 0.4.0)
|
46
47
|
mime-types (~> 1.16)
|
47
48
|
treetop (~> 1.4.8)
|
48
|
-
mime-types (1.
|
49
|
+
mime-types (1.21)
|
49
50
|
multi_json (1.7.2)
|
50
51
|
polyglot (0.3.3)
|
51
52
|
rack (1.4.5)
|
data/README.md
CHANGED
@@ -76,6 +76,55 @@ Notice the plural usage of the resource to generate bootstrap:themed.
|
|
76
76
|
### Flash helper
|
77
77
|
Add flash helper `<%= bootstrap_flash %>` to your layout (built-in with layout generator)
|
78
78
|
|
79
|
+
### Modal Helper
|
80
|
+
You can create modals easily using the following example. The header, body, and footer all accept content_tag or plain html.
|
81
|
+
The href of the button to launch the modal must matche the id of the modal dialog.
|
82
|
+
|
83
|
+
```ruby
|
84
|
+
<%= content_tag :a, "Modal", :href => "#modal", :class => 'btn', :data => {:toggle => modal'} %>
|
85
|
+
|
86
|
+
<%= modal_dialog :id => "modal",
|
87
|
+
:header => { :show_close => true, :dismiss => 'modal', :title => 'Modal header' },
|
88
|
+
:body => 'This is the body',
|
89
|
+
:footer => content_tag(:button, 'Save', :class => 'btn') %>
|
90
|
+
```
|
91
|
+
|
92
|
+
### Breadcrumbs Helpers
|
93
|
+
|
94
|
+
*Notice* If your application is using [breadcrumbs-on-rails](https://github.com/weppos/breadcrumbs_on_rails) you will have a namespace collision with the add_breadcrumb method.
|
95
|
+
You do not need to use these breadcrumb gems since this gem provides the same functionality out of the box without the additional dependency.
|
96
|
+
|
97
|
+
Add breadcrumbs helper `<%= render_breadcrumbs %>` to your layout.
|
98
|
+
|
99
|
+
```ruby
|
100
|
+
class ApplicationController
|
101
|
+
add_breadcrumb :index, :root_path
|
102
|
+
end
|
103
|
+
```
|
104
|
+
|
105
|
+
```ruby
|
106
|
+
class ExamplesController < ApplicationController
|
107
|
+
add_breadcrumb :index, :examples_path
|
108
|
+
|
109
|
+
def index
|
110
|
+
end
|
111
|
+
|
112
|
+
def show
|
113
|
+
@example = Example.find params[:id]
|
114
|
+
add_breadcrumb @example.name, example_path(@example)
|
115
|
+
# add_breadcrumb :show, example_path(@example)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
```
|
119
|
+
|
120
|
+
### Glyp Helper
|
121
|
+
|
122
|
+
```ruby
|
123
|
+
glyph(:share_alt)
|
124
|
+
# => <i class="icon-share-alt"></i>
|
125
|
+
glyph(:lock, :white)
|
126
|
+
# => <i class="icon-lock icon-white"></i>
|
127
|
+
```
|
79
128
|
|
80
129
|
## Contributing
|
81
130
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module GlyphHelper
|
2
|
+
# ==== Examples
|
3
|
+
# glyph(:share_alt)
|
4
|
+
# # => <i class="icon-share-alt"></i>
|
5
|
+
# glyph(:lock, :white)
|
6
|
+
# # => <i class="icon-lock icon-white"></i>
|
7
|
+
|
8
|
+
def glyph(*names)
|
9
|
+
content_tag :i, nil, :class => names.map{|name| "icon-#{name.to_s.gsub('_','-')}" }
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
module ModalHelper
|
2
|
+
|
3
|
+
#modals have a header, a body, a footer for options.
|
4
|
+
def modal_dialog(options = {}, &block)
|
5
|
+
content_tag :div, :id => options[:id], :class => "bootstrap-modal modal hide fade" do
|
6
|
+
modal_header(options[:header]) +
|
7
|
+
modal_body(options[:body]) +
|
8
|
+
modal_footer(options[:footer])
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def modal_header(options = {}, &block)
|
13
|
+
content_tag :div, :class => 'modal-header' do
|
14
|
+
if options[:show_close]
|
15
|
+
close_button(options[:dismiss]) +
|
16
|
+
content_tag(:h3, options[:title], &block)
|
17
|
+
else
|
18
|
+
content_tag(:h3, options[:title], &block)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def modal_body(options = {}, &block)
|
24
|
+
content_tag :div, options, :class => 'modal-body', &block
|
25
|
+
end
|
26
|
+
|
27
|
+
def modal_footer(options = {}, &block)
|
28
|
+
content_tag :div, options, :class => 'modal-footer', &block
|
29
|
+
end
|
30
|
+
|
31
|
+
def close_button(dismiss)
|
32
|
+
#It doesn't seem to like content_tag, so we do this instead.
|
33
|
+
raw("<button class=\"close\" data-dismiss=\"#{dismiss}\">×</button>")
|
34
|
+
end
|
35
|
+
|
36
|
+
def modal_toggle(content_or_options = nil, options = {}, &block)
|
37
|
+
if block_given?
|
38
|
+
options = content_or_options if content_or_options.is_a?(Hash)
|
39
|
+
default_options = { :class => 'btn', "data-toggle" => "modal", "href" => options[:dialog] }.merge(options)
|
40
|
+
|
41
|
+
content_tag :a, nil, default_options, true, &block
|
42
|
+
else
|
43
|
+
default_options = { :class => 'btn', "data-toggle" => "modal", "href" => options[:dialog] }.merge(options)
|
44
|
+
content_tag :a, content_or_options, default_options, true
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def modal_cancel_button content, options = {}
|
49
|
+
default_options = { :class => "btn bootstrap-modal-cancel-button" }
|
50
|
+
|
51
|
+
content_tag_string "a", content, default_options.merge(options)
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<% if @breadcrumbs.present? %>
|
2
|
+
<ul class="breadcrumb">
|
3
|
+
<% separator = divider %>
|
4
|
+
<% @breadcrumbs[0..-2].each do |crumb| %>
|
5
|
+
<li>
|
6
|
+
<%= link_to crumb[:name], crumb[:url], crumb[:options] %>
|
7
|
+
<span class="divider"><%= separator %></span>
|
8
|
+
</li>
|
9
|
+
<% end %>
|
10
|
+
<li class="active">
|
11
|
+
<%= @breadcrumbs.last[:name] %>
|
12
|
+
</li>
|
13
|
+
</ul>
|
14
|
+
<% end %>
|
@@ -3,6 +3,9 @@ module BootstrapSassExtras
|
|
3
3
|
initializer 'bootstrap-sass-extras.setup_helpers' do |app|
|
4
4
|
app.config.to_prepare do
|
5
5
|
ActionController::Base.send :helper, BootstrapFlashHelper
|
6
|
+
ActionController::Base.send :helper, GlyphHelper
|
7
|
+
ActionController::Base.send :helper, ModalHelper
|
8
|
+
ActionController::Base.send :helper, TwitterBreadcrumbsHelper
|
6
9
|
end
|
7
10
|
end
|
8
11
|
end
|
@@ -16,19 +16,19 @@
|
|
16
16
|
|
17
17
|
<!-- For third-generation iPad with high-resolution Retina display: -->
|
18
18
|
<!-- Size should be 144 x 144 pixels -->
|
19
|
-
<%%= favicon_link_tag '
|
19
|
+
<%%= favicon_link_tag 'apple-touch-icon-144x144-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '144x144' %>
|
20
20
|
|
21
21
|
<!-- For iPhone with high-resolution Retina display: -->
|
22
22
|
<!-- Size should be 114 x 114 pixels -->
|
23
|
-
<%%= favicon_link_tag '
|
23
|
+
<%%= favicon_link_tag 'apple-touch-icon-114x114-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '114x114' %>
|
24
24
|
|
25
25
|
<!-- For first- and second-generation iPad: -->
|
26
26
|
<!-- Size should be 72 x 72 pixels -->
|
27
|
-
<%%= favicon_link_tag '
|
27
|
+
<%%= favicon_link_tag 'apple-touch-icon-72x72-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '72x72' %>
|
28
28
|
|
29
29
|
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
|
30
30
|
<!-- Size should be 57 x 57 pixels -->
|
31
|
-
<%%= favicon_link_tag '
|
31
|
+
<%%= favicon_link_tag 'apple-touch-icon-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png' %>
|
32
32
|
|
33
33
|
<!-- For all other devices -->
|
34
34
|
<!-- Size should be 32 x 32 pixels -->
|
@@ -10,11 +10,11 @@
|
|
10
10
|
/[if lt IE 9]
|
11
11
|
= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js"
|
12
12
|
= stylesheet_link_tag "application", :media => "all"
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
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
18
|
|
19
19
|
|
20
20
|
%body
|
@@ -11,11 +11,13 @@ html lang="en"
|
|
11
11
|
/[if lt IE 9]
|
12
12
|
= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js"
|
13
13
|
= stylesheet_link_tag "application", :media => "all"
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
+
|
20
|
+
|
19
21
|
|
20
22
|
body
|
21
23
|
.navbar.navbar-<%= layout_type %>-top
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%%- model_class = <%= resource_name.classify %> -%>
|
2
2
|
<div class="page-header">
|
3
|
-
<h1><%%=t '.title', :default => [:'helpers.titles.edit', 'Edit %{model}'], :model => model_class.model_name.human %></h1>
|
3
|
+
<h1><%%=t '.title', :default => [:'helpers.titles.edit', 'Edit %{model}'], :model => model_class.model_name.human.titleize %></h1>
|
4
4
|
</div>
|
5
5
|
<%%= render :partial => 'form' %>
|
@@ -1,4 +1,4 @@
|
|
1
1
|
- model_class = <%= resource_name.classify %>
|
2
2
|
.page-header
|
3
|
-
%h1=t '.title', :default => [:'helpers.titles.edit', 'Edit %{model}'], :model => model_class.model_name.human
|
3
|
+
%h1=t '.title', :default => [:'helpers.titles.edit', 'Edit %{model}'], :model => model_class.model_name.human.titleize
|
4
4
|
= render :partial => "form"
|
@@ -1,4 +1,4 @@
|
|
1
1
|
- model_class = <%= resource_name.classify %>
|
2
2
|
div class="page-header"
|
3
|
-
h1=t '.title', :default => [:'helpers.titles.edit', 'Edit %{model}'], :model => model_class.model_name.human
|
3
|
+
h1=t '.title', :default => [:'helpers.titles.edit', 'Edit %{model}'], :model => model_class.model_name.human.titleize
|
4
4
|
= render :partial => "form"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%%- model_class = <%= resource_name.classify %> -%>
|
2
2
|
<div class="page-header">
|
3
|
-
<h1><%%=t '.title', :default => model_class.model_name.human.pluralize %></h1>
|
3
|
+
<h1><%%=t '.title', :default => model_class.model_name.human.pluralize.titleize %></h1>
|
4
4
|
</div>
|
5
5
|
<table class="table table-striped">
|
6
6
|
<thead>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%%- model_class = <%= resource_name.classify %> -%>
|
2
2
|
<div class="page-header">
|
3
|
-
<h1><%%=t '.title', :default => [:'helpers.titles.new', 'New %{model}'], :model => model_class.model_name.human %></h1>
|
3
|
+
<h1><%%=t '.title', :default => [:'helpers.titles.new', 'New %{model}'], :model => model_class.model_name.human.titleize %></h1>
|
4
4
|
</div>
|
5
5
|
<%%= render :partial => 'form' %>
|
@@ -1,4 +1,4 @@
|
|
1
1
|
- model_class = <%= resource_name.classify %>
|
2
2
|
.page-header
|
3
|
-
%h1=t '.title', :default => [:'helpers.titles.new', 'New %{model}'], :model => model_class.model_name.human
|
3
|
+
%h1=t '.title', :default => [:'helpers.titles.new', 'New %{model}'], :model => model_class.model_name.human.titleize
|
4
4
|
= render :partial => "form"
|
@@ -1,4 +1,4 @@
|
|
1
1
|
- model_class = <%= resource_name.classify %>
|
2
2
|
div class="page-header"
|
3
|
-
h1=t '.title', :default => [:'helpers.titles.new', 'New %{model}'], :model => model_class.model_name.human
|
3
|
+
h1=t '.title', :default => [:'helpers.titles.new', 'New %{model}'], :model => model_class.model_name.human.titleize
|
4
4
|
= render :partial => "form"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%%- model_class = <%= resource_name.classify %> -%>
|
2
2
|
<div class="page-header">
|
3
|
-
<h1><%%=t '.title', :default => model_class.model_name.human %></h1>
|
3
|
+
<h1><%%=t '.title', :default => model_class.model_name.human.titleize %></h1>
|
4
4
|
</div>
|
5
5
|
|
6
6
|
<dl class="dl-horizontal">
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap-sass-extras
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- doabit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -61,20 +61,22 @@ extra_rdoc_files: []
|
|
61
61
|
files:
|
62
62
|
- .gitignore
|
63
63
|
- .rspec
|
64
|
+
- CHANGELOG.md
|
64
65
|
- Gemfile
|
65
66
|
- Gemfile.lock
|
66
67
|
- MIT-LICENSE
|
67
68
|
- README.md
|
68
69
|
- Rakefile
|
69
70
|
- app/helpers/bootstrap_flash_helper.rb
|
71
|
+
- app/helpers/glyph_helper.rb
|
72
|
+
- app/helpers/modal_helper.rb
|
73
|
+
- app/helpers/twitter_breadcrumbs_helper.rb
|
74
|
+
- app/views/twitter-bootstrap/_breadcrumbs.html.erb
|
70
75
|
- bootstrap-sass-extras.gemspec
|
71
|
-
- lib/.DS_Store
|
72
76
|
- lib/bootstrap-sass-extras.rb
|
73
77
|
- lib/bootstrap-sass-extras/engine.rb
|
74
78
|
- lib/bootstrap-sass-extras/version.rb
|
75
|
-
- lib/generators/.DS_Store
|
76
79
|
- lib/generators/bootstrap/install/install_generator.rb
|
77
|
-
- lib/generators/bootstrap/install/templates/.DS_Store
|
78
80
|
- lib/generators/bootstrap/install/templates/en.bootstrap.yml
|
79
81
|
- lib/generators/bootstrap/layout/layout_generator.rb
|
80
82
|
- lib/generators/bootstrap/layout/templates/layout.html.erb
|
data/lib/.DS_Store
DELETED
Binary file
|
data/lib/generators/.DS_Store
DELETED
Binary file
|
Binary file
|