Sha256: 593ab2ce1841b26d311756a8a34552539930a0edb05a909ab807ed1a32e6a7a7

Contents?: true

Size: 1.71 KB

Versions: 33

Compression:

Stored size: 1.71 KB

Contents

module Hyrax
  module My
    class WorksController < MyController
      # Define collection specific filter facets.
      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
      configure_facets

      class_attribute :create_work_presenter_class
      self.create_work_presenter_class = Hyrax::SelectTypeListPresenter

      # Search builder for a list of works that belong to me
      # Override of Blacklight::RequestBuilders
      def search_builder_class
        Hyrax::My::WorksSearchBuilder
      end

      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

      private

        def collections_service
          Hyrax::CollectionsService.new(self)
        end

        def search_action_url(*args)
          hyrax.my_works_url(*args)
        end

        # The url of the "more" link for additional facet values
        def search_facet_path(args = {})
          hyrax.my_dashboard_works_facet_path(args[:id])
        end

        def managed_works_count
          @managed_works_count = Hyrax::Works::ManagedWorksService.managed_works_count(scope: self)
        end
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
hyrax-2.9.6 app/controllers/hyrax/my/works_controller.rb
hyrax-2.9.5 app/controllers/hyrax/my/works_controller.rb
hyrax-2.9.4 app/controllers/hyrax/my/works_controller.rb
hyrax-2.9.3 app/controllers/hyrax/my/works_controller.rb
hyrax-2.9.2 app/controllers/hyrax/my/works_controller.rb
hyrax-2.9.1 app/controllers/hyrax/my/works_controller.rb
hyrax-2.9.0 app/controllers/hyrax/my/works_controller.rb
hyrax-2.8.0 app/controllers/hyrax/my/works_controller.rb
hyrax-2.7.2 app/controllers/hyrax/my/works_controller.rb
hyrax-2.7.1 app/controllers/hyrax/my/works_controller.rb
hyrax-2.7.0 app/controllers/hyrax/my/works_controller.rb
hyrax-2.6.0 app/controllers/hyrax/my/works_controller.rb
hyrax-2.5.1 app/controllers/hyrax/my/works_controller.rb
hyrax-2.5.0 app/controllers/hyrax/my/works_controller.rb
hyrax-3.0.0.pre.beta2 app/controllers/hyrax/my/works_controller.rb
hyrax-2.4.1 app/controllers/hyrax/my/works_controller.rb
hyrax-3.0.0.pre.beta1 app/controllers/hyrax/my/works_controller.rb
hyrax-2.4.0 app/controllers/hyrax/my/works_controller.rb
hyrax-2.3.3 app/controllers/hyrax/my/works_controller.rb
hyrax-2.3.2 app/controllers/hyrax/my/works_controller.rb