Patch #21245 » 0004-Pagination-use-ul-to-do-pagination-for-better-stylin.patch
| app/helpers/groups_helper.rb | ||
|---|---|---|
|
link_to text, autocomplete_for_user_group_path(group, parameters.merge(:q => params[:q], :format => 'js')), :remote => true
|
||
|
}
|
||
|
s + content_tag('p', links, :class => 'pagination')
|
||
|
s + content_tag('span', links, :class => 'pagination')
|
||
|
end
|
||
|
end
|
||
| app/helpers/members_helper.rb | ||
|---|---|---|
|
link_to text, autocomplete_project_memberships_path(project, parameters.merge(:q => params[:q], :format => 'js')), :remote => true
|
||
|
}
|
||
|
s + content_tag('p', links, :class => 'pagination')
|
||
|
s + content_tag('span', links, :class => 'pagination')
|
||
|
end
|
||
|
end
|
||
| app/views/auth_sources/index.html.erb | ||
|---|---|---|
|
</tbody>
|
||
|
</table>
|
||
|
<p class="pagination"><%= pagination_links_full @auth_source_pages %></p>
|
||
|
<span class="pagination"><%= pagination_links_full @auth_source_pages %></span>
|
||
| app/views/boards/show.html.erb | ||
|---|---|---|
|
<% end %>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
<p class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></p>
|
||
|
<span class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></span>
|
||
|
<% else %>
|
||
|
<p class="nodata"><%= l(:label_no_data) %></p>
|
||
|
<% end %>
|
||
| app/views/issue_statuses/index.html.erb | ||
|---|---|---|
|
</tbody>
|
||
|
</table>
|
||
|
<p class="pagination"><%= pagination_links_full @issue_status_pages %></p>
|
||
|
<span class="pagination"><%= pagination_links_full @issue_status_pages %></span>
|
||
|
<% html_title(l(:label_issue_status_plural)) -%>
|
||
| app/views/issues/index.html.erb | ||
|---|---|---|
|
<% else %>
|
||
|
<%= render_query_totals(@query) %>
|
||
|
<%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %>
|
||
|
<p class="pagination"><%= pagination_links_full @issue_pages, @issue_count %></p>
|
||
|
<span class="pagination"><%= pagination_links_full @issue_pages, @issue_count %></span>
|
||
|
<% end %>
|
||
|
<% other_formats_links do |f| %>
|
||
| app/views/messages/show.html.erb | ||
|---|---|---|
|
<%= link_to_attachments message, :author => false %>
|
||
|
</div>
|
||
|
<% end %>
|
||
|
<p class="pagination"><%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %></p>
|
||
|
<span class="pagination"><%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %></span>
|
||
|
<% end %>
|
||
|
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
|
||
| app/views/news/index.html.erb | ||
|---|---|---|
|
</article>
|
||
|
<% end %>
|
||
|
<% end %>
|
||
|
<p class="pagination"><%= pagination_links_full @news_pages %></p>
|
||
|
<span class="pagination"><%= pagination_links_full @news_pages %></span>
|
||
|
<% other_formats_links do |f| %>
|
||
|
<%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %>
|
||
| app/views/repositories/revisions.html.erb | ||
|---|---|---|
|
:revisions => @changesets,
|
||
|
:entry => nil } %>
|
||
|
<p class="pagination"><%= pagination_links_full @changeset_pages,@changeset_count %></p>
|
||
|
<span class="pagination"><%= pagination_links_full @changeset_pages,@changeset_count %></span>
|
||
|
<% content_for :header_tags do %>
|
||
|
<%= stylesheet_link_tag "scm" %>
|
||
| app/views/roles/index.html.erb | ||
|---|---|---|
|
</tbody>
|
||
|
</table>
|
||
|
<p class="pagination"><%= pagination_links_full @role_pages %></p>
|
||
|
<span class="pagination"><%= pagination_links_full @role_pages %></span>
|
||
|
<% html_title(l(:label_role_plural)) -%>
|
||
| app/views/search/index.html.erb | ||
|---|---|---|
|
<% end %>
|
||
|
<% if @result_pages %>
|
||
|
<p class="pagination"><%= pagination_links_full @result_pages, @result_count, :per_page_links => false %></p>
|
||
|
<span class="pagination"><%= pagination_links_full @result_pages, @result_count, :per_page_links => false %></span>
|
||
|
<% end %>
|
||
|
<% html_title(l(:label_search)) -%>
|
||
| app/views/timelog/index.html.erb | ||
|---|---|---|
|
<% unless @entries.empty? %>
|
||
|
<%= render :partial => 'list', :locals => { :entries => @entries }%>
|
||
|
<p class="pagination"><%= pagination_links_full @entry_pages, @entry_count %></p>
|
||
|
<span class="pagination"><%= pagination_links_full @entry_pages, @entry_count %></span>
|
||
|
<% other_formats_links do |f| %>
|
||
|
<%= f.link_to 'Atom', :url => params.merge({:issue_id => @issue, :key => User.current.rss_key}) %>
|
||
| app/views/trackers/index.html.erb | ||
|---|---|---|
|
</tbody>
|
||
|
</table>
|
||
|
<p class="pagination"><%= pagination_links_full @tracker_pages %></p>
|
||
|
<span class="pagination"><%= pagination_links_full @tracker_pages %></span>
|
||
|
<% html_title(l(:label_tracker_plural)) -%>
|
||
| app/views/users/index.html.erb | ||
|---|---|---|
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
<p class="pagination"><%= pagination_links_full @user_pages, @user_count %></p>
|
||
|
<span class="pagination"><%= pagination_links_full @user_pages, @user_count %></span>
|
||
|
<% html_title(l(:label_user_plural)) -%>
|
||
| lib/redmine/pagination.rb | ||
|---|---|---|
|
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') + ' '
|
||
| public/stylesheets/application.css | ||
|---|---|---|
|
input#content_comments {width: 99%}
|
||
|
p.pagination {margin-top:8px; font-size: 90%}
|
||
|
span.pagination {margin-top:8px; font-size: 90%}
|
||
|
.pagination ul.pages {
|
||
|
margin: 0 5px 0 0;
|
||
|
padding: 0;
|
||
|
display: inline;
|
||
|
}
|
||
|
.pagination ul.pages li {
|
||
|
display: inline-block;
|
||
|
padding-right: 4px;
|
||
|
}
|
||
|
#search-form fieldset p {margin:0.2em 0;}
|
||
| test/unit/helpers/groups_helper_test.rb | ||
|---|---|---|
|
group = Group.generate!
|
||
|
result = render_principals_for_new_group_users(group, 3)
|
||
|
assert_select_in result, 'p.pagination'
|
||
|
assert_select_in result, 'span.current.page', :text => '1'
|
||
|
assert_select_in result, 'span.pagination'
|
||
|
assert_select_in result, 'span.pagination li.current span', :text => '1'
|
||
|
assert_select_in result, 'a[href=?]', "/groups/#{group.id}/autocomplete_for_user.js?page=2", :text => '2'
|
||
|
end
|
||
|
end
|
||
| test/unit/helpers/members_helper_test.rb | ||
|---|---|---|
|
project = Project.generate!
|
||
|
result = render_principals_for_new_members(project, 3)
|
||
|
assert_select_in result, 'p.pagination'
|
||
|
assert_select_in result, 'span.current.page', :text => '1'
|
||
|
assert_select_in result, 'span.pagination'
|
||
|
assert_select_in result, 'span.pagination li.current span', :text => '1'
|
||
|
assert_select_in result, 'a[href=?]', "/projects/#{project.identifier}/memberships/autocomplete.js?page=2", :text => '2'
|
||
|
end
|
||
|
end
|
||