kaminari-bootstrap3 0.1.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.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +3 -0
- data/Gemfile +4 -0
- data/README.md +41 -0
- data/Rakefile +7 -0
- data/app/views/kaminari/bootstrap/_first_page.html.erb +11 -0
- data/app/views/kaminari/bootstrap/_gap.html.erb +11 -0
- data/app/views/kaminari/bootstrap/_last_page.html.erb +11 -0
- data/app/views/kaminari/bootstrap/_next_page.html.erb +11 -0
- data/app/views/kaminari/bootstrap/_page.html.erb +17 -0
- data/app/views/kaminari/bootstrap/_paginator.html.erb +23 -0
- data/app/views/kaminari/bootstrap/_prev_page.html.erb +11 -0
- data/kaminari_bootstrap_paginator.gemspec +26 -0
- data/lib/kaminari/bootstrap3.rb +9 -0
- data/lib/kaminari/bootstrap3/engine.rb +6 -0
- data/lib/kaminari/bootstrap3/version.rb +5 -0
- metadata +144 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c3187bb0a9a6ef0d1926bc2f9fbab8375c3fe9e7
|
4
|
+
data.tar.gz: bea8cabb3645a38cbef7008d6641acba5f9c3a9f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 88adf71a9729605fdab2d0b139cb399e0464aaf48f5e32dd449839a40cfb2d83701e6de7ec2fbd03ddcb72532bc9efd69a26b85367f9ff34080e40dc1b391dcf
|
7
|
+
data.tar.gz: 43a28261d586be960b8c414ab135d20e179c9d98f5fb833f8139c8288d1d21460045a5535f6101ac54976cfa816d8d4fa1567fa2180438a0b821ffd2313358be
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# Kaminari::Bootstrap3
|
2
|
+
|
3
|
+
This gem integrates the [Twitter Bootstrap](http://twitter.github.com/bootstrap/) [pagination component](http://twitter.github.com/bootstrap/components.html#pagination) with the [kaminari](https://github.com/amatsuda/kaminari) pagination gem.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'kaminari-bootstrap3'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install kaminari-bootstrap3
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
This gem provides a bootstrap 3-ready theme. In your views, reference the `bootstrap` theme when calling the `paginate` helper:
|
24
|
+
|
25
|
+
```erb
|
26
|
+
<%= paginate @users, theme: 'bootstrap' %>
|
27
|
+
```
|
28
|
+
|
29
|
+
## Development
|
30
|
+
|
31
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
32
|
+
|
33
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
34
|
+
|
35
|
+
## Contributing
|
36
|
+
|
37
|
+
1. Fork it ( https://github.com/cbeer/kaminari-bootstrap3/fork )
|
38
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
39
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
40
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
41
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
<%# Link to the "First" page
|
2
|
+
- available local variables
|
3
|
+
url: url to the first page
|
4
|
+
current_page: a page object for the currently displayed page
|
5
|
+
num_pages: total number of pages
|
6
|
+
per_page: number of items to fetch per page
|
7
|
+
remote: data-remote
|
8
|
+
-%>
|
9
|
+
<li class="<%= 'disabled' if current_page.first? %>">
|
10
|
+
<%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote %>
|
11
|
+
</li>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%# Non-link tag that stands for skipped pages...
|
2
|
+
- available local variables
|
3
|
+
current_page: a page object for the currently displayed page
|
4
|
+
num_pages: total number of pages
|
5
|
+
per_page: number of items to fetch per page
|
6
|
+
remote: data-remote
|
7
|
+
-%>
|
8
|
+
<li class="disabled">
|
9
|
+
<span><%= raw(t 'views.pagination.truncate') %></span>
|
10
|
+
</li>
|
11
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%# Link to the "Last" page
|
2
|
+
- available local variables
|
3
|
+
url: url to the last page
|
4
|
+
current_page: a page object for the currently displayed page
|
5
|
+
num_pages: total number of pages
|
6
|
+
per_page: number of items to fetch per page
|
7
|
+
remote: data-remote
|
8
|
+
-%>
|
9
|
+
<li class="<%= 'disabled' if current_page.last? %>">
|
10
|
+
<%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} %>
|
11
|
+
</li>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%# Link to the "Next" page
|
2
|
+
- available local variables
|
3
|
+
url: url to the next page
|
4
|
+
current_page: a page object for the currently displayed page
|
5
|
+
num_pages: total number of pages
|
6
|
+
per_page: number of items to fetch per page
|
7
|
+
remote: data-remote
|
8
|
+
-%>
|
9
|
+
<li class="<%= 'disabled' if current_page.last? %>">
|
10
|
+
<%= link_to raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote %>
|
11
|
+
</li>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%# Link showing page number
|
2
|
+
- available local variables
|
3
|
+
page: a page object for "this" page
|
4
|
+
url: url to this page
|
5
|
+
current_page: a page object for the currently displayed page
|
6
|
+
num_pages: total number of pages
|
7
|
+
per_page: number of items to fetch per page
|
8
|
+
remote: data-remote
|
9
|
+
-%>
|
10
|
+
<li class="<%= 'active' if page.current? %>">
|
11
|
+
<% if page.current? %>
|
12
|
+
<span><%= number_with_delimiter(page.to_s) %></span>
|
13
|
+
<% else %>
|
14
|
+
<%= link_to number_with_delimiter(page.to_s), url, opts = {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
|
15
|
+
<% end %>
|
16
|
+
</li>
|
17
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%# The container tag
|
2
|
+
- available local variables
|
3
|
+
current_page: a page object for the currently displayed page
|
4
|
+
num_pages: total number of pages
|
5
|
+
per_page: number of items to fetch per page
|
6
|
+
remote: data-remote
|
7
|
+
paginator: the paginator that renders the pagination tags inside
|
8
|
+
|
9
|
+
Paginator now using the Bootstrap paginator class
|
10
|
+
-%>
|
11
|
+
<%= paginator.render do -%>
|
12
|
+
<ul class="pagination">
|
13
|
+
<%= prev_page_tag %>
|
14
|
+
<%= next_page_tag %>
|
15
|
+
<% each_relevant_page do |page| -%>
|
16
|
+
<% if page.left_outer? || page.right_outer? || page.inside_window? -%>
|
17
|
+
<%= page_tag page %>
|
18
|
+
<% elsif !page.was_truncated? -%>
|
19
|
+
<%= gap_tag %>
|
20
|
+
<% end -%>
|
21
|
+
<% end -%>
|
22
|
+
</ul>
|
23
|
+
<% end -%>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%# Link to the "Previous" page
|
2
|
+
- available local variables
|
3
|
+
url: url to the previous page
|
4
|
+
current_page: a page object for the currently displayed page
|
5
|
+
num_pages: total number of pages
|
6
|
+
per_page: number of items to fetch per page
|
7
|
+
remote: data-remote
|
8
|
+
-%>
|
9
|
+
<li class="<%= 'disabled' if current_page.first? %>">
|
10
|
+
<%= link_to raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote %>
|
11
|
+
</li>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'kaminari/bootstrap3/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'kaminari-bootstrap3'
|
8
|
+
spec.version = Kaminari::Bootstrap3::VERSION
|
9
|
+
spec.authors = ['Chris Beer']
|
10
|
+
spec.email = ['cabeer@stanford.edu']
|
11
|
+
|
12
|
+
spec.summary = 'Bootstrap styles for kaminari'
|
13
|
+
|
14
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
15
|
+
spec.bindir = 'exe'
|
16
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
17
|
+
spec.require_paths = ['lib']
|
18
|
+
|
19
|
+
spec.add_dependency 'rails'
|
20
|
+
spec.add_dependency 'kaminari'
|
21
|
+
|
22
|
+
spec.add_development_dependency 'bundler', '~> 1.9'
|
23
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
24
|
+
spec.add_development_dependency 'rspec-rails', '~> 3.0'
|
25
|
+
spec.add_development_dependency 'capybara'
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,144 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: kaminari-bootstrap3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Chris Beer
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-05-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: kaminari
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.9'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.9'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec-rails
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: capybara
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description:
|
98
|
+
email:
|
99
|
+
- cabeer@stanford.edu
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- ".gitignore"
|
105
|
+
- ".rspec"
|
106
|
+
- ".travis.yml"
|
107
|
+
- Gemfile
|
108
|
+
- README.md
|
109
|
+
- Rakefile
|
110
|
+
- app/views/kaminari/bootstrap/_first_page.html.erb
|
111
|
+
- app/views/kaminari/bootstrap/_gap.html.erb
|
112
|
+
- app/views/kaminari/bootstrap/_last_page.html.erb
|
113
|
+
- app/views/kaminari/bootstrap/_next_page.html.erb
|
114
|
+
- app/views/kaminari/bootstrap/_page.html.erb
|
115
|
+
- app/views/kaminari/bootstrap/_paginator.html.erb
|
116
|
+
- app/views/kaminari/bootstrap/_prev_page.html.erb
|
117
|
+
- kaminari_bootstrap_paginator.gemspec
|
118
|
+
- lib/kaminari/bootstrap3.rb
|
119
|
+
- lib/kaminari/bootstrap3/engine.rb
|
120
|
+
- lib/kaminari/bootstrap3/version.rb
|
121
|
+
homepage:
|
122
|
+
licenses: []
|
123
|
+
metadata: {}
|
124
|
+
post_install_message:
|
125
|
+
rdoc_options: []
|
126
|
+
require_paths:
|
127
|
+
- lib
|
128
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - ">="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
requirements: []
|
139
|
+
rubyforge_project:
|
140
|
+
rubygems_version: 2.4.5
|
141
|
+
signing_key:
|
142
|
+
specification_version: 4
|
143
|
+
summary: Bootstrap styles for kaminari
|
144
|
+
test_files: []
|