Module: CurationConcerns::CollectionsHelperBehavior
- Included in:
- CollectionsHelper
- Defined in:
- app/helpers/curation_concerns/collections_helper_behavior.rb
Instance Method Summary collapse
- #button_for_remove_from_collection(collection, document, label = 'Remove From Collection') ⇒ Object
- #button_for_remove_selected_from_collection(collection, label = 'Remove From Collection') ⇒ Object
- #has_collection_search_parameters? ⇒ Boolean
- #hidden_collection_members ⇒ Object
-
#single_item_action_add_form_fields(form, document) ⇒ Object
add hidden fields to a form for adding a single document to a collection.
-
#single_item_action_form_fields(form, document, action) ⇒ Object
add hidden fields to a form for performing an action on a single document on a collection.
-
#single_item_action_remove_form_fields(form, document) ⇒ Object
add hidden fields to a form for removing a single document from a collection.
Instance Method Details
#button_for_remove_from_collection(collection, document, label = 'Remove From Collection') ⇒ Object
8 9 10 |
# File 'app/helpers/curation_concerns/collections_helper_behavior.rb', line 8 def (collection, document, label = 'Remove From Collection') render '/collections/button_remove_from_collection', collection: collection, label: label, document: document end |
#button_for_remove_selected_from_collection(collection, label = 'Remove From Collection') ⇒ Object
12 13 14 |
# File 'app/helpers/curation_concerns/collections_helper_behavior.rb', line 12 def (collection, label = 'Remove From Collection') render '/collections/button_for_remove_selected_from_collection', collection: collection, label: label end |
#has_collection_search_parameters? ⇒ Boolean
4 5 6 |
# File 'app/helpers/curation_concerns/collections_helper_behavior.rb', line 4 def has_collection_search_parameters? !params[:cq].blank? end |
#hidden_collection_members ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'app/helpers/curation_concerns/collections_helper_behavior.rb', line 31 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 |
#single_item_action_add_form_fields(form, document) ⇒ Object
add hidden fields to a form for adding a single document to a collection
22 23 24 |
# File 'app/helpers/curation_concerns/collections_helper_behavior.rb', line 22 def single_item_action_add_form_fields(form, document) single_item_action_form_fields(form, document, 'add') end |
#single_item_action_form_fields(form, document, action) ⇒ Object
add hidden fields to a form for performing an action on a single document on a collection
27 28 29 |
# File 'app/helpers/curation_concerns/collections_helper_behavior.rb', line 27 def single_item_action_form_fields(form, document, action) render '/collections/single_item_action_fields', form: form, document: document, action: action end |
#single_item_action_remove_form_fields(form, document) ⇒ Object
add hidden fields to a form for removing a single document from a collection
17 18 19 |
# File 'app/helpers/curation_concerns/collections_helper_behavior.rb', line 17 def single_item_action_remove_form_fields(form, document) single_item_action_form_fields(form, document, 'remove') end |