Module: Hyrax::CollectionsHelper
- Included in:
- HyraxHelperBehavior
- Defined in:
- app/helpers/hyrax/collections_helper.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
- #render_collection_links(solr_doc) ⇒ Object
-
#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
17 18 19 |
# File 'app/helpers/hyrax/collections_helper.rb', line 17 def (collection, document, label = 'Remove From Collection') render 'hyrax/collections/button_remove_from_collection', collection: collection, label: label, document: document end |
#button_for_remove_selected_from_collection(collection, label = 'Remove From Collection') ⇒ Object
21 22 23 |
# File 'app/helpers/hyrax/collections_helper.rb', line 21 def (collection, label = 'Remove From Collection') render 'hyrax/collections/button_for_remove_selected_from_collection', collection: collection, label: label end |
#has_collection_search_parameters? ⇒ Boolean
13 14 15 |
# File 'app/helpers/hyrax/collections_helper.rb', line 13 def has_collection_search_parameters? !params[:cq].blank? end |
#render_collection_links(solr_doc) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'app/helpers/hyrax/collections_helper.rb', line 3 def render_collection_links(solr_doc) collection_list = Hyrax::CollectionMemberService.run(solr_doc) return if collection_list.empty? links = collection_list.map do |collection| link_to collection.title_or_label, collection_path(collection.id) end content_tag :span, safe_join([t('hyrax.collection.is_part_of'), ': '] + links) end |
#single_item_action_remove_form_fields(form, document) ⇒ Object
add hidden fields to a form for removing a single document from a collection
26 27 28 |
# File 'app/helpers/hyrax/collections_helper.rb', line 26 def single_item_action_remove_form_fields(form, document) single_item_action_form_fields(form, document, 'remove') end |