Skip to content

Commit ddd2743

Browse files
committed
Break pagination out of results container
1 parent 27fed12 commit ddd2743

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed
Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<% return if @pagination.nil? %>
2-
3-
<nav class="pagination-container" aria-label="Pagination">
4-
<div class="previous">
5-
<%= prev_url(@enhanced_query) %>
6-
</div>
7-
<div class="center-elements">
8-
<div class="first">
9-
<%= first_url(@enhanced_query) %>
10-
</div>
11-
<div class="current"><span><%= @pagination[:start] %> - <%= @pagination[:end] %> of <%= number_with_delimiter(@pagination[:hits]) %></span></div>
12-
</div>
13-
<div class="next">
14-
<%= next_url(@enhanced_query) %>
15-
</div>
16-
</nav>
2+
<div id="pagination">
3+
<nav class="pagination-container" aria-label="Pagination">
4+
<div class="previous">
5+
<%= prev_url(@enhanced_query) %>
6+
</div>
7+
<div class="center-elements">
8+
<div class="first">
9+
<%= first_url(@enhanced_query) %>
10+
</div>
11+
<div class="current"><span><%= @pagination[:start] %> - <%= @pagination[:end] %> of <%= number_with_delimiter(@pagination[:hits]) %></span></div>
12+
</div>
13+
<div class="next">
14+
<%= next_url(@enhanced_query) %>
15+
</div>
16+
</nav>
17+
</div>

app/views/search/results.html.erb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@
3535
<% end %>
3636
</ol>
3737
<%= render partial: "results_callouts" %>
38-
<div id="pagination">
39-
<%= render partial: "pagination" %>
40-
</div>
4138
<% elsif @errors.blank? %>
4239
<div class="no-results">
4340
<p class="hd-2">No results found for your search</p>
@@ -49,6 +46,7 @@
4946
</div>
5047

5148
<% if @results.present? %>
49+
<%= render partial: "pagination" %>
5250
<%= render partial: 'shared/ask', locals: { display: 'view-md' } %>
5351
<% end %>
5452
<% end %>

0 commit comments

Comments
 (0)