Module: BatchEditHelper
- Defined in:
- app/helpers/batch_edit_helper.rb
Overview
View Helpers for Hydra Batch Edit functionality
Instance Method Summary collapse
-
#batch_check_all(label = 'Use all results') ⇒ Object
Displays the check all button to select/deselect items for your batch.
-
#batch_edit_continue(label = 'Update Selected') ⇒ Object
Displays the button that users click when they are done selecting items for a batch.
-
#batch_edit_delete_batch(label = 'Delete Selected', confirm = 'Are you sure?') ⇒ Object
Displays the button that users click when they are done selecting items for a batch to Remove those items from the repository.
-
#batch_edit_select(document) ⇒ Object
Displays the button to select/deselect items for your batch.
-
#batch_edit_state ⇒ Object
Returns true if user has activated batch edit mode in session.
-
#batch_edit_tools ⇒ Object
Displays the batch edit tools.
-
#item_in_batch?(doc_id) ⇒ Boolean
determines if the given document id is in the batch.
Instance Method Details
#batch_check_all(label = 'Use all results') ⇒ Object
Displays the check all button to select/deselect items for your batch. Put this in your search result page template. We put it in catalog/index.html
31 32 33 |
# File 'app/helpers/batch_edit_helper.rb', line 31 def batch_check_all(label = 'Use all results') render :partial=>'/batch_edits/check_all', :locals=>{:label=>label} end |
#batch_edit_continue(label = 'Update Selected') ⇒ Object
Displays the button that users click when they are done selecting items for a batch. Put this in your search result page template. We put it in catalog/index.html
20 21 22 |
# File 'app/helpers/batch_edit_helper.rb', line 20 def batch_edit_continue(label = 'Update Selected') render :partial => '/batch_edits/next_page', :locals=>{:label=>label} end |
#batch_edit_delete_batch(label = 'Delete Selected', confirm = 'Are you sure?') ⇒ Object
Displays the button that users click when they are done selecting items for a batch to Remove those items from the repository. Put this in your search result page template. We put it in catalog/index.html
36 37 38 |
# File 'app/helpers/batch_edit_helper.rb', line 36 def batch_edit_delete_batch(label = 'Delete Selected', confirm = 'Are you sure?') render :partial => '/batch_edits/delete_batch', :locals=>{:label=>label, :confirm=>confirm} end |
#batch_edit_select(document) ⇒ Object
Displays the button to select/deselect items for your batch. Call this in the index partial that’s rendered for each search result.
26 27 28 |
# File 'app/helpers/batch_edit_helper.rb', line 26 def batch_edit_select(document) return document end |
#batch_edit_state ⇒ Object
Returns true if user has activated batch edit mode in session
10 11 12 |
# File 'app/helpers/batch_edit_helper.rb', line 10 def batch_edit_state session[:batch_edit_state] ||= 'off' end |
#batch_edit_tools ⇒ Object
Displays the batch edit tools. Put this in your search result page template. We recommend putting it in catalog/_sort_and_per_page.html.erb
15 16 17 |
# File 'app/helpers/batch_edit_helper.rb', line 15 def batch_edit_tools render :partial=>'/batch_edits/tools' end |
#item_in_batch?(doc_id) ⇒ Boolean
determines if the given document id is in the batch
5 6 7 |
# File 'app/helpers/batch_edit_helper.rb', line 5 def item_in_batch?(doc_id) session[:batch_document_ids] && session[:batch_document_ids].include?(doc_id) ? true : false end |