Skip to content

Commit 3f1acf8

Browse files
authored
Merge pull request #270 from MITLibraries/use-61-results-title
USE-61: Added page title with results count and description of source to USE UI
2 parents e0eadf1 + a684380 commit 3f1acf8

File tree

8 files changed

+37
-20
lines changed

8 files changed

+37
-20
lines changed

app/assets/stylesheets/partials/_results.scss

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,25 @@
118118
font-size: 1.8rem;
119119
line-height: 1.1;
120120
}
121+
}
122+
123+
/* USE Specific Overrides */
124+
#content-wrapper {
125+
padding-top: 12px;
126+
127+
.results-context {
128+
padding-left: 0;
129+
margin-top: 0;
130+
margin-bottom: 4px;
131+
}
132+
133+
.results-context-description {
134+
color: $color-text-secondary;
135+
margin-bottom: 32px;
136+
}
137+
138+
#results {
139+
padding: 16px 0 0 0;
140+
}
141+
121142
}

app/assets/stylesheets/partials/_search.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
font-weight: $fw-medium;
1414
display: block;
1515
line-height: 1;
16+
color: $color-text-oncolor;
1617
}
1718

1819
.form-wrapper {

app/assets/stylesheets/partials/_suggestion-panel.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#hint {padding-top: 24px;} //Temporary spacing above panel until we can revisit entire page layout
1+
#hint {padding-bottom: 24px;}
22

33
.mitlib-suggestion-panel {
44

app/assets/stylesheets/partials/_typography.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Override fonts from the theme gem, done temporarily for USE UI
22
body {
33
font-family: $base-font;
4+
color: $color-text-primary;
45
}
56

67
h1, h2, h3, h4, h5, h6 {
@@ -37,3 +38,9 @@ h1, h2, h3, h4, h5, h6 {
3738
.hd-6 {
3839
line-height: $lh-base;
3940
}
41+
42+
/* Theme Gem Overrides */
43+
44+
//Font color set to black in theme gem, breaking cascade from local body style rule
45+
.wrap-outer-content { color: $color-text-primary; }
46+
.wrap-outer-footer-institute a, .wrap-footer a, a, .js .expand-collapse-control .button { color: $color-text-primary; }

app/views/search/_search_summary.html.erb

Lines changed: 0 additions & 7 deletions
This file was deleted.

app/views/search/results.html.erb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,19 @@
44
<meta name="robots" content="noindex, nofollow" />
55
<% end %>
66

7-
<div class="space-wrap">
8-
9-
<%= render partial: "shared/site_title" %>
10-
11-
<%= render partial: "search_summary" %>
12-
7+
<div id="content-wrapper" class="space-wrap">
138
<%= render(partial: 'shared/error', collection: @errors) %>
149

1510
<%= render(partial: 'trigger_tacos') if tacos_enabled? %>
1611

1712
<%= turbo_frame_tag "search-results", data: { turbo_action: "advance" } do %>
18-
<div class="layout-3q1q layout-band top-space">
13+
<div class="layout-3q1q layout-band">
1914
<main id="results" class="col3q wrap-results">
2015
<% if @show_primo_continuation %>
2116
<%= render partial: 'search/primo_continuation' %>
2217
<% elsif @results.present? && @errors.blank? %>
23-
<h2 class="hd-3 results-context"><%= results_summary(@pagination[:hits]) %> returned</h2>
18+
<h2 class="results-context"><%= results_summary(@pagination[:hits]) %></h2>
19+
<p class="results-context-description">From all MIT Libraries sources</p>
2420
<ol class="results-list" start="<%= @pagination[:start] %>">
2521
<% case @active_tab %>
2622
<% when 'primo' %>
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<% if Feature.enabled?(:geodata) %>
22
<h2>Search for geospatial/GIS data</h2>
33
<p id="site-desc">Find GIS data held at MIT and other institutions</p>
4-
<% else %>
5-
<h2>Search the MIT Libraries</h2>
64
<% end %>

test/controllers/search_controller_test.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,8 +623,9 @@ def source_filter_count(controller)
623623

624624
get '/results?q=test'
625625
assert_response :success
626-
assert_select 'aside.search-summary', count: 1
627-
assert_select 'aside.search-summary', text: /You searched for: test/
626+
assert_select '.results-context', text: /0 results/
627+
assert_select '.results-context-description', count: 1
628+
assert_select '.results-context-description', text: /From all MIT Libraries sources/
628629
end
629630

630631
test 'primo results shows continuation partial when page exceeds API offset limit' do

0 commit comments

Comments
 (0)