Sha256: 1fea9ed76bb12451440b78be6d008c92a46110f1c14b3d905d819b43343f3074

Contents?: true

Size: 945 Bytes

Versions: 48

Compression:

Stored size: 945 Bytes

Contents

module Hyrax
  module My
    class HighlightsController < MyController
      # Override of Blacklight::RequestBuilders
      def search_builder_class
        Hyrax::My::HighlightsSearchBuilder
      end

      def index
        super
      end

      private

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

        def query_solr
          return empty_search_result if Hyrax::TrophyPresenter.find_by_user(@user).count.zero?
          super
        end

        def empty_search_result
          solr_response = Blacklight::Solr::Response.new(empty_request, {})
          docs = []
          [solr_response, docs]
        end

        def empty_request
          {
            responseHeader: {
              status: 0,
              params: { wt: 'ruby', rows: '11', q: '*:*' }
            },
            response: { numFound: 0, start: 0, docs: [] }
          }
        end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

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