mguymon-twitter_bootstrap_kaminari_views 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +5 -0
- data/MIT-LICENSE +20 -0
- data/README.md +16 -0
- data/Rakefile +2 -0
- data/app/views/kaminari/_first_page.html.haml +12 -0
- data/app/views/kaminari/_gap.html.haml +11 -0
- data/app/views/kaminari/_last_page.html.haml +13 -0
- data/app/views/kaminari/_next_page.html.haml +12 -0
- data/app/views/kaminari/_page.html.haml +11 -0
- data/app/views/kaminari/_paginator.html.haml +21 -0
- data/app/views/kaminari/_prev_page.html.haml +12 -0
- data/lib/engine.rb +8 -0
- data/lib/twitter_bootstrap_kaminari_views.rb +7 -0
- data/lib/twitter_bootstrap_kaminari_views/version.rb +3 -0
- metadata +113 -0
data/Gemfile
ADDED
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2012 YOURNAME
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# HAML Version
|
2
|
+
|
3
|
+
Original work done by [gabetax](https://github.com/gabetax/twitter-bootstrap-kaminari-views) - I simply converted everything to haml.
|
4
|
+
I'm using it in a project with kaminari 0.13.0 and bootstrap 2 without any problem.
|
5
|
+
|
6
|
+
|
7
|
+
# Kaminari views for Twitter Bootstrap
|
8
|
+
|
9
|
+
[twitter bootstrap](https://github.com/twitter/bootstrap) is a toolkit from Twitter designed to kickstart development of webapps and sites, including styles for [pagination](http://twitter.github.com/bootstrap/#navigation). If you're using [kaminari](https://github.com/amatsuda/kaminari) as your pagination library, the markup in its default views won't match the selectors used by bootstrap. This repository contains modified copies of kaminari's views that you can drop in to your ruby application to work with bootstrap.
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
* Step 1: Copy app/views/kaminari into your local Rails app/views folder
|
13
|
+
* Step 2: LEAVE ME ALONE, JEFF GOLDBUM.
|
14
|
+
|
15
|
+
## Compatibility
|
16
|
+
These views were tested with kaminari 0.12.4 and bootstrap 1.1.0 and 1.3.0.
|
data/Rakefile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
-#
|
2
|
+
Link to the "First" page
|
3
|
+
- available local variables
|
4
|
+
url: url to the first 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
|
+
- unless current_page.first?
|
11
|
+
%li{:class => "first"}
|
12
|
+
= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote
|
@@ -0,0 +1,11 @@
|
|
1
|
+
-#
|
2
|
+
Non-link tag that stands for skipped pages...
|
3
|
+
- available local variables
|
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 => "page gap disabled"}
|
10
|
+
%a{:href => "#", :onclick => "return false;"}
|
11
|
+
= raw(t 'views.pagination.truncate')
|
@@ -0,0 +1,13 @@
|
|
1
|
+
-#
|
2
|
+
Link to the "Last" page
|
3
|
+
- available local variables
|
4
|
+
url: url to the last 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
|
+
- unless current_page.last?
|
11
|
+
%li{:class=>"last next"}
|
12
|
+
-# "next" class present for border styling in twitter bootstrap %>
|
13
|
+
= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
-#
|
2
|
+
Link to the "Next" page
|
3
|
+
- available local variables
|
4
|
+
url: url to the next 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
|
+
- unless current_page.last?
|
11
|
+
%li{:class=>"next_page"}
|
12
|
+
= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote
|
@@ -0,0 +1,11 @@
|
|
1
|
+
-#
|
2
|
+
Link showing page number
|
3
|
+
- available local variables
|
4
|
+
page: a page object for "this" page
|
5
|
+
url: url to this page
|
6
|
+
current_page: a page object for the currently displayed page
|
7
|
+
num_pages: total number of pages
|
8
|
+
per_page: number of items to fetch per page
|
9
|
+
remote: data-remote
|
10
|
+
%li{:class=>"page #{' active' if page.current? }"}
|
11
|
+
= link_to page, url, opts = {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
-#
|
2
|
+
The container tag
|
3
|
+
- available local variables
|
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
|
+
paginator: the paginator that renders the pagination tags inside
|
9
|
+
|
10
|
+
= paginator.render do
|
11
|
+
%nav.pagination
|
12
|
+
%ul
|
13
|
+
= first_page_tag unless current_page.first?
|
14
|
+
= prev_page_tag unless current_page.first?
|
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
|
+
= next_page_tag unless current_page.last?
|
21
|
+
= last_page_tag unless current_page.last?
|
@@ -0,0 +1,12 @@
|
|
1
|
+
-#
|
2
|
+
Link to the "Previous" page
|
3
|
+
- available local variables
|
4
|
+
url: url to the previous 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
|
+
- unless current_page.first?
|
11
|
+
%li{:class=>"prev"}
|
12
|
+
= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote
|
data/lib/engine.rb
ADDED
metadata
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mguymon-twitter_bootstrap_kaminari_views
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- gabetax
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-05-22 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: activesupport
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.0.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.0.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rails
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 3.0.0
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 3.0.0
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: kaminari
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 0.13.0
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.13.0
|
62
|
+
description: Insert description.
|
63
|
+
email:
|
64
|
+
- notset@hopefullysomeday.com
|
65
|
+
executables: []
|
66
|
+
extensions: []
|
67
|
+
extra_rdoc_files: []
|
68
|
+
files:
|
69
|
+
- app/views/kaminari/_prev_page.html.haml
|
70
|
+
- app/views/kaminari/_next_page.html.haml
|
71
|
+
- app/views/kaminari/_paginator.html.haml
|
72
|
+
- app/views/kaminari/_gap.html.haml
|
73
|
+
- app/views/kaminari/_last_page.html.haml
|
74
|
+
- app/views/kaminari/_first_page.html.haml
|
75
|
+
- app/views/kaminari/_page.html.haml
|
76
|
+
- lib/twitter_bootstrap_kaminari_views.rb
|
77
|
+
- lib/twitter_bootstrap_kaminari_views/version.rb
|
78
|
+
- lib/engine.rb
|
79
|
+
- MIT-LICENSE
|
80
|
+
- Rakefile
|
81
|
+
- Gemfile
|
82
|
+
- README.md
|
83
|
+
homepage:
|
84
|
+
licenses: []
|
85
|
+
post_install_message:
|
86
|
+
rdoc_options: []
|
87
|
+
require_paths:
|
88
|
+
- lib
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ! '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
segments:
|
96
|
+
- 0
|
97
|
+
hash: -4599574153223317886
|
98
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
100
|
+
requirements:
|
101
|
+
- - ! '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
segments:
|
105
|
+
- 0
|
106
|
+
hash: -4599574153223317886
|
107
|
+
requirements: []
|
108
|
+
rubyforge_project:
|
109
|
+
rubygems_version: 1.8.24
|
110
|
+
signing_key:
|
111
|
+
specification_version: 3
|
112
|
+
summary: Insert summary.
|
113
|
+
test_files: []
|