Skip to content

Commit dbcbc68

Browse files
authored
Merge pull request #189 from MITLibraries/gdt-319-restructure-access-links
Consolidate full record access links in sidebar
2 parents 02269ec + 0439f6c commit dbcbc68

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)