will_paginate_twitter_bootstrap 1.0.0
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.
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module WillPaginateTwitterBootstrap
|
2
|
+
class Railtie < Rails::Railtie
|
3
|
+
initializer "will_paginate_twitter_bootstrap.configure_will_paginate" do
|
4
|
+
require 'will_paginate/view_helpers/link_renderer'
|
5
|
+
require 'will_paginate/view_helpers/action_view'
|
6
|
+
|
7
|
+
module ::WillPaginate
|
8
|
+
module ActionView
|
9
|
+
def will_paginate(collection = nil, options = {})
|
10
|
+
options[:renderer] ||= BootstrapLinkRenderer
|
11
|
+
super.try :html_safe
|
12
|
+
end
|
13
|
+
|
14
|
+
class BootstrapLinkRenderer < LinkRenderer
|
15
|
+
protected
|
16
|
+
|
17
|
+
def html_container(html)
|
18
|
+
tag :div, tag(:ul, html), container_attributes
|
19
|
+
end
|
20
|
+
|
21
|
+
def page_number(page)
|
22
|
+
tag :li, link(page, page, :rel => rel_value(page)), :class => ('active' if page == current_page)
|
23
|
+
end
|
24
|
+
|
25
|
+
def previous_or_next_page(page, text, classname)
|
26
|
+
tag :li, link(text, page || '#'), :class => [classname[0..3], classname, ('disabled' unless page)].join(' ')
|
27
|
+
end
|
28
|
+
|
29
|
+
def gap
|
30
|
+
tag :li, link(super, '#'), :class => 'disabled'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "will_paginate_twitter_bootstrap/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "will_paginate_twitter_bootstrap"
|
7
|
+
s.version = WillPaginateTwitterBootstrap::VERSION
|
8
|
+
s.authors = ["Travis Jeffery"]
|
9
|
+
s.email = ["[email protected]"]
|
10
|
+
s.homepage = ""
|
11
|
+
s.summary = %q{Make will_paginate and Bootstrap, from Twitter work together.}
|
12
|
+
s.description = %q{Make will_paginate and Bootstrap, from Twitter work together.}
|
13
|
+
|
14
|
+
s.rubyforge_project = "will_paginate_twitter_bootstrap"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
s.add_runtime_dependency "will_paginate", "> 3.0"
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: will_paginate_twitter_bootstrap
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Travis Jeffery
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-01-11 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: will_paginate
|
16
|
+
requirement: &70237023695040 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>'
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70237023695040
|
25
|
+
description: Make will_paginate and Bootstrap, from Twitter work together.
|
26
|
+
email:
|
27
|
|
28
|
+
executables: []
|
29
|
+
extensions: []
|
30
|
+
extra_rdoc_files: []
|
31
|
+
files:
|
32
|
+
- .gitignore
|
33
|
+
- Gemfile
|
34
|
+
- Rakefile
|
35
|
+
- lib/will_paginate_twitter_bootstrap.rb
|
36
|
+
- lib/will_paginate_twitter_bootstrap/railtie.rb
|
37
|
+
- lib/will_paginate_twitter_bootstrap/version.rb
|
38
|
+
- will_paginate_twitter_bootstrap.gemspec
|
39
|
+
homepage: ''
|
40
|
+
licenses: []
|
41
|
+
post_install_message:
|
42
|
+
rdoc_options: []
|
43
|
+
require_paths:
|
44
|
+
- lib
|
45
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
46
|
+
none: false
|
47
|
+
requirements:
|
48
|
+
- - ! '>='
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0'
|
51
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ! '>='
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
requirements: []
|
58
|
+
rubyforge_project: will_paginate_twitter_bootstrap
|
59
|
+
rubygems_version: 1.8.10
|
60
|
+
signing_key:
|
61
|
+
specification_version: 3
|
62
|
+
summary: Make will_paginate and Bootstrap, from Twitter work together.
|
63
|
+
test_files: []
|