-
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.
Use M3 instead of OSD for uploaded + iiif items
- Loading branch information
1 parent
6f5838c
commit e0541f3
Showing
8 changed files
with
94 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<% if document.manifest_url.present? %> | ||
<% manifest_url = document.manifest_url.starts_with?('/') ? root_url + document.manifest_url.slice(1..-1) : document.manifest_url %> | ||
<%= content_tag :iframe, '', | ||
src: "#{Settings.iiif_embed.url}?#{{ url: manifest_url }.to_query}", | ||
allowfullscreen: true, | ||
class: 'mirador-embed-wrapper', | ||
frameborder: 0, | ||
marginwidth: 0, | ||
marginheight: 0, | ||
scrolling: 'no', | ||
width: '100%' | ||
%> | ||
<%= iiif_drag_n_drop(manifest_url) %> | ||
<% 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
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,22 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe Spotlight::CatalogController do | ||
routes { Spotlight::Engine.routes } | ||
|
||
let(:exhibit) { create(:exhibit) } | ||
let(:user) { create(:exhibit_admin, exhibit: exhibit) } | ||
|
||
before do | ||
sign_in user | ||
end | ||
|
||
describe '#manifest' do | ||
it 'sets appropriate CORS headers' do | ||
get :manifest, params: { id: 1, exhibit_id: exhibit.id, locale: 'en' } | ||
|
||
expect(response.headers.to_h).to include 'Access-Control-Allow-Origin' => '*' | ||
end | ||
end | ||
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
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,34 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe 'catalog/_embedded_mirador3', type: :view do | ||
let(:document) { SolrDocument.new(id: 'abc', iiif_manifest_url_ssi: manifest_url) } | ||
let(:manifest_url) { 'http://example.com/iiif/manifest' } | ||
|
||
before do | ||
without_partial_double_verification do | ||
allow(view).to receive_messages( | ||
document: document | ||
) | ||
end | ||
end | ||
|
||
it 'renders an iframe' do | ||
render | ||
|
||
expect(rendered).to have_css "iframe[src='https://embed.stanford.edu/iiif?#{{ url: manifest_url }.to_query}']" | ||
end | ||
|
||
context 'with a local IIIF manifest' do | ||
let(:manifest_url) { '/iiif/manifest' } | ||
|
||
it 'uses the full url to the manifest' do | ||
expected_url = 'http://test.host/iiif/manifest' | ||
|
||
render | ||
|
||
expect(rendered).to have_css "iframe[src='https://embed.stanford.edu/iiif?#{{ url: expected_url }.to_query}']" | ||
end | ||
end | ||
end |