Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/assets/stylesheets/partials/_buttons.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@mixin buttonSecondary {
border: 1px solid $color-blue-500;
background-color: $color-white;
color: $color-text-primary;
border-radius: 0;
display: inline-block;
padding: 6px 12px;
Expand Down
136 changes: 132 additions & 4 deletions app/assets/stylesheets/partials/_results.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// ----------------------------
// Results List
// ----------------------------

.top-space {
margin-top: 1.2rem;
@media (min-width: $bp-screen-md) {
Expand Down Expand Up @@ -37,9 +41,18 @@
margin-left: 3rem;
}
}
}
}
}

.results-list.use {
list-style-type: none;
padding: 0;
}

// --------------------------------------
// Individual Results for GeoData & USE
// --------------------------------------

.result {
padding: 2rem;
border-top: 1px solid $brand-primary;
Expand Down Expand Up @@ -120,8 +133,119 @@
}
}

/* USE Specific Overrides */
/* Layout of results and sidebar columns */
// --------------------------------------
// Individual Results overrides for USE
// --------------------------------------

.result.use, .result.primo {
margin-bottom: 48px;
padding: 0;
border-top: none;

&:hover,
&:focus {
background-color: transparent;
}

.eyebrow {
color: $color-text-secondary;
font-size: 1.3rem;
font-weight: $fw-medium;
letter-spacing: 0.05em;
text-transform: uppercase;
}

.record-title {
font-size: 2.4rem;
line-height: 1.3;
margin-bottom: 8px;

a {
@include underlinedLinks;
font-weight: $fw-semibold;
}
}

.pub-info {
font-size: $fs-base;
color: $color-text-secondary;
span:first-child:after {
content: " • ";
color: $color-text-disabled;
}
margin-bottom: 1em;
margin-top: 0;
}

.result-highlights.use {
margin-top: 0;

ul {
list-style: disc outside;
padding-left: 16px;

li {
margin-left: 0.6rem;
font-size: 1.6rem;
}
}
}

.highlight {
background-color: $color-highlight;
}

&.use, &.primo {
.result-metadata {
margin-bottom: 16px;
}

.pub-info {
margin-bottom: 4px;
}

ul.contributors {
li {
font-weight: $fw-normal;

a {
color: $color-text-secondary;
text-decoration: none;

&:hover {
text-decoration: underline;
}
}
}
}

.inner-heading {
font-size: 1.6rem;
font-family: $base-font; // Since we're using 16px, override to use body font
}

// Make result buttons present as underlined links
a.button {
@include underlinedLinks;
font-weight: $fw-medium;
font-size: 1.6rem;
margin-right: 16px;
}

// Except the first button, which should present as a secondary button
a.button:first-child {
@include buttonSecondary;
}

.truncate-list li:last-child {margin-bottom: 0;}

}
}

// -----------------------------
// Result list and Sidebar - USE
// -----------------------------

#content-wrapper {
padding-top: 12px;
padding-bottom: 44px;
Expand Down Expand Up @@ -167,6 +291,7 @@

a {
@include underlinedLinks;
font-weight: $fw-medium;
}
}

Expand Down Expand Up @@ -205,7 +330,10 @@

}

/* Callouts below results */
// ----------------------------
// Result callout boxes
// ----------------------------

