diff --git a/lib/redmine/pagination.rb b/lib/redmine/pagination.rb
index 053269a58..e6faa8a68 100644
--- a/lib/redmine/pagination.rb
+++ b/lib/redmine/pagination.rb
@@ -67,6 +67,10 @@ module Redmine
end
end
+ def multiple_pages?
+ per_page < item_count
+ end
+
def first_item
item_count == 0 ? 0 : (offset + 1)
end
@@ -173,13 +177,18 @@ module Redmine
page_param = paginator.page_param
html = '
'
- if paginator.previous_page
+
+ if paginator.multiple_pages?
# \xc2\xab(utf-8) = «
text = "\xc2\xab " + l(:label_previous)
- html << content_tag('li',
- yield(text, {page_param => paginator.previous_page},
- :accesskey => accesskey(:previous)),
- :class => 'previous page')
+ if paginator.previous_page
+ html << content_tag('li',
+ yield(text, {page_param => paginator.previous_page},
+ :accesskey => accesskey(:previous)),
+ :class => 'previous page')
+ else
+ html << content_tag('li', content_tag('span', text), :class => 'previous')
+ end
end
previous = nil
@@ -197,13 +206,17 @@ module Redmine
previous = page
end
- if paginator.next_page
+ if paginator.multiple_pages?
# \xc2\xbb(utf-8) = »
text = l(:label_next) + " \xc2\xbb"
- html << content_tag('li',
- yield(text, {page_param => paginator.next_page},
- :accesskey => accesskey(:next)),
- :class => 'next page')
+ if paginator.next_page
+ html << content_tag('li',
+ yield(text, {page_param => paginator.next_page},
+ :accesskey => accesskey(:next)),
+ :class => 'next page')
+ else
+ html << content_tag('li', content_tag('span', text), :class => 'next')
+ end
end
html << '
'