Skip to content

Commit

Permalink
Merge pull request #189 from MITLibraries/gdt-319-restructure-access-…
Browse files Browse the repository at this point in the history
…links

Consolidate full record access links in sidebar
  • Loading branch information
jazairi committed May 10, 2024
2 parents 02269ec + 0439f6c commit dbcbc68
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 dbcbc68

Please sign in to comment.