Module: CommonwealthVlrEngine::ControllerOverride
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/commonwealth-vlr-engine/controller_override.rb
Instance Method Summary collapse
-
#add_institution_fields ⇒ Object
add institutions if configured.
-
#formats_facet ⇒ Object
displays values and pagination links for Format field.
-
#get_object_files ⇒ Object
TODO: refactor how views access files/volumes/etc.
-
#has_volumes?(document) ⇒ Boolean
TODO: refactor how views access files/volumes/etc.
-
#mlt_search ⇒ Object
if this is ‘more like this’ search, solr id = params.
- #set_nav_context ⇒ Object
Instance Method Details
#add_institution_fields ⇒ Object
add institutions if configured
214 215 216 217 218 219 |
# File 'lib/commonwealth-vlr-engine/controller_override.rb', line 214 def add_institution_fields if t('blacklight.home.browse.institutions.enabled') blacklight_config.add_facet_field 'physical_location_ssim', label: 'Institution', limit: 8, sort: 'count', collapse: false blacklight_config.add_index_field 'institution_name_ssim', label: 'Institution', helper_method: :index_institution_link end end |
#formats_facet ⇒ Object
displays values and pagination links for Format field
184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/commonwealth-vlr-engine/controller_override.rb', line 184 def formats_facet @nav_li_active = 'explore' @page_title = t('blacklight.formats.page_title', :application_name => t('blacklight.application_name')) @facet = blacklight_config.facet_fields['genre_basic_ssim'] @response = get_facet_field_response(@facet.key, params, {"f.genre_basic_ssim.facet.limit" => -1}) @display_facet = @response.aggregations[@facet.key] @pagination = facet_paginator(@facet, @display_facet) render :facet end |
#get_object_files ⇒ Object
TODO: refactor how views access files/volumes/etc.
205 206 207 |
# File 'lib/commonwealth-vlr-engine/controller_override.rb', line 205 def get_object_files @object_files = get_files(params[:id]) end |
#has_volumes?(document) ⇒ Boolean
TODO: refactor how views access files/volumes/etc. returns the child volumes for Book objects (if they exist) needs to be in this module because CommonwealthVlrEngine::Finder methods aren’t accessible in helpers/views
224 225 226 227 228 229 230 231 232 |
# File 'lib/commonwealth-vlr-engine/controller_override.rb', line 224 def has_volumes?(document) case document[blacklight_config.show.display_type_field.to_sym] when 'Book' volumes = get_volume_objects(document.id) else volumes = nil end volumes.presence end |
#mlt_search ⇒ Object
if this is ‘more like this’ search, solr id = params
198 199 200 201 202 |
# File 'lib/commonwealth-vlr-engine/controller_override.rb', line 198 def mlt_search if params[:mlt_id] blacklight_config.search_builder_class = CommonwealthMltSearchBuilder end end |
#set_nav_context ⇒ Object
209 210 211 |
# File 'lib/commonwealth-vlr-engine/controller_override.rb', line 209 def set_nav_context @nav_li_active = 'search' end |