Sha256: 40cab24432883dc8dbdb67d892ae0750fead5d173b08cd6994008741a0516706

Contents?: true

Size: 827 Bytes

Versions: 4

Compression:

Stored size: 827 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 @user.trophy_works.count == 0
        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

4 entries across 4 versions & 1 rubygems

Version Path
sufia-7.0.0.beta4 app/controllers/my/highlights_controller.rb
sufia-7.0.0.beta3 app/controllers/my/highlights_controller.rb
sufia-7.0.0.beta2 app/controllers/my/highlights_controller.rb
sufia-7.0.0.beta1 app/controllers/my/highlights_controller.rb