From 3ab2975f70b08ef94f522629a91fc83c2b1ab51c Mon Sep 17 00:00:00 2001 From: Julien Schmidt <js@stusta.net> Date: Wed, 13 May 2020 12:56:39 +0200 Subject: [PATCH] show yes-all button only when javascript is activated --- vote/static/vote/js/vote.js | 1 + vote/templates/vote/vote.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/vote/static/vote/js/vote.js b/vote/static/vote/js/vote.js index 866f51e..3f20112 100644 --- a/vote/static/vote/js/vote.js +++ b/vote/static/vote/js/vote.js @@ -20,6 +20,7 @@ document.querySelectorAll(".vote-list input[type='radio']").forEach(function(inp }); document.querySelectorAll("#all-yes").forEach(function(btn) { + btn.parentNode.classList.remove('d-none'); btn.onclick = function() { var voteList = document.querySelector('.vote-list'); voteList.querySelectorAll("input[type='radio'][value='accept']").forEach(function(input) { diff --git a/vote/templates/vote/vote.html b/vote/templates/vote/vote.html index 82a2602..10e8916 100644 --- a/vote/templates/vote/vote.html +++ b/vote/templates/vote/vote.html @@ -42,7 +42,7 @@ </div> </div> {% if max_votes_yes > 1 and max_votes_yes >= form.num_applications %} - <div class="mt-4 text-right"> + <div class="mt-4 text-right d-none"> <button type="button" class="btn btn-success" id="all-yes">Select YES for all {{ form.num_applications }} applicants</button> </div> {% endif %} -- GitLab