Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/helpers/record_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def gis_access_link(metadata)

# At this point, we don't show download links for non-MIT records. For MIT records, the download link is stored
# consistently as a download link. We are confirming that the link text is 'Data' for added confirmation.
if access_type(metadata) == 'Not owned by MIT'
if access_type(metadata) == 'unknown: check with owning institution'
links.select { |link| link['kind'] == 'Website' }.first['url']
else
links.select { |link| link['kind'] == 'Download' && link['text'] == 'Data' }.first['url']
Expand Down
4 changes: 2 additions & 2 deletions app/views/record/_access_button.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<% return if @record.blank? %>

<div class="access-button-container <%= display %>">
<% if access_type(@record) == 'Free/open to all' %>
<% 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' %>
<% elsif access_type(@record) == 'MIT authentication required' %>
<a class="btn button-primary access-button" href="<%= gis_access_link(@record) %>">
Download geodata files <span class="auth-notice">MIT authentication</span>
</a>
Expand Down
2 changes: 1 addition & 1 deletion app/views/record/_record_geo.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<% end %>

<div class="record-access-links">
<% if access_type(@record) != 'Not owned by MIT' && source_metadata_available?(@record['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 %>
Expand Down
6 changes: 3 additions & 3 deletions app/views/shared/_geo_data_info.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<% if parse_geo_dates(metadata['dates']) %>
<li><%= parse_geo_dates(metadata['dates']) %></li>
<% end %>
<% if access_type(metadata) == 'Not owned by MIT' %>
<% if access_type(metadata) == 'unknown: check with owning institution' %>
<li>
<%= access_type(metadata) %>
Not owned by MIT
<span class="other-provider">(<%= link_to "Owned by #{metadata['provider']}", gis_access_link(metadata) %>)</span>
</li>
<% elsif access_type(metadata) == 'MIT authentication' %>
<% elsif access_type(metadata) == 'MIT authentication required' %>
<li><span class="access-restricted"><%= access_type(metadata) %></span></li>
<% end %>
</ul>
12 changes: 6 additions & 6 deletions test/helpers/record_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ class RecordHelperTest < ActionView::TestCase
'kind' => 'bar'
},
{
'description' => 'Free/open to all',
'description' => 'no authentication required',
'kind' => 'Access to files'
}
]
}
assert_equal 'Free/open to all', access_type(rights)
assert_equal 'no authentication required', access_type(rights)
end

test 'gis_access_link returns nil if access type is blank' do
Expand Down Expand Up @@ -157,7 +157,7 @@ class RecordHelperTest < ActionView::TestCase
'kind' => 'bar'
},
{
'description' => 'Free/open to all',
'description' => 'no authentication required',
'kind' => 'Access to files'
}
]
Expand All @@ -173,7 +173,7 @@ class RecordHelperTest < ActionView::TestCase
'kind' => 'bar'
},
{
'description' => 'Not owned by MIT',
'description' => 'unknown: check with owning institution',
'kind' => 'Access to files'
}
],
Expand Down Expand Up @@ -202,7 +202,7 @@ class RecordHelperTest < ActionView::TestCase
'kind' => 'bar'
},
{
'description' => 'Free/open to all',
'description' => 'no authentication required',
'kind' => 'Access to files'
}
],
Expand All @@ -226,7 +226,7 @@ class RecordHelperTest < ActionView::TestCase
'kind' => 'bar'
},
{
'description' => 'MIT authenticated',
'description' => 'MIT authentication required',
'kind' => 'Access to files'
}
],
Expand Down