feat: toggle sections

This commit is contained in:
Anton Livaja 2024-10-07 19:28:37 -04:00
parent 9b1ff303af
commit 5ce36df0ee
Signed by: anton
GPG Key ID: 44A86CFF1FDF0E85
1 changed files with 43 additions and 18 deletions

View File

@ -31,9 +31,7 @@
<option value="false">No</option> <option value="false">No</option>
</select> </select>
<br> <div id="remote_available_container" class="hidden">
<br>
<label>What threshold would you like to use for the cryptographic signing recovery method? (2/3, 3/5, 4/7 <label>What threshold would you like to use for the cryptographic signing recovery method? (2/3, 3/5, 4/7
etc)</label> etc)</label>
<br> <br>
@ -41,6 +39,7 @@
<!-- if is_remote_available is true --> <!-- if is_remote_available is true -->
<p>Please select public keys which can be used for recovery:</p> <p>Please select public keys which can be used for recovery:</p>
<input type="file" id="pub_keys" name="files[]" multiple> <input type="file" id="pub_keys" name="files[]" multiple>
</div>
<br> <br>
<br> <br>
@ -56,15 +55,14 @@
<br> <br>
<br> <br>
<div id="kyc_available_container" class="hidden">
<label>What threshold would you like to use for the KYC recovery method? (2/3, 3/5, 4/7 etc)</label> <label>What threshold would you like to use for the KYC recovery method? (2/3, 3/5, 4/7 etc)</label>
<br> <br>
<input type="text" id="kyc_threshold" name="kyc_threshold"> <input type="text" id="kyc_threshold" name="kyc_threshold">
<p>Please select KYC data for individuals who can participate in recovery:</p> <p>Please select KYC data for individuals who can participate in recovery:</p>
<input type="file" id="kyc_data" name="files[]" multiple> <input type="file" id="kyc_data" name="files[]" multiple>
</div>
<br>
<br>
<label>Are both remote and KYC based recovery required? (If "No", either one can be used for recovery)</label> <label>Are both remote and KYC based recovery required? (If "No", either one can be used for recovery)</label>
<br> <br>
@ -160,6 +158,33 @@
return toml; return toml;
} }
let remote_available_el = document.getElementById('remote_available');
remote_available_el.addEventListener('input', function() {
let currentValue = remote_available_el.value;
let remote_available_container = document.getElementById('remote_available_container');
if (currentValue == 'true') {
remote_available_container.classList.remove('hidden');
} else {
remote_available_container.classList.add('hidden');
}
});
let kyc_available_el = document.getElementById('kyc_available');
kyc_available_el.addEventListener('input', function() {
let currentValue = kyc_available_el.value;
let remote_available_container = document.getElementById('kyc_available_container');
if (currentValue == 'true') {
remote_available_container.classList.remove('hidden');
} else {
remote_available_container.classList.add('hidden');
}
});
</script> </script>
<style>
.hidden {
display: none;
}
</style>
</body> </body>