Module: IiifPrint::IiifManifestPresenterDecorator
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/presenters/iiif_print/iiif_manifest_presenter_decorator.rb
Instance Attribute Summary collapse
-
#base_url ⇒ Object
Extending the presenter to the base url which includes the protocol.
Instance Method Summary collapse
- #manifest_metadata ⇒ Object
- #search_service ⇒ Object
-
#sequence_rendering ⇒ Array<Hash{String => String}>
OVERRIDE: Hyrax 3x, avoid nil returning to IIIF Manifest gem.
Instance Attribute Details
#base_url ⇒ Object
Extending the presenter to the base url which includes the protocol. We need the base url to render the facet links and normalize the interface.
8 9 10 |
# File 'app/presenters/iiif_print/iiif_manifest_presenter_decorator.rb', line 8 def base_url @base_url end |
Instance Method Details
#manifest_metadata ⇒ Object
10 11 12 13 |
# File 'app/presenters/iiif_print/iiif_manifest_presenter_decorator.rb', line 10 def # ensure we are using a SolrDocument ||= IiifPrint.(work: model.solr_document, presenter: self) end |
#search_service ⇒ Object
15 16 17 |
# File 'app/presenters/iiif_print/iiif_manifest_presenter_decorator.rb', line 15 def search_service Rails.application.routes.url_helpers.solr_document_iiif_search_url(id, host: hostname) end |
#sequence_rendering ⇒ Array<Hash{String => String}>
OVERRIDE: Hyrax 3x, avoid nil returning to IIIF Manifest gem
23 24 25 26 27 28 29 30 31 32 |
# File 'app/presenters/iiif_print/iiif_manifest_presenter_decorator.rb', line 23 def sequence_rendering Array(try(:rendering_ids)).map do |file_set_id| rendering = file_set_presenters.find { |p| p.id == file_set_id } return [] unless rendering { '@id' => Hyrax::Engine.routes.url_helpers.download_url(rendering.id, host: hostname), 'format' => rendering.mime_type.presence || I18n.t("hyrax.manifest.unknown_mime_text"), 'label' => I18n.t("hyrax.manifest.download_text") + (rendering.label || '') } end.flatten end |