Sha256: 5dc7b7b5619b7a260351089879b463f4d438b8dd8565a726bc4600a232830ff0

Contents?: true

Size: 852 Bytes

Versions: 8

Compression:

Stored size: 852 Bytes

Contents

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

    def index
      super
      @selected_tab = 'highlighted'
    end

    protected

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

      def query_solr
        return empty_search_result if Sufia::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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sufia-7.4.1 app/controllers/my/highlights_controller.rb
sufia-7.4.0 app/controllers/my/highlights_controller.rb
sufia-7.3.1 app/controllers/my/highlights_controller.rb
sufia-7.3.0 app/controllers/my/highlights_controller.rb
sufia-7.3.0.rc3 app/controllers/my/highlights_controller.rb
sufia-7.3.0.rc2 app/controllers/my/highlights_controller.rb
sufia-7.3.0.rc1 app/controllers/my/highlights_controller.rb
sufia-7.2.0 app/controllers/my/highlights_controller.rb