Sha256: 4492c86b7e766c236d7ec126a4379998c11f1182c96acc5b4c3817449f8b9cff

Contents?: true

Size: 1021 Bytes

Versions: 25

Compression:

Stored size: 1021 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  module Forms
    module Admin
      class CollectionTypeForm
        include ActiveModel::Model
        attr_accessor :collection_type
        validates :title, presence: true

        delegate :title, :description, :brandable, :discoverable, :nestable, :sharable, :share_applies_to_new_works,
                 :require_membership, :allow_multiple_membership, :assigns_workflow,
                 :assigns_visibility, :id, :collection_type_participants, :persisted?,
                 :admin_set?, :user_collection?, :badge_color, to: :collection_type

        ##
        # @return [Boolean]
        def all_settings_disabled?
          collections? || admin_set? || user_collection?
        end

        ##
        # @return [Boolean]
        def share_options_disabled?
          all_settings_disabled? || !sharable
        end

        ##
        # @return [Boolean]
        def collections?
          collection_type.collections.any?
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
hyrax-5.0.1 app/forms/hyrax/forms/admin/collection_type_form.rb
hyrax-5.0.0 app/forms/hyrax/forms/admin/collection_type_form.rb
hyrax-5.0.0.rc3 app/forms/hyrax/forms/admin/collection_type_form.rb
hyrax-5.0.0.rc2 app/forms/hyrax/forms/admin/collection_type_form.rb
hyrax-5.0.0.rc1 app/forms/hyrax/forms/admin/collection_type_form.rb
hyrax-3.6.0 app/forms/hyrax/forms/admin/collection_type_form.rb
hyrax-4.0.0 app/forms/hyrax/forms/admin/collection_type_form.rb
hyrax-4.0.0.rc3 app/forms/hyrax/forms/admin/collection_type_form.rb
hyrax-4.0.0.rc2 app/forms/hyrax/forms/admin/collection_type_form.rb
hyrax-4.0.0.rc1 app/forms/hyrax/forms/admin/collection_type_form.rb
hyrax-3.5.0 app/forms/hyrax/forms/admin/collection_type_form.rb
hyrax-4.0.0.beta2 app/forms/hyrax/forms/admin/collection_type_form.rb
hyrax-3.4.2 app/forms/hyrax/forms/admin/collection_type_form.rb
hyrax-4.0.0.beta1 app/forms/hyrax/forms/admin/collection_type_form.rb
hyrax-3.4.1 app/forms/hyrax/forms/admin/collection_type_form.rb
hyrax-3.4.0 app/forms/hyrax/forms/admin/collection_type_form.rb
hyrax-3.3.0 app/forms/hyrax/forms/admin/collection_type_form.rb
hyrax-3.2.0 app/forms/hyrax/forms/admin/collection_type_form.rb
hyrax-3.1.0 app/forms/hyrax/forms/admin/collection_type_form.rb
hyrax-3.0.2 app/forms/hyrax/forms/admin/collection_type_form.rb