Sha256: cf600a4924c2e9032273d8a1fbe373356dcc4405b07f9aa58d65286ee6ad0276

Contents?: true

Size: 1.58 KB

Versions: 29

Compression:

Stored size: 1.58 KB

Contents

# View Helpers for Hydra Collections functionality
module CurationConcerns
  module CollectionsHelperBehavior
    def has_collection_search_parameters?
      !params[:cq].blank?
    end

    def button_for_remove_from_collection(collection, document, label = 'Remove From Collection')
      render '/collections/button_remove_from_collection', collection: collection, label: label, document: document
    end

    def button_for_remove_selected_from_collection(collection, label = 'Remove From Collection')
      render '/collections/button_for_remove_selected_from_collection', collection: collection, label: label
    end

    # add hidden fields to a form for removing a single document from a collection
    def single_item_action_remove_form_fields(form, document)
      single_item_action_form_fields(form, document, 'remove')
    end

    # add hidden fields to a form for adding a single document to a collection
    def single_item_action_add_form_fields(form, document)
      single_item_action_form_fields(form, document, 'add')
    end

    # add hidden fields to a form for performing an action on a single document on a collection
    def single_item_action_form_fields(form, document, action)
      render '/collections/single_item_action_fields', form: form, document: document, action: action
    end

    def hidden_collection_members
      erbout = ''
      if params[:batch_document_ids].present?
        params[:batch_document_ids].each do |batch_item|
          erbout.concat hidden_field_tag('batch_document_ids[]', batch_item)
        end
      end
      erbout.html_safe
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
curation_concerns-1.5.0 app/helpers/curation_concerns/collections_helper_behavior.rb
curation_concerns-1.4.0 app/helpers/curation_concerns/collections_helper_behavior.rb
curation_concerns-1.3.3 app/helpers/curation_concerns/collections_helper_behavior.rb
curation_concerns-1.3.2 app/helpers/curation_concerns/collections_helper_behavior.rb
curation_concerns-1.3.1 app/helpers/curation_concerns/collections_helper_behavior.rb
curation_concerns-1.3.0 app/helpers/curation_concerns/collections_helper_behavior.rb
curation_concerns-1.2.0 app/helpers/curation_concerns/collections_helper_behavior.rb
curation_concerns-1.1.2 app/helpers/curation_concerns/collections_helper_behavior.rb
curation_concerns-1.1.1 app/helpers/curation_concerns/collections_helper_behavior.rb
curation_concerns-1.1.0 app/helpers/curation_concerns/collections_helper_behavior.rb
curation_concerns-1.0.0 app/helpers/curation_concerns/collections_helper_behavior.rb
curation_concerns-1.0.0.beta10 app/helpers/curation_concerns/collections_helper_behavior.rb
curation_concerns-1.0.0.beta9 app/helpers/curation_concerns/collections_helper_behavior.rb
curation_concerns-1.0.0.beta8 app/helpers/curation_concerns/collections_helper_behavior.rb
curation_concerns-1.0.0.beta7 app/helpers/curation_concerns/collections_helper_behavior.rb
curation_concerns-1.0.0.beta6 app/helpers/curation_concerns/collections_helper_behavior.rb
curation_concerns-1.0.0.beta5 app/helpers/curation_concerns/collections_helper_behavior.rb
curation_concerns-1.0.0.beta4 app/helpers/curation_concerns/collections_helper_behavior.rb
curation_concerns-1.0.0.beta3 app/helpers/curation_concerns/collections_helper_behavior.rb
curation_concerns-1.0.0.beta2 app/helpers/curation_concerns/collections_helper_behavior.rb