diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-11-28 11:13:15 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-11-28 11:13:15 +0000 |
commit | ae045cdac99e9ed54f70128b63853d8899080cb1 (patch) | |
tree | a9113533732445dc55f3a2ec4d29e17c3d37adb4 /lib/redmine/pagination.rb | |
parent | 0870a3a46e75568b740ad25aa730168be08a48ad (diff) | |
download | redmine-ae045cdac99e9ed54f70128b63853d8899080cb1.tar.gz redmine-ae045cdac99e9ed54f70128b63853d8899080cb1.zip |
Use ul tags to do pagination (#21258).
Patch by Daniel Ritz.
git-svn-id: http://svn.redmine.org/redmine/trunk@14897 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/pagination.rb')
-rw-r--r-- | lib/redmine/pagination.rb | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/lib/redmine/pagination.rb b/lib/redmine/pagination.rb index 943e8f5a7..83ded7b40 100644 --- a/lib/redmine/pagination.rb +++ b/lib/redmine/pagination.rb @@ -172,34 +172,40 @@ module Redmine per_page_links = false if count.nil? page_param = paginator.page_param - html = '' + html = '<ul class="pages">' if paginator.previous_page # \xc2\xab(utf-8) = « text = "\xc2\xab " + l(:label_previous) - html << yield(text, {page_param => paginator.previous_page}, - :class => 'previous', :accesskey => accesskey(:previous)) + ' ' + html << content_tag('li', + yield(text, {page_param => paginator.previous_page}, + :accesskey => accesskey(:previous)), + :class => 'previous page') end previous = nil paginator.linked_pages.each do |page| if previous && previous != page - 1 - html << content_tag('span', '...', :class => 'spacer') + ' ' + html << content_tag('li', content_tag('span', '...'), :class => 'spacer') + ' ' end if page == paginator.page - html << content_tag('span', page.to_s, :class => 'current page') + html << content_tag('li', content_tag('span', page.to_s), :class => 'current') else - html << yield(page.to_s, {page_param => page}, :class => 'page') + html << content_tag('li', + yield(page.to_s, {page_param => page}), + :class => 'page') end - html << ' ' previous = page end if paginator.next_page # \xc2\xbb(utf-8) = » text = l(:label_next) + " \xc2\xbb" - html << yield(text, {page_param => paginator.next_page}, - :class => 'next', :accesskey => accesskey(:next)) + ' ' + html << content_tag('li', + yield(text, {page_param => paginator.next_page}, + :accesskey => accesskey(:next)), + :class => 'next page') end + html << '</ul>' html << content_tag('span', "(#{paginator.first_item}-#{paginator.last_item}/#{paginator.item_count})", :class => 'items') + ' ' |