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.


6
7
8
9
10
11
12
# File 'app/controllers/hyrax/my/works_controller.rb', line 6

def self.configure_facets
  configure_blacklight do |config|
    config.search_builder_class = Hyrax::My::WorksSearchBuilder
    config.add_facet_field "admin_set_sim", limit: 5
    config.add_facet_field "member_of_collections_ssim", limit: 5
  end
end

Instance Method Details

#indexObject


18
19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/hyrax/my/works_controller.rb', line 18

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