Class: Hyrax::My::WorksController

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

Direct Known Subclasses

Dashboard::WorksController

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
# File 'app/controllers/hyrax/my/works_controller.rb', line 5

def self.configure_facets
  configure_blacklight do |config|
    config.add_facet_field solr_name("admin_set", :facetable), limit: 5
    config.add_facet_field solr_name('member_of_collections', :symbol), limit: 5
  end
end

Instance Method Details

#indexObject


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

def index
  # The user's collections for the "add to collection" form
  @user_collections = collections_service.search_results(:deposit)

  add_breadcrumb t(:'hyrax.controls.home'), root_path
  add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path
  add_breadcrumb t(:'hyrax.admin.sidebar.works'), hyrax.my_works_path
  managed_works_count
  @create_work_presenter = create_work_presenter_class.new(current_user)
  super
end

#search_builder_classObject

Search builder for a list of works that belong to me Override of Blacklight::RequestBuilders


18
19
20
# File 'app/controllers/hyrax/my/works_controller.rb', line 18

def search_builder_class
  Hyrax::My::WorksSearchBuilder
end