diff --git a/app/assets/stylesheets/partials/_results.scss b/app/assets/stylesheets/partials/_results.scss index 75ced13e..23fc4213 100644 --- a/app/assets/stylesheets/partials/_results.scss +++ b/app/assets/stylesheets/partials/_results.scss @@ -303,6 +303,27 @@ display: flex; align-items: center; gap: 24px; + flex-wrap: wrap; + } + + // Browzine / LibKey actions wrapper + .libkey-actions { + // Default to underlined link styling for inline display (when paired with other buttons) + a.libkey-link { + @include underlinedLinks; + font-weight: $fw-medium; + font-size: 1.6rem; + } + } + + // When libkey-actions is the first button (no other buttons before it), + // display as full-width secondary button + .result-get > .libkey-actions:not(.result-get > a.button ~ .libkey-actions) { + flex: 0 0 100%; + + a.libkey-link { + @include buttonSecondary; + } } // Make result buttons present as underlined links diff --git a/app/views/search/_result_primo.html.erb b/app/views/search/_result_primo.html.erb index 4bd5d27d..a5493346 100644 --- a/app/views/search/_result_primo.html.erb +++ b/app/views/search/_result_primo.html.erb @@ -97,16 +97,18 @@ <%= render(partial: 'trigger_openalex_setup', locals: { doi: result[:doi], pmid: result[:pmid] }) %> <% end %> - <% if result[:availability].present? && result[:format].downcase != 'journal' %> - + <% if result[:availability].present? %> +
<% if result[:links]&.find { |link| link['kind'] == 'full record' } %> <%= link_to(availability(result[:availability], result[:location], result[:other_availability]), result[:links].find { |link| link['kind'] == 'full record' }['url']) %> <% else %> <%= availability(result[:availability], result[:location], result[:other_availability]) %> <% end %> - +
<% end %> + <%# Trigger BrowZine lookup (render inside result-get so injected HTML + is part of the flex `.result-get` area and receives expected styles) %> <% if ThirdIron.enabled? && result[:format].downcase == 'journal' && result[:issn].present? %> <%= render(partial: 'trigger_browzine', locals: { issn: result[:issn] }) %> <% end %> diff --git a/app/views/thirdiron/browzine.html.erb b/app/views/thirdiron/browzine.html.erb index 54e5301c..460f8c2c 100644 --- a/app/views/thirdiron/browzine.html.erb +++ b/app/views/thirdiron/browzine.html.erb @@ -1,5 +1,7 @@ <% if ThirdIron.enabled? && @browzine.present? %> <% if @browzine[:browzine_link].present? %> - <%= link_to( @browzine[:browzine_link][:text], @browzine[:browzine_link][:link], class: 'button libkey-link' ) %> +
+ <%= link_to @browzine[:browzine_link][:text], @browzine[:browzine_link][:link], class: 'button libkey-link' %> +
<% end %> <% end %> diff --git a/app/views/thirdiron/libkey.html.erb b/app/views/thirdiron/libkey.html.erb index 470d511f..c5f97825 100644 --- a/app/views/thirdiron/libkey.html.erb +++ b/app/views/thirdiron/libkey.html.erb @@ -15,7 +15,9 @@ <%# Display browzine link if available. This should always display if we have it regardless of other links. %> <% if @libkey[:browzine_link].present? %> - <%= link_to( @libkey[:browzine_link][:text], @libkey[:browzine_link][:link], class: 'button libkey-link' ) %> +
+ <%= link_to @libkey[:browzine_link][:text], @libkey[:browzine_link][:link], class: 'button libkey-link' %> +
<% end %> <%# 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 %>