pagination 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/pagination.gemspec +3 -1
- data/test/test_pagination_helpers.rb +7 -0
- data/views/paginate.erb +35 -33
- data/views/paginate.haml +22 -21
- metadata +4 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/pagination.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{pagination}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Cyril David"]
|
@@ -34,6 +34,7 @@ Gem::Specification.new do |s|
|
|
34
34
|
"pagination.gemspec",
|
35
35
|
"test/helper.rb",
|
36
36
|
"test/test_pagination.rb",
|
37
|
+
"test/test_pagination_helpers.rb",
|
37
38
|
"test/test_pagination_template.rb",
|
38
39
|
"views/paginate.erb",
|
39
40
|
"views/paginate.haml"
|
@@ -46,6 +47,7 @@ Gem::Specification.new do |s|
|
|
46
47
|
s.test_files = [
|
47
48
|
"test/helper.rb",
|
48
49
|
"test/test_pagination.rb",
|
50
|
+
"test/test_pagination_helpers.rb",
|
49
51
|
"test/test_pagination_template.rb"
|
50
52
|
]
|
51
53
|
|
data/views/paginate.erb
CHANGED
@@ -1,35 +1,37 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
<
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
<li>
|
13
|
-
<ul class="page-numbers">
|
14
|
-
<% items.displayed_pages.each do |page| %>
|
15
|
-
<li>
|
16
|
-
<% if items.current?(page) %>
|
17
|
-
<span><%= page %></span>
|
18
|
-
<% else %>
|
19
|
-
<a href='<%= "?page=%s" % page %>'><%= page %></a>
|
20
|
-
<% end %>
|
21
|
-
</li>
|
22
|
-
<% end %>
|
23
|
-
</ul>
|
24
|
-
</li>
|
1
|
+
<% if items.render? %>
|
2
|
+
<ul class="pagination">
|
3
|
+
<% if items.prev_page %>
|
4
|
+
<li class="prev-link">
|
5
|
+
<a href='<%= "?page=%s" % items.prev_page %>'>« Prev</a>
|
6
|
+
</li>
|
7
|
+
<% else %>
|
8
|
+
<li class="prev-link disabled">
|
9
|
+
<span>« Prev</span>
|
10
|
+
</li>
|
11
|
+
<% end %>
|
25
12
|
|
26
|
-
|
27
|
-
|
28
|
-
|
13
|
+
<li>
|
14
|
+
<ul class="page-numbers">
|
15
|
+
<% items.displayed_pages.each do |page| %>
|
16
|
+
<li>
|
17
|
+
<% if items.current?(page) %>
|
18
|
+
<span><%= page %></span>
|
19
|
+
<% else %>
|
20
|
+
<a href='<%= "?page=%s" % page %>'><%= page %></a>
|
21
|
+
<% end %>
|
22
|
+
</li>
|
23
|
+
<% end %>
|
24
|
+
</ul>
|
29
25
|
</li>
|
30
|
-
|
31
|
-
|
32
|
-
<
|
33
|
-
|
34
|
-
|
35
|
-
|
26
|
+
|
27
|
+
<% if items.next_page %>
|
28
|
+
<li class="next-link">
|
29
|
+
<a href='<%= "?page=%s" % items.next_page %>'>Next »</a>
|
30
|
+
</li>
|
31
|
+
<% else %>
|
32
|
+
<li class="next-link disabled">
|
33
|
+
<span>Next »</span>
|
34
|
+
</li>
|
35
|
+
<% end %>
|
36
|
+
</ul>
|
37
|
+
<% end %>
|
data/views/paginate.haml
CHANGED
@@ -1,23 +1,24 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
%
|
5
|
-
|
6
|
-
|
7
|
-
%
|
1
|
+
- if items.render?
|
2
|
+
%ul.notList.pagination
|
3
|
+
- if items.prev_page
|
4
|
+
%li.prev-link
|
5
|
+
%a{:href => ("?page=%s" % items.prev_page)} « Prev
|
6
|
+
- else
|
7
|
+
%li.prev-link.disabled
|
8
|
+
%a(href='javascript:;') « Prev
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
10
|
+
%li
|
11
|
+
%ul.notList.page-numbers
|
12
|
+
- items.displayed_pages.each do |page|
|
13
|
+
%li
|
14
|
+
- if items.current?(page)
|
15
|
+
%span= page
|
16
|
+
- else
|
17
|
+
%a{:href => ("?page=%s" % page)}= page
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
- if items.next_page
|
20
|
+
%li.next-link
|
21
|
+
%a{:href => ("?page=%s" % items.next_page)} Next »
|
22
|
+
- else
|
23
|
+
%li.next-link.disabled
|
24
|
+
%a(href='javascript:;') Next »
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Cyril David
|
@@ -66,6 +66,7 @@ files:
|
|
66
66
|
- pagination.gemspec
|
67
67
|
- test/helper.rb
|
68
68
|
- test/test_pagination.rb
|
69
|
+
- test/test_pagination_helpers.rb
|
69
70
|
- test/test_pagination_template.rb
|
70
71
|
- views/paginate.erb
|
71
72
|
- views/paginate.haml
|
@@ -102,4 +103,5 @@ summary: A simplistic pagination library
|
|
102
103
|
test_files:
|
103
104
|
- test/helper.rb
|
104
105
|
- test/test_pagination.rb
|
106
|
+
- test/test_pagination_helpers.rb
|
105
107
|
- test/test_pagination_template.rb
|