bootstrap_leather 0.7.4 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4eaa2097f1ea327eba0b944d0cd9c5a01b07ec72
4
- data.tar.gz: f6c8f59898bb520373e56ac0ccad3db99e782557
3
+ metadata.gz: 588360d05f709833409bb8085c86d5e96c9cbb7e
4
+ data.tar.gz: 5de93d2209be609da4f91123ae2da25d4bdd7a8f
5
5
  SHA512:
6
- metadata.gz: 367329f9fc6b8cf0f8c6ba635447b0c56e28b77263bbbde87e568e1f75861dcb4c9186159995dd0dd67660dc2c3b375ec975e2b4632a1bef4c24958873e56581
7
- data.tar.gz: 0600f73e045e6bed618e9ba5494d2852662620db22a5c239f7f10bf00e327a0c9ac0239483cddfc38a326e77a6257d4b8c2190ebe51daa451bea2e1e1105b905
6
+ metadata.gz: 52d29edd6b702d0d8025319c85cbd3422eee078946f256123f760732d3668fb1885af2cb06bff42f803c99b96ce501c066d5b3400bc474b008abcd24dd71cfb8
7
+ data.tar.gz: 751504ad5f253a7bd0dce0f5d92ed47c3897f9354ecd4489eb04858397bd2dfd35fc7efdca0433ce24b978ad1e5d575c86421963bf72a4d7edffc9e4add0ada4
data/README.rdoc CHANGED
@@ -84,7 +84,7 @@ To render the ones you have saved up:
84
84
  = render_widgets 'md', 3
85
85
 
86
86
  === Modals
87
- = modal 'Title of the modal here.' do
87
+ = modal 'css-id', 'Title of the modal here.' do
88
88
  %p Lorem ipsum, baby.
89
89
 
90
90
  === Badges and Labels
@@ -130,6 +130,24 @@ First, add them all, then render them.
130
130
  %p Yep, tab contents go inside.
131
131
  = render_tabs 'left'
132
132
 
133
+ === Carousel
134
+
135
+ Pass in an id string, items and a block for each slide:
136
+ = carousel 'css-id-for-carousel', @items do |item|
137
+ .carousel-caption
138
+ %h3= item.title
139
+ %p= item.description
140
+ = image_tag item.image.url(:large)
141
+
142
+ === Carousel with Thumbnails
143
+
144
+ Pass in an id string, items and a block for each slide:
145
+ = carousel_with_thumbnails 'css-id-for-carousel', @items do |item|
146
+ .carousel-caption
147
+ %h3= item.title
148
+ %p= item.description
149
+ = image_tag item.image.url(:large), data: { thumbnail: item.image.url(:thumb) }
150
+
133
151
  === Thumbnail
134
152
 
135
153
  = thumbnail link_to image_tag(image_url), path
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.4
1
+ 0.8.0
@@ -70,8 +70,8 @@ module BootstrapLeatherHelper
70
70
  render(:partial => 'bootstrap_leather/alert_flash_messages', :locals => {:html_options => html_options})
71
71
  end
72
72
 
73
- def modal(title = '', close_text = 'Close', html_options = {}, &block)
74
- render(:partial => 'bootstrap_leather/modal', :locals => {:close_text => close_text, :title => title, :block => capture(&block), :html_options => html_options})
73
+ def modal(id, title = '', close_text = 'Close', html_options = {}, &block)
74
+ render(:partial => 'bootstrap_leather/modal', :locals => {:id => id, :close_text => close_text, :title => title, :block => capture(&block), :html_options => html_options})
75
75
  end
76
76
 
77
77
  def nav_item(text, href, options = {})
@@ -201,6 +201,20 @@ module BootstrapLeatherHelper
201
201
  render(:partial => 'bootstrap_leather/definition_list', :locals => {:list => list, :html_options => html_options})
202
202
  end
203
203
 
