-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #890 from sul-dlss/metadata-show-partial
Metadata show partial + basic default mods rendering
- Loading branch information
Showing
11 changed files
with
107 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,3 +124,4 @@ gem 'bibtex-ruby' | |
gem 'citeproc-ruby' | ||
gem 'csl-styles' | ||
gem 'acts-as-taggable-on' | ||
gem 'mods_display' |
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 |
---|---|---|
|
@@ -10,3 +10,4 @@ | |
@import "spotlight"; | ||
@import "sul_theme"; | ||
@import "viewers"; | ||
@import "modules/view_metadata"; |
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,16 @@ | ||
// .view-in-modal is a helper class used to show content in the modal view only | ||
// useful for modal close buttons and other stuff | ||
|
||
.view-metadata { | ||
.view-in-modal { | ||
display: none; | ||
} | ||
} | ||
|
||
#ajax-modal { | ||
.view-metadata { | ||
.view-in-modal { | ||
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 @@ | ||
<%= render_mods_display(@document).to_html.html_safe %> |
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,12 @@ | ||
<div class='container'> | ||
<div class='row'> | ||
<% # Using the Bootstrap container/row/col structure here to easily get this on its own line %> | ||
<div class='col-md-12'> | ||
<%= link_to 'View all metadata »', | ||
metadata_exhibit_solr_document_path(current_exhibit, document), | ||
data: { ajax_modal: 'trigger' }, | ||
class: 'btn btn-default' | ||
%> | ||
</div> | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div class='view-metadata'> | ||
<div class='modal-header'> | ||
<button type='button' class='ajax-modal-close close' data-dismiss='modal' aria-hidden='true'>×</button> | ||
<h3 class='modal-title'>Metadata: <%= presenter(@document).heading %></h3> | ||
</div> | ||
<div class='modal-body'> | ||
<%= render partial: 'metadata' %> | ||
</div> | ||
<div class='modal-footer'> | ||
<button type='button' class='btn btn-default view-in-modal pull-right' data-dismiss='modal'>Close</button> | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
RSpec.feature 'Metadata display' do | ||
let(:exhibit) { create(:exhibit, slug: 'default-exhibit') } | ||
|
||
before do | ||
visit spotlight.exhibit_solr_document_path(exhibit_id: exhibit.slug, id: 'gk885tn1705') | ||
end | ||
|
||
it 'view metadata link links through to page' do | ||
click_link 'View all metadata »' | ||
expect(page).to have_css 'h3', text: 'Metadata: Afrique Physique.' | ||
expect(page).to have_css 'dt', text: 'Title' | ||
expect(page).to have_css 'dd', text: 'Afrique Physique.' | ||
end | ||
it 'opens view metadata in modal', js: true do | ||
click_link 'View all metadata »' | ||
within '#ajax-modal' do | ||
expect(page).to have_css 'h3', text: 'Metadata: Afrique Physique.' | ||
expect(page).to have_css 'dt', text: 'Title' | ||
expect(page).to have_css 'dd', text: 'Afrique Physique.' | ||
end | ||
end | ||
end |