Skip to content

Commit

Permalink
Consolidate full record access links in sidebar
Browse files Browse the repository at this point in the history
Why these changes are being introduced:

The metadata download link appears at the end of the full record
with no heading. This makes it look like part of the last full
record heading (usually 'Languages').

A related issue is that the access link in the sidebar has no
heading. We have an `aria-label` that describes this section for
screen reader users, but for sighted users, this section lacks
context.

As part of their accessibility review, DAS has recommended moving
the metadata download link to the same section as the access link.

Relevant ticket(s):

* [GDT-319](https://mitlibraries.atlassian.net/browse/GDT-319)

How this addresses that need:

This moves the download link below the access link in the sidebar,
and adds a heading to that section.

Side effects of this change:

While working on this, I noticed that the fact panel markup needs
some work to be semantically meaningful. I haven't touched that in
this commit, but it will be worth revisiting when we return to
search intent detection.
  • Loading branch information
jazairi committed May 10, 2024
1 parent 02269ec commit 0439f6c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 15 deletions.
17 changes: 13 additions & 4 deletions app/assets/stylesheets/partials/_record.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
}

.access-button-container {
margin-top: 2.6rem;
.access-button {
.access-button,
.metadata-link {
display: block;
font-weight: $fw-bold;
text-align: center;
padding-top: 1rem;
padding-bottom: 1rem;
}
.access-button {
.auth-notice {
&::before {
font-family: FontAwesome;
Expand All @@ -22,6 +25,9 @@
display: block;
}
}
.metadata-link {
margin-top: 1rem;
}
}
.hidden-md {
@media (max-width: $bp-screen-md) {
Expand All @@ -36,8 +42,7 @@
display: none;
}
}
.section-title,
.metadata-link {
.section-title {
margin-top: 1.4em;
}
}
Expand All @@ -61,3 +66,7 @@
}
}
}

.access-sidebar {
padding-top: 3%;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% return if @record.blank? %>

<div class="access-button-container <%= display %>">
<div class="access-button-container">
<% if access_type(@record) == 'no authentication required' %>
<a class="btn button-primary access-button" href="<%= gis_access_link(@record) %>">Download geodata files</a>
<% elsif access_type(@record) == 'MIT authentication required' %>
Expand All @@ -13,4 +13,10 @@
View <%= @record['provider'] %> record
</a>
<% end %>
<% if access_type(@record) != 'unknown: check with owning institution' &&
source_metadata_available?(@record['links']) %>
<a class="btn button-secondary metadata-link" href="<%= source_metadata_link(@record['links']) %>">
Download full metadata
</a>
<% end %>
</div>
8 changes: 0 additions & 8 deletions app/views/record/_record_geo.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,6 @@
<% end %>
</ul>
<% end %>

<div class="record-access-links">
<% if access_type(@record) != 'unknown: check with owning institution' && source_metadata_available?(@record['links']) %>
<a class="btn button-secondary metadata-link"
href="<%= source_metadata_link(@record['links']) %>">Download full metadata</a>
<% end %>
<%= render partial: 'access_button', locals: { display: 'view-md' } %>
</div>
</main>

<%= render('sidebar') %>
Expand Down
5 changes: 3 additions & 2 deletions app/views/record/_sidebar.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% if Flipflop.enabled?(:gdt) %>
<div role="region" aria-label="Access link and additional information" class="col1q-r sidebar">
<div role="region" aria-label="Access links and additional information" class="col1q-r sidebar access-sidebar">
<% else %>
<aside class="col1q-r sidebar">
<% end %>
Expand All @@ -13,7 +13,8 @@
<% end %>

<% if Flipflop.enabled?(:gdt) && access_type(@record) && gis_access_link(@record) %>
<%= render partial: 'access_button', locals: { display: 'hidden-md' } %>
<h2 class="title hd-4">Access links</h2>
<%= render partial: 'access_buttons' %>
<% end %>

<%= render partial: 'shared/ask', locals: { display: '' } %>
Expand Down

0 comments on commit 0439f6c

Please sign in to comment.