diff --git a/vote/static/vote/js/vote.js b/vote/static/vote/js/vote.js index df664baed055f9b846f7f6e075f2e2836ec67cfe..866f51e526311303087c0725f706295c6fdc9210 100644 --- a/vote/static/vote/js/vote.js +++ b/vote/static/vote/js/vote.js @@ -18,3 +18,13 @@ document.querySelectorAll(".vote-list input[type='radio']").forEach(function(inp voteList.querySelector("tfoot .yes").innerText = (max-count) + " remaining"; } }); + +document.querySelectorAll("#all-yes").forEach(function(btn) { + btn.onclick = function() { + var voteList = document.querySelector('.vote-list'); + voteList.querySelectorAll("input[type='radio'][value='accept']").forEach(function(input) { + input.checked = true; + input.onchange(); + }); + } +}); diff --git a/vote/templates/vote/vote.html b/vote/templates/vote/vote.html index e00b7aefb50323f22f2590937892b1201798a62e..82a26028f6558ac686adf594cc9276f35b321f0d 100644 --- a/vote/templates/vote/vote.html +++ b/vote/templates/vote/vote.html @@ -41,6 +41,11 @@ Your vote is anonymous. </div> </div> + {% if max_votes_yes > 1 and max_votes_yes >= form.num_applications %} + <div class="mt-4 text-right"> + <button type="button" class="btn btn-success" id="all-yes">Select YES for all {{ form.num_applications }} applicants</button> + </div> + {% endif %} <table class="table table-sm vote-list" data-max-votes-yes="{{ max_votes_yes }}"> <thead class="thead-light"> <tr>