##// END OF EJS Templates
Use ul tags to do pagination (#21258)....
Jean-Philippe Lang -
r14515:ae045cdac99e
parent child
Show More
@@ -41,6 +41,6 module GroupsHelper
41 link_to text, autocomplete_for_user_group_path(group, parameters.merge(:q => params[:q], :format => 'js')), :remote => true
41 link_to text, autocomplete_for_user_group_path(group, parameters.merge(:q => params[:q], :format => 'js')), :remote => true
42 }
42 }
43
43
44 s + content_tag('p', links, :class => 'pagination')
44 s + content_tag('span', links, :class => 'pagination')
45 end
45 end
46 end
46 end
@@ -33,6 +33,6 module MembersHelper
33 link_to text, autocomplete_project_memberships_path(project, parameters.merge(:q => params[:q], :format => 'js')), :remote => true
33 link_to text, autocomplete_project_memberships_path(project, parameters.merge(:q => params[:q], :format => 'js')), :remote => true
34 }
34 }
35
35
36 s + content_tag('p', links, :class => 'pagination')
36 s + content_tag('span', links, :class => 'pagination')
37 end
37 end
38 end
38 end
@@ -28,4 +28,4
28 </tbody>
28 </tbody>
29 </table>
29 </table>
30
30
31 <p class="pagination"><%= pagination_links_full @auth_source_pages %></p>
31 <span class="pagination"><%= pagination_links_full @auth_source_pages %></span>
@@ -50,7 +50,7
50 <% end %>
50 <% end %>
51 </tbody>
51 </tbody>
52 </table>
52 </table>
53 <p class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></p>
53 <span class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></span>
54 <% else %>
54 <% else %>
55 <p class="nodata"><%= l(:label_no_data) %></p>
55 <p class="nodata"><%= l(:label_no_data) %></p>
56 <% end %>
56 <% end %>
@@ -32,6 +32,6
32 </tbody>
32 </tbody>
33 </table>
33 </table>
34
34
35 <p class="pagination"><%= pagination_links_full @issue_status_pages %></p>
35 <span class="pagination"><%= pagination_links_full @issue_status_pages %></span>
36
36
37 <% html_title(l(:label_issue_status_plural)) -%>
37 <% html_title(l(:label_issue_status_plural)) -%>
@@ -66,7 +66,7
66 <% else %>
66 <% else %>
67 <%= render_query_totals(@query) %>
67 <%= render_query_totals(@query) %>
68 <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %>
68 <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %>
69 <p class="pagination"><%= pagination_links_full @issue_pages, @issue_count %></p>
69 <span class="pagination"><%= pagination_links_full @issue_pages, @issue_count %></span>
70 <% end %>
70 <% end %>
71
71
72 <% other_formats_links do |f| %>
72 <% other_formats_links do |f| %>
@@ -67,7 +67,7
67 <%= link_to_attachments message, :author => false %>
67 <%= link_to_attachments message, :author => false %>
68 </div>
68 </div>
69 <% end %>
69 <% end %>
70 <p class="pagination"><%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %></p>
70 <span class="pagination"><%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %></span>
71 <% end %>
71 <% end %>
72
72
73 <% if !@topic.locked? && authorize_for('messages', 'reply') %>
73 <% if !@topic.locked? && authorize_for('messages', 'reply') %>
@@ -37,7 +37,7
37 </article>
37 </article>
38 <% end %>
38 <% end %>
39 <% end %>
39 <% end %>
40 <p class="pagination"><%= pagination_links_full @news_pages %></p>
40 <span class="pagination"><%= pagination_links_full @news_pages %></span>
41
41
42 <% other_formats_links do |f| %>
42 <% other_formats_links do |f| %>
43 <%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %>
43 <%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %>
@@ -17,7 +17,7
17 :revisions => @changesets,
17 :revisions => @changesets,
18 :entry => nil } %>
18 :entry => nil } %>
19
19
20 <p class="pagination"><%= pagination_links_full @changeset_pages,@changeset_count %></p>
20 <span class="pagination"><%= pagination_links_full @changeset_pages,@changeset_count %></span>
21
21
22 <% content_for :header_tags do %>
22 <% content_for :header_tags do %>
23 <%= stylesheet_link_tag "scm" %>
23 <%= stylesheet_link_tag "scm" %>
@@ -29,6 +29,6
29 </tbody>
29 </tbody>
30 </table>
30 </table>
31
31
32 <p class="pagination"><%= pagination_links_full @role_pages %></p>
32 <span class="pagination"><%= pagination_links_full @role_pages %></span>
33
33
34 <% html_title(l(:label_role_plural)) -%>
34 <% html_title(l(:label_role_plural)) -%>
@@ -52,7 +52,7
52 <% end %>
52 <% end %>
53
53
54 <% if @result_pages %>
54 <% if @result_pages %>
55 <p class="pagination"><%= pagination_links_full @result_pages, @result_count, :per_page_links => false %></p>
55 <span class="pagination"><%= pagination_links_full @result_pages, @result_count, :per_page_links => false %></span>
56 <% end %>
56 <% end %>
57
57
58 <% html_title(l(:label_search)) -%>
58 <% html_title(l(:label_search)) -%>
@@ -18,7 +18,7
18
18
19 <% unless @entries.empty? %>
19 <% unless @entries.empty? %>
20 <%= render :partial => 'list', :locals => { :entries => @entries }%>
20 <%= render :partial => 'list', :locals => { :entries => @entries }%>
21 <p class="pagination"><%= pagination_links_full @entry_pages, @entry_count %></p>
21 <span class="pagination"><%= pagination_links_full @entry_pages, @entry_count %></span>
22
22
23 <% other_formats_links do |f| %>
23 <% other_formats_links do |f| %>
24 <%= f.link_to 'Atom', :url => params.merge({:issue_id => @issue, :key => User.current.rss_key}) %>
24 <%= f.link_to 'Atom', :url => params.merge({:issue_id => @issue, :key => User.current.rss_key}) %>
@@ -34,6 +34,6
34 </tbody>
34 </tbody>
35 </table>
35 </table>
36
36
37 <p class="pagination"><%= pagination_links_full @tracker_pages %></p>
37 <span class="pagination"><%= pagination_links_full @tracker_pages %></span>
38
38
39 <% html_title(l(:label_tracker_plural)) -%>
39 <% html_title(l(:label_tracker_plural)) -%>
@@ -53,6 +53,6
53 </tbody>
53 </tbody>
54 </table>
54 </table>
55 </div>
55 </div>
56 <p class="pagination"><%= pagination_links_full @user_pages, @user_count %></p>
56 <span class="pagination"><%= pagination_links_full @user_pages, @user_count %></span>
57
57
58 <% html_title(l(:label_user_plural)) -%>
58 <% html_title(l(:label_user_plural)) -%>
@@ -172,34 +172,40 module Redmine
172 per_page_links = false if count.nil?
172 per_page_links = false if count.nil?
173 page_param = paginator.page_param
173 page_param = paginator.page_param
174
174
175 html = ''
175 html = '<ul class="pages">'
176 if paginator.previous_page
176 if paginator.previous_page
177 # \xc2\xab(utf-8) = &#171;
177 # \xc2\xab(utf-8) = &#171;
178 text = "\xc2\xab " + l(:label_previous)
178 text = "\xc2\xab " + l(:label_previous)
179 html << yield(text, {page_param => paginator.previous_page},
179 html << content_tag('li',
180 :class => 'previous', :accesskey => accesskey(:previous)) + ' '
180 yield(text, {page_param => paginator.previous_page},
181 :accesskey => accesskey(:previous)),
182 :class => 'previous page')
181 end
183 end
182
184
183 previous = nil
185 previous = nil
184 paginator.linked_pages.each do |page|
186 paginator.linked_pages.each do |page|
185 if previous && previous != page - 1
187 if previous && previous != page - 1
186 html << content_tag('span', '...', :class => 'spacer') + ' '
188 html << content_tag('li', content_tag('span', '...'), :class => 'spacer') + ' '
187 end
189 end
188 if page == paginator.page
190 if page == paginator.page
189 html << content_tag('span', page.to_s, :class => 'current page')
191 html << content_tag('li', content_tag('span', page.to_s), :class => 'current')
190 else
192 else
191 html << yield(page.to_s, {page_param => page}, :class => 'page')
193 html << content_tag('li',
194 yield(page.to_s, {page_param => page}),
195 :class => 'page')
192 end
196 end
193 html << ' '
194 previous = page
197 previous = page
195 end
198 end
196
199
197 if paginator.next_page
200 if paginator.next_page
198 # \xc2\xbb(utf-8) = &#187;
201 # \xc2\xbb(utf-8) = &#187;
199 text = l(:label_next) + " \xc2\xbb"
202 text = l(:label_next) + " \xc2\xbb"
200 html << yield(text, {page_param => paginator.next_page},
203 html << content_tag('li',
201 :class => 'next', :accesskey => accesskey(:next)) + ' '
204 yield(text, {page_param => paginator.next_page},
205 :accesskey => accesskey(:next)),
206 :class => 'next page')
202 end
207 end
208 html << '</ul>'
203
209
204 html << content_tag('span', "(#{paginator.first_item}-#{paginator.last_item}/#{paginator.item_count})", :class => 'items') + ' '
210 html << content_tag('span', "(#{paginator.first_item}-#{paginator.last_item}/#{paginator.item_count})", :class => 'items') + ' '
205
211
@@ -494,7 +494,44 textarea#custom_field_default_value {width: 95%; resize:vertical}
494
494
495 input#content_comments {width: 99%}
495 input#content_comments {width: 99%}
496
496
497 p.pagination {margin-top:8px; font-size: 90%}
497 span.pagination {margin-left:3px}
498 .pagination ul.pages {
499 margin: 0 5px 0 0;
500 padding: 0;
501 display: inline;
502 }
503 .pagination ul.pages li {
504 display: inline-block;
505 padding: 0;
506 border: 1px solid #BBB;
507 margin-left: -1px;
508 line-height: 2em;
509 }
510 .pagination ul.pages li a,
511 .pagination ul.pages li span {
512 padding: 4px 10px;
513 }
514 .pagination ul.pages li:first-child {
515 border-top-left-radius: 4px;
516 border-bottom-left-radius: 4px;
517 }
518 .pagination ul.pages li:last-child {
519 border-top-right-radius: 4px;
520 border-bottom-right-radius: 4px;
521 }
522 .pagination ul.pages li.current {
523 color: white;
524 background-color: #628DB6;
525 border-color: #628DB6;
526 }
527 .pagination ul.pages li.page:hover {
528 background-color: #EEE;
529 }
530 .pagination ul.pages li.page a:hover,
531 .pagination ul.pages li.page a:active {
532 color: inherit;
533 text-decoration: inherit;
534 }
498
535
499 #search-form fieldset p {margin:0.2em 0;}
536 #search-form fieldset p {margin:0.2em 0;}
500
537
@@ -35,8 +35,8 class GroupsHelperTest < ActionView::TestCase
35 group = Group.generate!
35 group = Group.generate!
36
36
37 result = render_principals_for_new_group_users(group, 3)
37 result = render_principals_for_new_group_users(group, 3)
38 assert_select_in result, 'p.pagination'
38 assert_select_in result, 'span.pagination'
39 assert_select_in result, 'span.current.page', :text => '1'
39 assert_select_in result, 'span.pagination li.current span', :text => '1'
40 assert_select_in result, 'a[href=?]', "/groups/#{group.id}/autocomplete_for_user.js?page=2", :text => '2'
40 assert_select_in result, 'a[href=?]', "/groups/#{group.id}/autocomplete_for_user.js?page=2", :text => '2'
41 end
41 end
42 end
42 end
@@ -36,8 +36,8 class MembersHelperTest < ActionView::TestCase
36 project = Project.generate!
36 project = Project.generate!
37
37
38 result = render_principals_for_new_members(project, 3)
38 result = render_principals_for_new_members(project, 3)
39 assert_select_in result, 'p.pagination'
39 assert_select_in result, 'span.pagination'
40 assert_select_in result, 'span.current.page', :text => '1'
40 assert_select_in result, 'span.pagination li.current span', :text => '1'
41 assert_select_in result, 'a[href=?]', "/projects/#{project.identifier}/memberships/autocomplete.js?page=2", :text => '2'
41 assert_select_in result, 'a[href=?]', "/projects/#{project.identifier}/memberships/autocomplete.js?page=2", :text => '2'
42 end
42 end
43 end
43 end
General Comments 0
You need to be logged in to leave comments. Login now