Sha256: c4cb48b0c8d95df4c29c7df89ae2de963de57350d29e9331650988c529a73f91

Contents?: true

Size: 2 KB

Versions: 36

Compression:

Stored size: 2 KB

Contents

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

      def search_builder_class
        Hyrax::My::CollectionsSearchBuilder
      end

      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

      private

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

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

        def collection_type_list_presenter
          @collection_type_list_presenter ||= Hyrax::SelectCollectionTypeListPresenter.new(current_user)
        end

        def managed_collections_count
          @managed_collection_count = Hyrax::Collections::ManagedCollectionsService.managed_collections_count(scope: self)
        end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

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