#callout-wrapper {
display: flex;
gap: 12px;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/partials/_typography.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Mixing for underlined links
@mixin underlinedLinks {
color: inherit;
font-weight: $fw-medium;
font-weight: inherit;
text-decoration: underline;
text-decoration-color: $color-blue-500;
text-underline-offset: 0.5rem;
Expand Down
6 changes: 6 additions & 0 deletions app/assets/stylesheets/partials/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ $color-red-400: #FF3333;
$color-red-500: #ff0000;
$color-red-600: #e50000;

// YELLOW
$color-yellow-500: #FFD700;

// CYAN
$color-cyan-500: #00C8FF;
$color-cyan-700: #00A0CC;
Expand Down Expand Up @@ -57,6 +60,9 @@ $color-focus-dark: $color-cyan-500;
$color-suggestion-border: $color-purple-700;
$color-suggestion-accent-text: $color-purple-700;

// HIGHLIGHT
$color-highlight: $color-yellow-500;

// ----------------------------
// #TYPOGRAPHY
// ----------------------------
Expand Down
34 changes: 20 additions & 14 deletions app/views/search/_result.html.erb
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
<li class="result">
<li class="result use">
<div class="result-content">
<p class="eyebrow">Eyebrow Text</p>
<h3 class="record-title">
<span class="sr">Title: </span>
<%= link_to_result(result) %>
</h3>

<p class="pub-info">
<span><%= result[:content_type]&.each { |type| type['value'] }&.join(' ; ') %></span>
<span>
<% result[:dates]&.each do |date| %>
<%= date['value'] if date['kind'] == 'Publication date' %>
<% end %>
</span>
</p>
<div class="result-metadata">

<span class="sr">Contributors: </span>
<ul class="list-inline truncate-list contributors">
<%= render partial: 'shared/contributors', locals: { contributors: result[:contributors] } %>
</ul>
<p class="pub-info">
<span><%= result[:content_type]&.each { |type| type['value'] }&.join(' ; ') %></span>
<span>
<% result[:dates]&.each do |date| %>
<%= date['value'] if date['kind'] == 'Publication date' %>
<% end %>
</span>
</p>

<div class="result-highlights">
<% if result[:contributors].present? %>
<span class="sr">Contributors: </span>
<ul class="list-inline truncate-list contributors">
<%= render partial: 'shared/contributors', locals: { contributors: result[:contributors] } %>
</ul>
<% end %>
</div>

<div class="result-highlights use">
<%= render partial: 'search/highlights', locals: { result: result } %>
</div>

Expand Down
45 changes: 25 additions & 20 deletions app/views/search/_result_primo.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<li class="result">
<li class="result primo">
<div class="result-content">
<p class="eyebrow">Eyebrow Text</p>
<h3 class="record-title">
<span class="sr">Title: </span>
<% if result[:links]&.find { |link| link['kind'] == 'full record' } %>
Expand All @@ -9,30 +10,34 @@
<% end %>
</h3>

<p class="pub-info">
<span><%= result[:format] %></span>
<span><%= result[:year] %></span>
</p>
<div class="result-metadata">

<% if result[:creators].present? %>
<span class="sr">Contributors: </span>
<ul class="list-inline truncate-list contributors">
<% result[:creators].each do |creator| %>
<li>
<% if creator[:link] %>
<%= link_to creator[:value], creator[:link] %>
<% else %>
<%= creator[:value] %>
<% end %>
</li>
<% end %>
</ul>
<% end %>
<p class="pub-info">
<span><%= result[:format] %></span>
<span><%= result[:year] %></span>
</p>

<% if result[:creators].present? %>
<span class="sr">Contributors: </span>
<ul class="list-inline truncate-list contributors">
<% result[:creators].each do |creator| %>
<li>
<% if creator[:link] %>
<%= link_to creator[:value], creator[:link] %>
<% else %>
<%= creator[:value] %>
<% end %>
</li>
<% end %>
</ul>
<% end %>

</div>

<div class="result-get">
<% if result[:links].present? %>
<% result[:links].each do |link| %>
<%= link_to link['kind'].titleize, link['url'], class: 'link-button' %>
<%= link_to link['kind'].titleize, link['url'], class: 'button' %>
<% end %>
<% end %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/search/results.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<p class="results-context-description">From all MIT Libraries sources</p>
<div id="results-layout-wrapper">
<main id="results">
<ol class="results-list" start="<%= @pagination[:start] %>">
<ol class="results-list use" start="<%= @pagination[:start] %>">
<% @results.each do |result| %>
<% if result[:api] == 'primo' %>
<%= render(partial: 'search/result_primo', locals: { result: result }) %>
Expand Down