204
+ def carousel(id, items, html_options = {}, &block)
205
+ html_options[:id] = id
206
+ html_options[:data] ||= {}
207
+ html_options[:data][:ride] = 'carousel'
208
+ render(:partial => 'bootstrap_leather/carousel', :locals => { :id => id, :slides => items.collect { |item| capture(item, &block) }, :html_options => html_options })
209
+ end
210
+
211
+ def carousel_with_thumbnails(id, items, html_options = {}, &block)
212
+ html_options[:id] = id
213
+ html_options[:data] ||= {}
214
+ html_options[:data][:ride] = 'carousel'
215
+ render(:partial => 'bootstrap_leather/carousel_with_thumbnails', :locals => { :id => id, :slides => items.collect { |item| capture(item, &block) }, :html_options => html_options })
216
+ end
217
+
204
218
 
205
219
  alias_method :dl, :definition_list
206
220
  alias_method :nav_bar, :navbar
@@ -0,0 +1,27 @@
1
+ .carousel.slide{ html_options }
2
+ - if slides.count >= 2
3
+ -# Indicators
4
+ %ol.carousel-indicators
5
+ - slides.each_with_index do |slide, index|
6
+ %li{data: { target: '#' + id, slide_to: index }}
7
+
8
+ -# Wrapper for slides
9
+ .carousel-inner{ role: 'listbox' }
10
+ - slides.each_with_index do |slide, index|
11
+ %div{ class: (index == 0) ? 'item active' : 'item' }
12
+ = slide
13
+
14
+ - if slides.count >= 2
15
+ -# Controls
16
+ %a.left.carousel-control{ href: '#' + id, role: 'button', data: { slide: 'prev' } }
17
+ = icon 'chevron-left'
18
+ .sr-only Previous
19
+ %a.right.carousel-control{ href: '#' + id, role: 'button', data: { slide: 'next' } }
20
+ = icon 'chevron-right'
21
+ .sr-only Next
22
+
23
+ - add_footer_javascript do
24
+ :javascript
25
+ $(function() {
26
+ $('##{id}.carousel').carousel();
27
+ });
@@ -0,0 +1,73 @@
1
+ .carousel.carousel-with-thumbnails.slide.thumbnail{ html_options }
2
+ .carousel-outer
3
+ -# Wrapper for slides
4
+ .carousel-inner{ role: 'listbox' }
5
+ - slides.each_with_index do |slide, index|
6
+ %div{ class: (index == 0) ? 'item active' : 'item' }
7
+ = slide
8
+
9
+ - if slides.count >= 2
10
+ -# Controls
11
+ %a.left.carousel-control{ href: '#' + id, role: 'button', data: { slide: 'prev' } }
12
+ = icon 'chevron-left'
13
+ .sr-only Previous
14
+ %a.right.carousel-control{ href: '#' + id, role: 'button', data: { slide: 'next' } }
15
+ = icon 'chevron-right'
16
+ .sr-only Next
17
+
18
+ - if slides.count >= 2
19
+ -# Indicators
20
+ %ol.carousel-indicators
21
+ - slides.each_with_index do |slide, index|
22
+ %li{data: { target: '#' + id, slide_to: index }, class: (index == 0) ? 'active' : ''}
23
+
24
+ - add_footer_javascript do
25
+ :javascript
26
+ $(function() {
27
+ $('##{id} .carousel-indicators li').each(function(index){
28
+ var thumbnail_src = $('##{id} .carousel-inner').children('.item').eq(index).find('img').data('thumbnail');
29
+ if(typeof thumbnail_src !== 'undefined') {
30
+ $(this).html('<img src="' + thumbnail_src + '" class="thumbnail">');
31
+ }
32
+ });
33
+ });
34
+
35
+ - add_head_css do
36
+ :css
37
+ .carousel-with-thumbnails {
38
+ margin: 20px auto;
39
+ width: 400px;
40
+ }
41
+ .carousel-with-thumbnails .carousel-indicators {
42
+ margin: 10px 0 0;
43
+ overflow: auto;
44
+ position: static;
45
+ text-align: left;
46
+ white-space: nowrap;
47
+ width: 100%;
48
+ }
49
+ .carousel-with-thumbnails .carousel-indicators li {
50
+ background-color: transparent;
51
+ -webkit-border-radius: 0;
52
+ border-radius: 0;
53
+ display: inline-block;
54
+ height: auto;
55
+ margin: 0 !important;
56
+ width: auto;
57
+ }
58
+ .carousel-with-thumbnails .carousel-indicators li img {
59
+ display: block;
60
+ opacity: 0.5;
61
+ }
62
+ .carousel-with-thumbnails .carousel-indicators li img.thumbnail {
63
+ margin-bottom: 0;
64
+ }
65
+ .carousel-with-thumbnails .carousel-indicators li.active img {
66
+ opacity: 1;
67
+ }
68
+ .carousel-with-thumbnails .carousel-indicators li:hover img {
69
+ opacity: 0.75;
70
+ }
71
+ .carousel-with-thumbnails .carousel-outer {
72
+ position: relative;
73
+ }
@@ -1,8 +1,10 @@
1
- #modal.modal.hide.fade{:tabindex => -1, :role => 'dialog', :aria => {:labelledby => 'modalLabel', :hidden => true}}
2
- .modal-header
3
- %button.close{:type => 'button', :data => {:dismiss => 'modal'}, :aria => {:hidden => true}}= 'x'
4
- %h3#modalLabel= title
5
- #modal-body.modal-body
6
- = block
7
- .modal-footer
8
- %button.close{:type => 'button', :data => {:dismiss => 'modal'}, :aria => {:hidden => true}}= close_text
1
+ .modal.fade{:id => id, :tabindex => -1, :role => 'dialog', :aria => {:labelledby => 'modalLabel'}}
2
+ .modal-dialog{:role => 'document'}
3
+ .modal-content
4
+ .modal-header
5
+ %button.close{:type => 'button', :data => {:dismiss => 'modal'}, :aria => {:hidden => true}}= 'x'
6
+ %h3#modalLabel= title
7
+ #modal-body.modal-body
8
+ = block
9
+ .modal-footer
10
+ %button.close{:type => 'button', :data => {:dismiss => 'modal'}, :aria => {:hidden => true}}= close_text
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: bootstrap_leather 0.7.4 ruby lib
5
+ # stub: bootstrap_leather 0.8.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "bootstrap_leather"
9
- s.version = "0.7.4"
9
+ s.version = "0.8.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Karen Lundgren"]
14
- s.date = "2015-06-24"
14
+ s.date = "2015-06-30"
15
15
  s.description = "BootstrapLeather is a collection of view helpers that makes it easier to create apps using Twitter Bootstrap"
