Sha256: 08d9f5c1cdf1d3996200ee00713784bdef975719cbded7ea07f10bad05af0f88

Contents?: true

Size: 989 Bytes

Versions: 9

Compression:

Stored size: 989 Bytes

Contents

module Hyrax
  class CitationsController < ApplicationController
    include WorksControllerBehavior
    include Breadcrumbs
    include SingularSubresourceController

    layout :decide_layout
    before_action :build_breadcrumbs, only: [:work, :file]

    def work
      show
    end

    def file
      # We set _@presenter_ here so it isn't set in WorksControllerBehavior#presenter
      # which is intended to find works (not files)
      solr_file = ::SolrDocument.find(params[:id])
      authorize! :show, solr_file
      @presenter = FileSetPresenter.new(solr_file, current_ability, request)
      show
    end

    private

      def show_presenter
        WorkShowPresenter
      end

      def decide_layout
        case action_name
        when 'work', 'file'
          theme
        else
          # Not currently used in this controller, but left here to
          # support dashboard-based work views which are ticketed
          'dashboard'
        end
      end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
hyrax-2.0.3 app/controllers/hyrax/citations_controller.rb
hyrax-2.0.2 app/controllers/hyrax/citations_controller.rb
hyrax-2.0.1 app/controllers/hyrax/citations_controller.rb
hyrax-2.0.0 app/controllers/hyrax/citations_controller.rb
hyrax-2.0.0.rc3 app/controllers/hyrax/citations_controller.rb
hyrax-2.0.0.rc2 app/controllers/hyrax/citations_controller.rb
hyrax-2.0.0.rc1 app/controllers/hyrax/citations_controller.rb
hyrax-2.0.0.beta5 app/controllers/hyrax/citations_controller.rb
hyrax-2.0.0.beta4 app/controllers/hyrax/citations_controller.rb