kaminari-views-bootstrap 0.0.2
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 +46 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +41 -0
- data/Rakefile +2 -0
- data/app/views/kaminari/tb3/_first_page.html.erb +13 -0
- data/app/views/kaminari/tb3/_gap.html.erb +8 -0
- data/app/views/kaminari/tb3/_last_page.html.erb +13 -0
- data/app/views/kaminari/tb3/_next_page.html.erb +13 -0
- data/app/views/kaminari/tb3/_page.html.erb +15 -0
- data/app/views/kaminari/tb3/_paginator.html.erb +27 -0
- data/app/views/kaminari/tb3/_prev_page.html.erb +13 -0
- data/kaminari-views-bootstrap.gemspec +24 -0
- data/lib/kaminari-views-bootstrap.rb +4 -0
- metadata +115 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1ddccc0dfff0500078a7dac1bf5b98071f6987d9
|
4
|
+
data.tar.gz: 68b3ee47f7833dcef671a6bd2203236d718d4d81
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 30e79e638c01fdff61276b4c1226294d44f62a37a0d0157509a30cc32cd981d9c63437974bf2e6b3d962c370b91c8110825eb203706446cdb62eda8ebdf9d1fb
|
7
|
+
data.tar.gz: 29011370e0539d8585baaaaa3fdf9bb1d2fe07b9d216e8e10aac7f0dd719d333b0b3d379f4bca2ad526a99a6f69bdfc97f1493a91c21a2d26a103c359ce0fda7
|
data/.gitignore
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/Gemfile.lock
|
4
|
+
/_yardoc/
|
5
|
+
/coverage/
|
6
|
+
/doc/
|
7
|
+
/pkg/
|
8
|
+
/spec/reports/
|
9
|
+
/tmp/
|
10
|
+
*.bundle
|
11
|
+
*.so
|
12
|
+
*.o
|
13
|
+
*.a
|
14
|
+
mkmf.log
|
15
|
+
*.gem
|
16
|
+
*.rbc
|
17
|
+
/.config
|
18
|
+
/coverage/
|
19
|
+
/InstalledFiles
|
20
|
+
/pkg/
|
21
|
+
/spec/reports/
|
22
|
+
/test/tmp/
|
23
|
+
/test/version_tmp/
|
24
|
+
/tmp/
|
25
|
+
|
26
|
+
## Specific to RubyMotion:
|
27
|
+
.dat*
|
28
|
+
.repl_history
|
29
|
+
build/
|
30
|
+
|
31
|
+
## Documentation cache and generated files:
|
32
|
+
/.yardoc/
|
33
|
+
/_yardoc/
|
34
|
+
/doc/
|
35
|
+
/rdoc/
|
36
|
+
|
37
|
+
## Environment normalisation:
|
38
|
+
/.bundle/
|
39
|
+
/lib/bundler/man/
|
40
|
+
|
41
|
+
Gemfile.lock
|
42
|
+
.ruby-version
|
43
|
+
.ruby-gemset
|
44
|
+
|
45
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
46
|
+
.rvmrc
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014 NJayDevelopment
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# Kaminari::Views::Bootstrap
|
2
|
+
<p align="center">
|
3
|
+
<img src="http://i.imgur.com/1zuWncL.png" alt="Example of kaminari-views-bootstrap gem in action"/>
|
4
|
+
</p>
|
5
|
+
|
6
|
+
Kaminari Views Bootstrap is a quick theme for Kaminari's awesome pagination features.
|
7
|
+
Kaminari does not paginate the same way Bootstrap formats it, this gem fixes that for you.
|
8
|
+
|
9
|
+
Note: this gem removes next and previous button but leaves the first an last. This was to fit the needs of an NJay product, and this is a direct refactor of the code from there.
|
10
|
+
If you require these features, please make a fork (see Contributing) and then modify the _paginator page to add the next_page_tag and previous_page_tag.
|
11
|
+
|
12
|
+
## Installation
|
13
|
+
Make sure you have Kaminari in your application's Gemfile:
|
14
|
+
```ruby
|
15
|
+
gem 'kaminari'
|
16
|
+
```
|
17
|
+
|
18
|
+
Add this line to your application's Gemfile:
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
gem 'kaminari-views-bootstrap', :git => "https://github.com/NJayDevelopment/kaminari-views-bootstrap"
|
22
|
+
```
|
23
|
+
|
24
|
+
And then execute:
|
25
|
+
|
26
|
+
$ bundle
|
27
|
+
|
28
|
+
## Usage
|
29
|
+
|
30
|
+
After installation, paginate as you normally would but pass in a theme:
|
31
|
+
```ruby
|
32
|
+
= paginate @users, :theme => 'tb3'
|
33
|
+
```
|
34
|
+
|
35
|
+
## Contributing
|
36
|
+
|
37
|
+
1. Fork it ( https://github.com/NJayDevelopment/kaminari-views-bootstrap/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,13 @@
|
|
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
|
+
total_pages: total number of pages
|
6
|
+
per_page: number of items to fetch per page
|
7
|
+
remote: data-remote
|
8
|
+
-%>
|
9
|
+
<li class="first <%= 'disabled' if current_page.first? %>">
|
10
|
+
<%= link_to url, :remote => remote, "aria-label" => "Last" do %>
|
11
|
+
<span aria-hidden="true">«</span>
|
12
|
+
<%end%>
|
13
|
+
</li>
|
@@ -0,0 +1,8 @@
|
|
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
|
+
total_pages: total number of pages
|
5
|
+
per_page: number of items to fetch per page
|
6
|
+
remote: data-remote
|
7
|
+
-%>
|
8
|
+
<li class="disabled"><a href="#"><%= raw(t 'views.pagination.truncate') %></a></li>
|
@@ -0,0 +1,13 @@
|
|
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
|
+
total_pages: total number of pages
|
6
|
+
per_page: number of items to fetch per page
|
7
|
+
remote: data-remote
|
8
|
+
-%>
|
9
|
+
<li class="last <%= 'disabled' if current_page.last? %>">
|
10
|
+
<%= link_to url, :remote => remote, "aria-label" => "Last" do %>
|
11
|
+
<span aria-hidden="true">»</span>
|
12
|
+
<%end%>
|
13
|
+
</li>
|
@@ -0,0 +1,13 @@
|
|
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
|
+
total_pages: total number of pages
|
6
|
+
per_page: number of items to fetch per page
|
7
|
+
remote: data-remote
|
8
|
+
-%>
|
9
|
+
<li class="next">
|
10
|
+
<%= link_to url, :rel => 'next', :remote => remote, "aria-label" => "Next" do %>
|
11
|
+
<span aria-hidden="true">»</span>
|
12
|
+
<%end%>
|
13
|
+
</li>
|
@@ -0,0 +1,15 @@
|
|
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
|
+
total_pages: total number of pages
|
7
|
+
per_page: number of items to fetch per page
|
8
|
+
remote: data-remote
|
9
|
+
-%>
|
10
|
+
|
11
|
+
<li class="<%= 'active' if page.current? %>">
|
12
|
+
<%= link_to (page.current? ? 'javascript:void(0)' : url), opts = {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} do %>
|
13
|
+
<span aria-hidden="true"><%= page %></span>
|
14
|
+
<%end%>
|
15
|
+
</li>
|
@@ -0,0 +1,27 @@
|
|
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.render do -%>
|
10
|
+
<nav>
|
11
|
+
|
12
|
+
<ul class="pagination">
|
13
|
+
<%= first_page_tag %>
|
14
|
+
|
15
|
+
<% each_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
|
+
|
23
|
+
<%= last_page_tag %>
|
24
|
+
</ul>
|
25
|
+
|
26
|
+
</nav>
|
27
|
+
<% end -%>
|
@@ -0,0 +1,13 @@
|
|
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
|
+
total_pages: total number of pages
|
6
|
+
per_page: number of items to fetch per page
|
7
|
+
remote: data-remote
|
8
|
+
-%>
|
9
|
+
<li class="prev">
|
10
|
+
<%= link_to url, :rel => 'prev', :remote => remote, "aria-label" => "Previous" do %>
|
11
|
+
<span aria-hidden="true">«</span>
|
12
|
+
<%end%>
|
13
|
+
</li>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "kaminari-views-bootstrap"
|
7
|
+
spec.version = "0.0.2"
|
8
|
+
spec.authors = ["skipperguy12"]
|
9
|
+
spec.email = ["skipperguy12@users.noreply.github.com"]
|
10
|
+
spec.summary = "A quick Bootstrap3 theme for Kaminari pagination"
|
11
|
+
spec.license = "MIT"
|
12
|
+
|
13
|
+
spec.files = `git ls-files -z`.split("\x0")
|
14
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
15
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
16
|
+
spec.require_paths = ["lib"]
|
17
|
+
|
18
|
+
|
19
|
+
spec.add_dependency "rails", ">= 4.0.0"
|
20
|
+
spec.add_dependency "kaminari", ">= 0.15.0"
|
21
|
+
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
23
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: kaminari-views-bootstrap
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- skipperguy12
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-01-18 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: 4.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.0.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.15.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.15.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.7'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.7'
|
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
|
+
description:
|
70
|
+
email:
|
71
|
+
- skipperguy12@users.noreply.github.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- Gemfile
|
78
|
+
- LICENSE
|
79
|
+
- README.md
|
80
|
+
- Rakefile
|
81
|
+
- app/views/kaminari/tb3/_first_page.html.erb
|
82
|
+
- app/views/kaminari/tb3/_gap.html.erb
|
83
|
+
- app/views/kaminari/tb3/_last_page.html.erb
|
84
|
+
- app/views/kaminari/tb3/_next_page.html.erb
|
85
|
+
- app/views/kaminari/tb3/_page.html.erb
|
86
|
+
- app/views/kaminari/tb3/_paginator.html.erb
|
87
|
+
- app/views/kaminari/tb3/_prev_page.html.erb
|
88
|
+
- kaminari-views-bootstrap.gemspec
|
89
|
+
- lib/kaminari-views-bootstrap.rb
|
90
|
+
homepage:
|
91
|
+
licenses:
|
92
|
+
- MIT
|
93
|
+
metadata: {}
|
94
|
+
post_install_message:
|
95
|
+
rdoc_options: []
|
96
|
+
require_paths:
|
97
|
+
- lib
|
98
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ">="
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
requirements: []
|
109
|
+
rubyforge_project:
|
110
|
+
rubygems_version: 2.4.3
|
111
|
+
signing_key:
|
112
|
+
specification_version: 4
|
113
|
+
summary: A quick Bootstrap3 theme for Kaminari pagination
|
114
|
+
test_files: []
|
115
|
+
has_rdoc:
|