Class: Hyrax::My::CollectionsController

Inherits:
Hyrax::MyController show all
Defined in:
app/controllers/hyrax/my/collections_controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Collections::AcceptsBatches

#batch, #batch=, #check_for_empty_batch?

Class Method Details

.configure_facetsObject

Define collection specific filter facets.



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/hyrax/my/collections_controller.rb', line 5

def self.configure_facets
  configure_blacklight do |config|
    # Name of pivot facet must match field name that uses helper_method
    config.add_facet_field Collection.collection_type_gid_document_field_name,
                           helper_method: :collection_type_label, limit: 5,
                           pivot: ['has_model_ssim', Collection.collection_type_gid_document_field_name],
                           label: I18n.t('hyrax.dashboard.my.heading.collection_type')
    # This causes AdminSets to also be shown with the Collection Type label
    config.add_facet_field 'has_model_ssim',
                           label: I18n.t('hyrax.dashboard.my.heading.collection_type'),
                           limit: 5, show: false
  end
end

Instance Method Details

#indexObject



24
25
26
27
28
29
30
31
# File 'app/controllers/hyrax/my/collections_controller.rb', line 24

def index
  add_breadcrumb t(:'hyrax.controls.home'), root_path
  add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path
  add_breadcrumb t(:'hyrax.admin.sidebar.collections'), hyrax.my_collections_path
  collection_type_list_presenter
  managed_collections_count
  super
end

#search_builder_classObject



20
21
22
# File 'app/controllers/hyrax/my/collections_controller.rb', line 20

def search_builder_class
  Hyrax::My::CollectionsSearchBuilder
end