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 CHANGED
@@ -1 +1 @@
1
- 0.1.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.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
 
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class TestPaginationHelpers < Test::Unit::TestCase
4
+ should "be autoloadable" do
5
+ Pagination::Helpers
6
+ end
7
+ end
data/views/paginate.erb CHANGED
@@ -1,35 +1,37 @@
1
- <ul class="pagination">
2
- <% if items.prev_page %>
3
- <li class="prev-link">
4
- <a href='<%= "?page=%s" % items.prev_page %>'>&laquo; Prev</a>
5
- </li>
6
- <% else %>
7
- <li class="prev-link disabled">
8
- <span>&laquo; Prev</span>
9
- </li>
10
- <% end %>
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 %>'>&laquo; Prev</a>
6
+ </li>
7
+ <% else %>
8
+ <li class="prev-link disabled">
9
+ <span>&laquo; Prev</span>
10
+ </li>
11
+ <% end %>
25
12
 
26
- <% if items.next_page %>
27
- <li class="next-link">
28
- <a href='<%= "?page=%s" % items.next_page %>'>Next &raquo;</a>
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
- <% else %>
31
- <li class="next-link disabled">
32
- <span>Next &raquo;</span>
33
- </li>
34
- <% end %>
35
- </ul>
26
+
27
+ <% if items.next_page %>
28
+ <li class="next-link">
29
+ <a href='<%= "?page=%s" % items.next_page %>'>Next &raquo;</a>
30
+ </li>
31
+ <% else %>
32
+ <li class="next-link disabled">
33
+ <span>Next &raquo;</span>
34
+ </li>
35
+ <% end %>
36
+ </ul>
37
+ <% end %>
data/views/paginate.haml CHANGED
@@ -1,23 +1,24 @@
1
- %ul.notList.pagination
2
- - if items.prev_page
3
- %li.prev-link
4
- %a{:href => ("?page=%s" % items.prev_page)} &laquo; Prev
5
- - else
6
- %li.prev-link.disabled
7
- %a(href='javascript:;') &laquo; Prev
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)} &laquo; Prev
6
+ - else
7
+ %li.prev-link.disabled
8
+ %a(href='javascript:;') &laquo; Prev
8
9
 
9
- %li
10
- %ul.notList.page-numbers
11
- - items.displayed_pages.each do |page|
12
- %li
13
- - if items.current?(page)
14
- %span= page
15
- - else
16
- %a{:href => ("?page=%s" % page)}= page
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
- - if items.next_page
19
- %li.next-link
20
- %a{:href => ("?page=%s" % items.next_page)} Next &raquo;
21
- - else
22
- %li.next-link.disabled
23
- %a(href='javascript:;') Next &raquo;
19
+ - if items.next_page
20
+ %li.next-link
21
+ %a{:href => ("?page=%s" % items.next_page)} Next &raquo;
22
+ - else
23
+ %li.next-link.disabled
24
+ %a(href='javascript:;') Next &raquo;
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.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