Skip to content

Commit 031550e

Browse files
authored
Merge pull request #306 from MITLibraries/use-271
USE-271: Add No Results content to USE
2 parents 7d1f8d1 + 3c64db4 commit 031550e

File tree

4 files changed

+43
-6
lines changed

4 files changed

+43
-6
lines changed

app/assets/stylesheets/partials/_results.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,23 @@
255255
}
256256
}
257257

258+
.no-results.use {
259+
border: 0;
260+
font-size: 1.6rem;
261+
line-height: $lh-xloose;
262+
margin: 0;
263+
max-width: 760px;
264+
265+
a {
266+
@include underlinedLinks;
267+
font-weight: $fw-medium;
268+
}
269+
270+
p:last-child {
271+
margin-bottom: 0;
272+
}
273+
}
274+
258275
// -----------------------------
259276
// Result list and Sidebar - USE
260277
// -----------------------------
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<div class="no-results use">
2+
<h2>No results were found</h2>
3+
<p>Any misspellings in your search terms?</p>
4+
5+
<p>Even if we don't own it, we can often get it for you:</p>
6+
<ul>
7+
<li>Articles: Request via <a href="https://libraries.mit.edu/illiad">ILLiad</a>
8+
<li>Books, physical materials: Search <a href="https://mit.on.worldcat.org/">WorldCat</a> and submit a request.
9+
</ul>
10+
11+
<p>A specialized or advanced search may work better:</p>
12+
<ul>
13+
<li><a href="https://libraries.mit.edu/search-collections">Search our Collections</a>: MIT Libraries catalog
14+
<li><a href="https://libguides.mit.edu/az.php">A-Z Databases</a>: Browse or search for databases.
15+
<li><a href="http://archivesspace.mit.edu/">ArchivesSpace</a>: Archives and manuscripts in our Distinctive Collections.
16+
<li><a href="https://libraries.mit.edu/dspace">DSpace@MIT</a>: MIT theses, articles and other research materials.
17+
<li><a href="https://geodata.libraries.mit.edu/">GeoData</a>: GIS/spatial data available at MIT.
18+
<li><a href="https://libraries.mit.edu/experts">Subject guides</a>: Created by our librarians for targeted research by subject.
19+
</ul>
20+
21+
<p><a href="http://libraries.mit.edu/ask">Ask Us</a> for more help!</p>
22+
</div>

app/views/search/results.html.erb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@
4141

4242
<div id="results-layout-wrapper">
4343
<main id="results">
44-
<div class="no-results">
45-
<p class="hd-2">No results found for your search</p>
46-
</div>
44+
<%= render partial: "no_results" %>
4745
</main>
4846
</div>
4947

test/controllers/search_controller_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ def mock_timdex_search_with_hits(total_hits)
499499
# Result list contents state "no results"
500500
assert_select '#results'
501501
assert_select '#results', { count: 1 }
502-
assert_select '#results .no-results p', 'No results found for your search'
502+
assert_select '#results .no-results h2', 'No results were found'
503503

504504
# Filter sidebar is not shown
505505
assert_select '#filters', { count: 0 }
@@ -927,7 +927,7 @@ def source_filter_count(controller)
927927
get '/results?q=nonexistentterm&tab=primo'
928928
assert_response :success
929929
assert_select '.no-results', count: 1
930-
assert_select '.no-results p', text: /No results found for your search/
930+
assert_select '.no-results h2', text: /No results were found/
931931
refute_select '.primo-continuation'
932932
end
933933

@@ -952,7 +952,7 @@ def source_filter_count(controller)
952952
get '/results?q=nonexistentterm&tab=timdex'
953953
assert_response :success
954954
assert_select '.no-results', count: 1
955-
assert_select '.no-results p', text: /No results found for your search/
955+
assert_select '.no-results h2', text: /No results were found/
956956
refute_select '.primo-continuation'
957957
end
958958

0 commit comments

Comments
 (0)