Skip to content

Commit 0906439

Browse files
authored
Merge pull request #355 from MITLibraries/use-363
Reintroduce availability statements for journals
2 parents d34706f + 6b8a718 commit 0906439

File tree

4 files changed

+32
-5
lines changed

4 files changed

+32
-5
lines changed

app/assets/stylesheets/partials/_results.scss

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,27 @@
303303
display: flex;
304304
align-items: center;
305305
gap: 24px;
306+
flex-wrap: wrap;
307+
}
308+
309+
// Browzine / LibKey actions wrapper
310+
.libkey-actions {
311+
// Default to underlined link styling for inline display (when paired with other buttons)
312+
a.libkey-link {
313+
@include underlinedLinks;
314+
font-weight: $fw-medium;
315+
font-size: 1.6rem;
316+
}
317+
}
318+
319+
// When libkey-actions is the first button (no other buttons before it),
320+
// display as full-width secondary button
321+
.result-get > .libkey-actions:not(.result-get > a.button ~ .libkey-actions) {
322+
flex: 0 0 100%;
323+
324+
a.libkey-link {
325+
@include buttonSecondary;
326+
}
306327
}
307328

308329
// Make result buttons present as underlined links

app/views/search/_result_primo.html.erb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,18 @@
9797
<%= render(partial: 'trigger_openalex_setup', locals: { doi: result[:doi], pmid: result[:pmid] }) %>
9898
<% end %>
9999

100-
<% if result[:availability].present? && result[:format].downcase != 'journal' %>
101-
<span class="availability">
100+
<% if result[:availability].present? %>
101+
<div class="availability">
102102
<% if result[:links]&.find { |link| link['kind'] == 'full record' } %>
103103
<%= link_to(availability(result[:availability], result[:location], result[:other_availability]), result[:links].find { |link| link['kind'] == 'full record' }['url']) %>
104104
<% else %>
105105
<%= availability(result[:availability], result[:location], result[:other_availability]) %>
106106
<% end %>
107-
</span>
107+
</div>
108108
<% end %>
109109

110+
<%# Trigger BrowZine lookup (render inside result-get so injected HTML
111+
is part of the flex `.result-get` area and receives expected styles) %>
110112
<% if ThirdIron.enabled? && result[:format].downcase == 'journal' && result[:issn].present? %>
111113
<%= render(partial: 'trigger_browzine', locals: { issn: result[:issn] }) %>
112114
<% end %>
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<% if ThirdIron.enabled? && @browzine.present? %>
22
<% if @browzine[:browzine_link].present? %>
3-
<%= link_to( @browzine[:browzine_link][:text], @browzine[:browzine_link][:link], class: 'button libkey-link' ) %>
3+
<div class="libkey-actions">
4+
<%= link_to @browzine[:browzine_link][:text], @browzine[:browzine_link][:link], class: 'button libkey-link' %>
5+
</div>
46
<% end %>
57
<% end %>

app/views/thirdiron/libkey.html.erb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
<%# Display browzine link if available. This should always display if we have it regardless of other links. %>
1717
<% if @libkey[:browzine_link].present? %>
18-
<%= link_to( @libkey[:browzine_link][:text], @libkey[:browzine_link][:link], class: 'button libkey-link' ) %>
18+
<div class="libkey-actions">
19+
<%= link_to @libkey[:browzine_link][:text], @libkey[:browzine_link][:link], class: 'button libkey-link' %>
20+
</div>
1921
<% end %>
2022

2123
<%# If we didn't get data back from LibKey, we try OpenAlex unless OA_ALWAYS is enabled at which point we would have already requested data from OpenAlex in parallel to LibKey %>

0 commit comments

Comments
 (0)