jm81-paginate 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/helpers/merb.rb +9 -7
- metadata +1 -1
data/Rakefile
CHANGED
data/lib/helpers/merb.rb
CHANGED
@@ -41,28 +41,30 @@ module Paginate
|
|
41
41
|
pages = collection.pages
|
42
42
|
|
43
43
|
tag(:div, :class => 'pageLinks') do
|
44
|
+
html = ''
|
44
45
|
if current == 1
|
45
|
-
tag(:span, '«', :class => 'pageDisabled pagePrevious')
|
46
|
+
html << tag(:span, '«', :class => 'pageDisabled pagePrevious')
|
46
47
|
else
|
47
|
-
tag(:a, '«', :href => page_url(current - 1), :class => 'pagePrevious')
|
48
|
+
html << tag(:a, '«', :href => page_url(current - 1), :class => 'pagePrevious')
|
48
49
|
end
|
49
50
|
|
50
51
|
page_set(current, pages, padding).each do |page|
|
51
52
|
case page
|
52
53
|
when 0
|
53
|
-
tag(:span, "...", :class => 'pageSpacer')
|
54
|
+
html << tag(:span, "...", :class => 'pageSpacer')
|
54
55
|
when current
|
55
|
-
tag(:span, page, :class => 'pageCurrent')
|
56
|
+
html << tag(:span, page, :class => 'pageCurrent')
|
56
57
|
else
|
57
|
-
tag(:a, page, :href => page_url(page), :class => 'pageNumber')
|
58
|
+
html << tag(:a, page, :href => page_url(page), :class => 'pageNumber')
|
58
59
|
end
|
59
60
|
end
|
60
61
|
|
61
62
|
if current == pages
|
62
|
-
tag(:span, '»', :class => 'pageDisabled pageNext')
|
63
|
+
html << tag(:span, '»', :class => 'pageDisabled pageNext')
|
63
64
|
else
|
64
|
-
tag(:a, '»', :href => page_url(current + 1), :class => 'pageNext')
|
65
|
+
html << tag(:a, '»', :href => page_url(current + 1), :class => 'pageNext')
|
65
66
|
end
|
67
|
+
html
|
66
68
|
end
|
67
69
|
end
|
68
70
|
|