-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Why these changes are being introduced: The GeoData app has specific design requirements for the record view. Relevant ticket(s): * [GDT-131](https://mitlibraries.atlassian.net/browse/GDT-131) * [GDT-130](https://mitlibraries.atlassian.net/browse/GDT-130) How this addresses that need: This adds a `record_geo` partial that includes metadata specific to GDT records, such as locations and a metadata download link. It also changes where the `access_button` partial is displayed depending on screen width, and it adds a 'back' button to the top of the record if `url_for(:back)` resembles a search results page. Side effects of this change: * Some of the changes introduced in GDT-130 (currently in review) have been overwritten by this commit, as some styles and markup are shared by both views. Specifically, the `geo_data_info` and `_authors` partials have been moved to the shared directory, and a new `shared` SCSS partial contains styles used in `result` and `record. * Several helper methods have been added to parse the metadata needed for the record view.
- Loading branch information
Showing
17 changed files
with
321 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
.result, | ||
.full-record { | ||
.authors { | ||
font-size: $fs-large; | ||
font-weight: $fw-bold; | ||
margin-bottom: 0.6em; | ||
} | ||
|
||
.data-info { | ||
font-weight: $fw-bold; | ||
font-size: $fs-base; | ||
margin-bottom: 1em; | ||
li:after { | ||
margin: 0 .6rem; | ||
content: " | "; | ||
} | ||
li:last-child:after { | ||
content: ""; | ||
} | ||
.access-restricted:after { | ||
font-family: FontAwesome; | ||
content: "\f023"; | ||
margin-left: 0.8rem; | ||
color: $gray-l1; | ||
} | ||
.other-provider { | ||
font-weight: $fw-normal; | ||
} | ||
@media (max-width: $bp-screen-sm) { | ||
li:nth-last-child(2):after { | ||
content: ""; | ||
} | ||
li:last-child { | ||
display: block; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<% if url_for(:back)&.starts_with?([root_url, 'results'].join('')) %> | ||
<div class="return-to-results"><%= link_to 'Return to search results', :back %></div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<h3 class="section-title">More information</h3> | ||
|
||
<ul class="list-moreinfo"> | ||
<!-- Add publisher when the data is available --> | ||
<% if issued_date(metadata['dates']).present? %> | ||
<li>Date issued: <%= issued_date(metadata['dates']) %></li> | ||
<% end %> | ||
<% if coverage_date(metadata['dates']).present? %> | ||
<li>Geodata coverage date: <%= coverage_date(metadata['dates']) %></li> | ||
<% end %> | ||
<% if places(metadata['locations']).present? %> | ||
<% if places(metadata['locations']).length > 1 %> | ||
<li>Places: | ||
<ul> | ||
<% places(metadata['locations']).each do |place| %> | ||
<li><%= place %></li> | ||
<% end %> | ||
</ul> | ||
</li> | ||
<% else %> | ||
<li>Place: <%= places(metadata['locations']).first %></li> | ||
<% end %> | ||
<% end %> | ||
<% if metadata['provider'] %> | ||
<li>Provider: <%= metadata['provider'] %></li> | ||
<% end %> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<div class="gridband layout-3q1q wrap-full-record"> | ||
<div class="col3q box-content region full-record" data-region="Full record"> | ||
<h2 class="record-title"> | ||
<span class="sr">Title: </span> | ||
<% if @record['title'].present? %> | ||
<%= @record['title'] %> | ||
<% else %> | ||
No title provided for this item. | ||
<% end %> | ||
</h2> | ||
|
||
<div class="data-info"> | ||
<%= render partial: 'shared/geo_data_info', locals: { metadata: @record } %> | ||
</div> | ||
|
||
<% if @record['contributors'].present? %> | ||
<p class="authors"> | ||
<%= render partial: 'shared/authors', locals: { contributors: @record['contributors'] } %> | ||
</p> | ||
<% end %> | ||
|
||
<% if @record['summary'].present? %> | ||
<h3 class="section-title">Description</h3> | ||
<% @record['summary'].each do |paragraph| %> | ||
<p> | ||
<%= sanitize paragraph, tags: %w(p strong em a), attributes: %w(href) %> | ||
</p> | ||
<% end %> | ||
<% end %> | ||
|
||
<% if @record['subjects'].present? %> | ||
<h3 class="section-title">Subjects</h3> | ||
<ul> | ||
<% @record['subjects'].each do |subject| %> | ||
<li><%= subject['value'].join(';' ) %></li> | ||
<% end %> | ||
</ul> | ||
<% end %> | ||
|
||
<% if more_info?(@record) %> | ||
<%= render partial: 'more_info', locals: { metadata: @record } %> | ||
<% end %> | ||
|
||
<div class="record-access-links"> | ||
<% if access_type(@record) != 'Not owned by MIT' && 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> | ||
</div> | ||
|
||
<%= render('sidebar') %> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<ul class="list-inline"> | ||
<li><%= metadata['contentType']&.each { |type| type['value'] }&.join(' ; ') %></li> | ||
<% if parse_geo_dates(metadata['dates']) %> | ||
<%= parse_geo_dates(metadata['dates']) %> | ||
<% end %> | ||
<% if access_type(metadata) == 'Not owned by MIT' %> | ||
<li> | ||
<%= access_type(metadata) %> | ||
<span class="other-provider">(<%= link_to "Owned by #{metadata['provider']}", gis_access_link(metadata) %>)</span> | ||
</li> | ||
<% elsif access_type(metadata) == 'MIT authentication' %> | ||
<li><span class="access-restricted"><%= access_type(metadata) %></span></li> | ||
<% end %> | ||
</ul> |
Oops, something went wrong.