Skip to content

Commit

Permalink
Fixes #3178 - Add Select All functionality to Manage Expired Embargo …
Browse files Browse the repository at this point in the history
…table.
  • Loading branch information
hweng committed Sep 10, 2018
1 parent 8f41102 commit f346fe2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions app/assets/javascripts/hyrax/batch_select_all.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ Blacklight.onLoad(function() {

// check all check boxes
$("#check_all").bind('click', check_all_page);

// select/deselect all check boxes
$("#checkAllBox").change(function () {
$("input:checkbox").prop('checked', $(this).prop("checked"));
});

// toggle button on or off based on boxes being clicked
$(".batch_document_selector").bind('click', function(e) {
Expand Down
4 changes: 2 additions & 2 deletions app/views/hyrax/batch_select/_add_button.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div data-behavior="batch-add-button">
<%= check_box_tag "batch_document_ids[]", document.id, true, class:"batch_document_selector", id: "batch_document_#{document.id}" %>
</div>
<%= check_box_tag "batch_document_ids[]", document.id, false, class:"batch_document_selector", id: "batch_document_#{document.id}" %>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<table class="embargoes table">
<thead>
<tr>
<th></th>
<th><input type="checkbox" id="checkAllBox" class="batch_document_selector"/> Select All</th>
<%= render partial: 'table_headers' %>
</tr>
</thead>
Expand All @@ -40,7 +40,7 @@
<tr data-behavior="extra" data-id="<%= curation_concern.id %>" class="extra-embargo-info">
<td></td>
<td colspan=5>
<%= check_box_tag "embargoes[#{i}][copy_visibility]", curation_concern.id, true %>
<%= check_box_tag "embargoes[#{i}][copy_visibility]", curation_concern.id, false %>
<%= t('.change_all', cc: curation_concern) %>
<%= visibility_badge(curation_concern.visibility_after_embargo) %>?
</td>
Expand Down

0 comments on commit f346fe2

Please sign in to comment.