Skip to content

Commit 7f462e0

Browse files
committed
Reorganized markup of the results view to be easier to understand
1 parent c4b3b04 commit 7f462e0

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

app/views/search/results.html.erb

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@
1111

1212
<%= turbo_frame_tag "search-results", data: { turbo_action: "advance" } do %>
1313
<div id="results-section">
14+
1415
<% if @show_primo_continuation %>
16+
1517
<%= render partial: 'search/primo_continuation' %>
18+
1619
<% elsif @results.present? && @errors.blank? %>
17-
<h2 class="results-context"><%= results_summary(@pagination[:hits]) %></h2>
18-
<p class="results-context-description">From all MIT Libraries sources</p>
19-
<div id="results-layout-wrapper">
20-
<main id="results">
20+
21+
<h2 class="results-context"><%= results_summary(@pagination[:hits]) %></h2>
22+
<p class="results-context-description">From all MIT Libraries sources</p>
23+
<div id="results-layout-wrapper">
24+
<main id="results">
2125
<ol class="results-list" start="<%= @pagination[:start] %>">
2226
<% case @active_tab %>
2327
<% when 'primo' %>
@@ -35,23 +39,25 @@
3539
<% end %>
3640
</ol>
3741
<%= render partial: "results_callouts" %>
38-
<% elsif @errors.blank? %>
39-
<main id="results">
40-
<div class="no-results">
41-
<p class="hd-2">No results found for your search</p>
42-
</div>
43-
</main>
44-
<% end %>
45-
</main>
46-
<% if @results.present? %>
42+
</main>
4743
<%= render partial: "results_sidebar" %>
48-
<% end %>
49-
</div>
44+
</div>
45+
<%= render partial: "pagination" %>
46+
47+
<% elsif @errors.blank? %>
48+
49+
<div id="results-layout-wrapper">
50+
<main id="results">
51+
<div class="no-results">
52+
<p class="hd-2">No results found for your search</p>
53+
</div>
54+
</main>
55+
</div>
56+
57+
<% end %>
58+
5059
</div>
5160

52-
<% if @results.present? %>
53-
<%= render partial: "pagination" %>
54-
<% end %>
5561
<% end %>
5662

5763
</div>

0 commit comments

Comments
 (0)