Sync changes from upstream repository · rubythonode/developer.github.com@b9d7288 · GitHub
Skip to content

Commit b9d7288

Browse files
author
Hubot
committed
Sync changes from upstream repository
1 parent be7e606 commit b9d7288

3 files changed

Lines changed: 58 additions & 6 deletions

File tree

Lines changed: 53 additions & 0 deletions

layouts/includes/pagination_bar.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- @count_gap refers to the minimum number of sibling pages to show -->
1+
<%# @count_gap refers to the minimum number of sibling pages to show %>
22
<% @count_gap = 2; @i = 1; @total_pages = total_pages; %>
33
<div class="pagination">
44
<% if @current_page > 1 %>
@@ -7,14 +7,13 @@
77
<span class="disabled">Previous</span>
88
<% end %>
99

10-
<!-- using a while loop here as it's the only way to skip several iterations -->
1110
<% while @i <= @total_pages do %>
1211
<% @gap = false %>
13-
<!-- first half ensures we're not caught in an infinite loop at @total_pages - 1 -->
14-
<!-- second half, with the .abs, checks for gap siblings ahead *and* behind the current page -->
12+
<%# first half ensures we're not caught in an infinite loop at @total_pages - 1 %>
13+
<%# second half, with the .abs, checks for gap siblings ahead *and* behind the current page %>
1514
<% if @i < (@total_pages - 1) && (@i - @current_page).abs > @count_gap %>
1615
<% @gap = true %>
17-
<!-- we skip multiple iterations to insert the gap (`...`), and continue with the regular links -->
16+
<%# we skip multiple iterations to insert the gap (`...`), and continue with the regular links %>
1817
<% @i = (@i < @current_page ? @current_page - @count_gap : @total_pages - 1) - 1 %>
1918
<% end %>
2019

lib/changes_helper.rb

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)