16
16
  s.email = "karen.e.lundgren@gmail.com"
17
17
  s.extra_rdoc_files = [
@@ -31,6 +31,8 @@ Gem::Specification.new do |s|
31
31
  "app/views/bootstrap_leather/_alert_flash_messages.html.haml",
32
32
  "app/views/bootstrap_leather/_badge.html.haml",
33
33
  "app/views/bootstrap_leather/_badge_to.html.haml",
34
+ "app/views/bootstrap_leather/_carousel.html.haml",
35
+ "app/views/bootstrap_leather/_carousel_with_thumbnails.html.haml",
34
36
  "app/views/bootstrap_leather/_definition_list.html.haml",
35
37
  "app/views/bootstrap_leather/_dropdown_nav_item.html.haml",
36
38
  "app/views/bootstrap_leather/_footer_javascript.html.haml",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap_leather
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karen Lundgren
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-24 00:00:00.000000000 Z
11
+ date: 2015-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap-sass
@@ -87,6 +87,8 @@ files:
87
87
  - app/views/bootstrap_leather/_alert_flash_messages.html.haml
88
88
  - app/views/bootstrap_leather/_badge.html.haml
89
89
  - app/views/bootstrap_leather/_badge_to.html.haml
90
+ - app/views/bootstrap_leather/_carousel.html.haml
91
+ - app/views/bootstrap_leather/_carousel_with_thumbnails.html.haml
90
92
  - app/views/bootstrap_leather/_definition_list.html.haml
91
93
  - app/views/bootstrap_leather/_dropdown_nav_item.html.haml
92
94
  - app/views/bootstrap_leather/_footer_javascript.html.haml