Sha256: 15476ffda3e44b1bd6ba823dbeb6550aa7b6af4cd3d7da0a46dcc01be354c421

Contents?: true

Size: 935 Bytes

Versions: 10

Compression:

Stored size: 935 Bytes

Contents

module Hyrax
  module My
    class HighlightsController < MyController
      def search_builder_class
        Hyrax::MyHighlightsSearchBuilder
      end

      def index
        super
        @selected_tab = 'highlighted'
      end

      protected

        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

10 entries across 10 versions & 2 rubygems

Version Path
hyrax-1.1.1 app/controllers/hyrax/my/highlights_controller.rb
hyrax-1.1.0 app/controllers/hyrax/my/highlights_controller.rb
hyrax-1.0.5 app/controllers/hyrax/my/highlights_controller.rb
hyrax-1.0.4 app/controllers/hyrax/my/highlights_controller.rb
hyrax-1.0.3 app/controllers/hyrax/my/highlights_controller.rb
hyrax-1.0.2 app/controllers/hyrax/my/highlights_controller.rb
hyrax-1.0.1 app/controllers/hyrax/my/highlights_controller.rb
hyrax-1.0.0.rc2 app/controllers/hyrax/my/highlights_controller.rb
hyrax-1.0.0.rc1 app/controllers/hyrax/my/highlights_controller.rb
test_hyrax-0.0.1.alpha app/controllers/hyrax/my/highlights_controller.rb