Adds CSS classes on pagination links.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11062 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-12-21 20:58:55 +00:00
parent b4aab7b375
commit 852b336f5e
2 changed files with 19 additions and 14 deletions

View File

@ -154,11 +154,11 @@ module Redmine
# :per_page_links if set to false, the "Per page" links are not rendered # :per_page_links if set to false, the "Per page" links are not rendered
# #
def pagination_links_full(*args) def pagination_links_full(*args)
pagination_links_each(*args) do |text, parameters| pagination_links_each(*args) do |text, parameters, options|
if block_given? if block_given?
yield text, parameters yield text, parameters, options
else else
link_to text, params.merge(parameters) link_to text, params.merge(parameters), options
end end
end end
end end
@ -175,18 +175,19 @@ module Redmine
html = '' html = ''
if paginator.previous_page if paginator.previous_page
# \xc2\xab(utf-8) = « # \xc2\xab(utf-8) = «
html << yield("\xc2\xab " + l(:label_previous), page_param => paginator.previous_page) + ' ' text = "\xc2\xab " + l(:label_previous)
html << yield(text, {page_param => paginator.previous_page}, :class => 'previous') + ' '
end end
previous = nil previous = nil
paginator.linked_pages.each do |page| paginator.linked_pages.each do |page|
if previous && previous != page - 1 if previous && previous != page - 1
html << '... ' html << content_tag('span', '...', :class => 'spacer') + ' '
end end
if page == paginator.page if page == paginator.page
html << page.to_s html << content_tag('span', page.to_s, :class => 'current page')
else else
html << yield(page.to_s, page_param => page) html << yield(page.to_s, {page_param => page}, :class => 'page')
end end
html << ' ' html << ' '
previous = page previous = page
@ -194,13 +195,14 @@ module Redmine
if paginator.next_page if paginator.next_page
# \xc2\xbb(utf-8) = &#187; # \xc2\xbb(utf-8) = &#187;
html << yield(l(:label_next) + " \xc2\xbb", page_param => paginator.next_page) + ' ' text = l(:label_next) + " \xc2\xbb"
html << yield(text, {page_param => paginator.next_page}, :class => 'next') + ' '
end end
html << "(#{paginator.first_item}-#{paginator.last_item}/#{paginator.item_count}) " html << content_tag('span', "(#{paginator.first_item}-#{paginator.last_item}/#{paginator.item_count})", :class => 'items') + ' '
if per_page_links != false && links = per_page_links(paginator, &block) if per_page_links != false && links = per_page_links(paginator, &block)
html << "| #{links}" html << content_tag('span', links.to_s, :class => 'per-page')
end end
html.html_safe html.html_safe
@ -211,9 +213,13 @@ module Redmine
values = per_page_options(paginator.per_page, paginator.item_count) values = per_page_options(paginator.per_page, paginator.item_count)
if values.any? if values.any?
links = values.collect do |n| links = values.collect do |n|
n == paginator.per_page ? n : yield(n, :per_page => n, paginator.page_param => nil) if n == paginator.per_page
content_tag('span', n.to_s)
else
yield(n, :per_page => n, paginator.page_param => nil)
end
end end
l(:label_display_per_page, links.join(', ')) l(:label_display_per_page, links.join(', ')).html_safe
end end
end end

View File

@ -456,8 +456,7 @@ table.fields_permissions td.required {background:#d88;}
textarea#custom_field_possible_values {width: 99%} textarea#custom_field_possible_values {width: 99%}
input#content_comments {width: 99%} input#content_comments {width: 99%}
.pagination {font-size: 90%} p.pagination {margin-top:8px; font-size: 90%}
p.pagination {margin-top:8px;}
/***** Tabular forms ******/ /***** Tabular forms ******/
.tabular p{ .tabular p{