bootstrap-will_paginate 0.0.1
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 +4 -0
- data/Gemfile +4 -0
- data/README.markdown +17 -0
- data/Rakefile +1 -0
- data/bootstrap-will_paginate.gemspec +21 -0
- data/config/initializers/will_paginate.rb +29 -0
- data/lib/bootstrap-will_paginate.rb +8 -0
- data/lib/bootstrap-will_paginate/version.rb +5 -0
- metadata +65 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.markdown
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# [Will Paginate][wp] link renderer styles for [Twitter Bootstrap][bs]
|
2
|
+
|
3
|
+
Rails Engine that extends [will_paginate][wp] stylings to match the pagination styling conventions
|
4
|
+
in Twitter's [Bootstrap][bs] toolkit.
|
5
|
+
|
6
|
+
The real hard work done on the renderer initializer was written by [Isaac Bowen][is].
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add to your Gemfile:
|
11
|
+
gem 'bootstrap-will_paginate'
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
[wp]: http://github.com/mislav/will_paginate
|
16
|
+
[bs]: http://twitter.github.com/bootstrap
|
17
|
+
[is]: http://isaacbowen.com/blog/using-will_paginate-action_view-and-bootstrap
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "bootstrap-will_paginate/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "bootstrap-will_paginate"
|
7
|
+
s.version = Bootstrap::Willpaginate::VERSION
|
8
|
+
s.authors = ["Nicholas Fine"]
|
9
|
+
s.email = ["nicholas.fine@gmail.com"]
|
10
|
+
s.homepage = ""
|
11
|
+
s.summary = %q{Format will_paginate html to match Twitter Bootstrap styling.}
|
12
|
+
s.description = %q{Hooks into will_paginate to format the html to match Twitter Bootstrap styling. Extension code was originally written by Isaac Bowen (http://isaacbowen.com/blog/using-will_paginate-action_view-and-bootstrap).}
|
13
|
+
|
14
|
+
s.rubyforge_project = "bootstrap-will_paginate"
|
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
|
+
s.add_runtime_dependency "will_paginate"
|
21
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# config/initializers/will_paginate.rb
|
2
|
+
#
|
3
|
+
# This extension code was written by Isaac Bowen, originally found
|
4
|
+
# at http://isaacbowen.com/blog/using-will_paginate-action_view-and-bootstrap/
|
5
|
+
|
6
|
+
module WillPaginate
|
7
|
+
module ActionView
|
8
|
+
def will_paginate(collection = nil, options = {})
|
9
|
+
options[:renderer] ||= BootstrapLinkRenderer
|
10
|
+
super.try :html_safe
|
11
|
+
end
|
12
|
+
|
13
|
+
class BootstrapLinkRenderer < LinkRenderer
|
14
|
+
protected
|
15
|
+
|
16
|
+
def html_container(html)
|
17
|
+
tag :div, tag(:ul, html), container_attributes
|
18
|
+
end
|
19
|
+
|
20
|
+
def page_number(page)
|
21
|
+
tag :li, link(page, page, :rel => rel_value(page)), :class => ('active' if page == current_page)
|
22
|
+
end
|
23
|
+
|
24
|
+
def previous_or_next_page(page, text, classname)
|
25
|
+
tag :li, link(text, page || '#'), :class => [classname[0..3], classname, ('disabled' unless page)].join(' ')
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bootstrap-will_paginate
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Nicholas Fine
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-12-17 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: will_paginate
|
16
|
+
requirement: &11584540 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *11584540
|
25
|
+
description: Hooks into will_paginate to format the html to match Twitter Bootstrap
|
26
|
+
styling. Extension code was originally written by Isaac Bowen (http://isaacbowen.com/blog/using-will_paginate-action_view-and-bootstrap).
|
27
|
+
email:
|
28
|
+
- nicholas.fine@gmail.com
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- .gitignore
|
34
|
+
- Gemfile
|
35
|
+
- README.markdown
|
36
|
+
- Rakefile
|
37
|
+
- bootstrap-will_paginate.gemspec
|
38
|
+
- config/initializers/will_paginate.rb
|
39
|
+
- lib/bootstrap-will_paginate.rb
|
40
|
+
- lib/bootstrap-will_paginate/version.rb
|
41
|
+
homepage: ''
|
42
|
+
licenses: []
|
43
|
+
post_install_message:
|
44
|
+
rdoc_options: []
|
45
|
+
require_paths:
|
46
|
+
- lib
|
47
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
48
|
+
none: false
|
49
|
+
requirements:
|
50
|
+
- - ! '>='
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ! '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
requirements: []
|
60
|
+
rubyforge_project: bootstrap-will_paginate
|
61
|
+
rubygems_version: 1.8.6
|
62
|
+
signing_key:
|
63
|
+
specification_version: 3
|
64
|
+
summary: Format will_paginate html to match Twitter Bootstrap styling.
|
65
|
+
test_files: []
|