Sha256: 94d6122561491bd9243b389934e2d6e7c7c428a6baba9e5946718e661eb00fb0

Contents?: true

Size: 820 Bytes

Versions: 6

Compression:

Stored size: 820 Bytes

Contents

module Hyrax
  class CollectionsController < ApplicationController
    include CollectionsControllerBehavior
    include BreadcrumbsForCollections
    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
        case action_name
        when 'show'
          theme
        else
          'dashboard'
        end
      end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hyrax-2.0.0.rc1 app/controllers/hyrax/collections_controller.rb
hyrax-2.0.0.beta5 app/controllers/hyrax/collections_controller.rb
hyrax-2.0.0.beta4 app/controllers/hyrax/collections_controller.rb
hyrax-2.0.0.beta3 app/controllers/hyrax/collections_controller.rb
hyrax-2.0.0.beta2 app/controllers/hyrax/collections_controller.rb
hyrax-2.0.0.beta1 app/controllers/hyrax/collections_controller.rb