Skip to content

Commit 0439f6c

Browse files
committed
Consolidate full record access links in sidebar
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.
1 parent 02269ec commit 0439f6c

File tree

4 files changed

+23
-15
lines changed

4 files changed

+23
-15
lines changed

app/assets/stylesheets/partials/_record.scss

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
}
66

77
.access-button-container {
8-
margin-top: 2.6rem;
9-
.access-button {
8+
.access-button,
9+
.metadata-link {
10+
display: block;
1011
font-weight: $fw-bold;
1112
text-align: center;
1213
padding-top: 1rem;
1314
padding-bottom: 1rem;
15+
}
16+
.access-button {
1417
.auth-notice {
1518
&::before {
1619
font-family: FontAwesome;
@@ -22,6 +25,9 @@
2225
display: block;
2326
}
2427
}
28+
.metadata-link {
29+
margin-top: 1rem;
30+
}
2531
}
2632
.hidden-md {
2733
@media (max-width: $bp-screen-md) {
@@ -36,8 +42,7 @@
3642
display: none;
3743
}
3844
}
39-
.section-title,
40-
.metadata-link {
45+
.section-title {
4146
margin-top: 1.4em;
4247
}
4348
}
@@ -61,3 +66,7 @@
6166
}
6267
}
6368
}
69+
70+
.access-sidebar {
71+
padding-top: 3%;
72+
}

app/views/record/_access_button.html.erb renamed to app/views/record/_access_buttons.html.erb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<% return if @record.blank? %>
22

3-
<div class="access-button-container <%= display %>">
3+
<div class="access-button-container">
44
<% if access_type(@record) == 'no authentication required' %>
55
<a class="btn button-primary access-button" href="<%= gis_access_link(@record) %>">Download geodata files</a>
66
<% elsif access_type(@record) == 'MIT authentication required' %>
@@ -13,4 +13,10 @@
1313
View <%= @record['provider'] %> record
1414
</a>
1515
<% end %>
16+
<% if access_type(@record) != 'unknown: check with owning institution' &&
17+
source_metadata_available?(@record['links']) %>
18+
<a class="btn button-secondary metadata-link" href="<%= source_metadata_link(@record['links']) %>">
19+
Download full metadata
20+
</a>
21+
<% end %>
1622
</div>

app/views/record/_record_geo.html.erb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,6 @@
124124
<% end %>
125125
</ul>
126126
<% end %>
127-
128-
<div class="record-access-links">
129-
<% if access_type(@record) != 'unknown: check with owning institution' && source_metadata_available?(@record['links']) %>
130-
<a class="btn button-secondary metadata-link"
131-
href="<%= source_metadata_link(@record['links']) %>">Download full metadata</a>
132-
<% end %>
133-
<%= render partial: 'access_button', locals: { display: 'view-md' } %>
134-
</div>
135127
</main>
136128

137129
<%= render('sidebar') %>

app/views/record/_sidebar.html.erb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<% if Flipflop.enabled?(:gdt) %>
2-
<div role="region" aria-label="Access link and additional information" class="col1q-r sidebar">
2+
<div role="region" aria-label="Access links and additional information" class="col1q-r sidebar access-sidebar">
33
<% else %>
44
<aside class="col1q-r sidebar">
55
<% end %>
@@ -13,7 +13,8 @@
1313
<% end %>
1414

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

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

0 commit comments

Comments
 (0)