Sha256: de3ecc0a8a453ba18ab76038a16b56322edd3943b174e5766bb8ad42cae8de4b

Contents?: true

Size: 924 Bytes

Versions: 36

Compression:

Stored size: 924 Bytes

Contents

module Hyrax
  class CollectionsController < ApplicationController
    include CollectionsControllerBehavior
    include BreadcrumbsForCollections
    with_themed_layout :decide_layout
    load_and_authorize_resource except: [:index, :show, :create], instance_name: :collection

    # Renders a JSON response with a list of files in this collection
    # This is used by the edit form to populate the thumbnail_id dropdown
    def files
      result = form.select_files.map do |label, id|
        { id: id, text: label }
      end
      render json: result
    end

    private

      def form
        @form ||= form_class.new(@collection, current_ability, repository)
      end

      def decide_layout
        layout = case action_name
                 when 'show'
                   '1_column'
                 else
                   'dashboard'
                 end
        File.join(theme, layout)
      end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

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