Module: IiifPrint::IiifHelperDecorator

Defined in:
app/helpers/iiif_print/iiif_helper_decorator.rb

Instance Method Summary collapse

Instance Method Details

#iiif_viewer_display(work_presenter, locals = {}) ⇒ Object



7
8
9
10
# File 'app/helpers/iiif_print/iiif_helper_decorator.rb', line 7

def iiif_viewer_display(work_presenter, locals = {})
  render iiif_viewer_display_partial(work_presenter),
         locals.merge(presenter: work_presenter)
end

#iiif_viewer_display_partial(work_presenter) ⇒ Object



12
13
14
# File 'app/helpers/iiif_print/iiif_helper_decorator.rb', line 12

def iiif_viewer_display_partial(work_presenter)
  'hyrax/base/iiif_viewers/' + work_presenter.iiif_viewer.to_s
end

#universal_viewer_base_urlObject



16
17
18
# File 'app/helpers/iiif_print/iiif_helper_decorator.rb', line 16

def universal_viewer_base_url
  "#{request&.base_url}#{IiifPrint.config.uv_base_path}"
end

#universal_viewer_config_urlObject



20
21
22
# File 'app/helpers/iiif_print/iiif_helper_decorator.rb', line 20

def universal_viewer_config_url
  "#{request&.base_url}#{IiifPrint.config.uv_config_path}"
end

#uv_search_paramObject

Extract query param from search



25
26
27
28
29
30
31
32
# File 'app/helpers/iiif_print/iiif_helper_decorator.rb', line 25

def uv_search_param
  search_params = current_search_session.try(:query_params) || {}
  q = search_params['q'].presence || ''

  return unless search_params[:highlight] || params[:highlight]

  "&q=#{url_encode(q)}" if q.present?
end