This commit is contained in:
RunasSudo 2021-01-05 21:07:40 +11:00
parent a0913c2d33
commit 4dd5ec41f9
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
3 changed files with 134 additions and 113 deletions

View File

@ -44,110 +44,104 @@
</div> </div>
<div id="divAdvancedOptions" class="menudiv" style="display: none;"> <div id="divAdvancedOptions" class="menudiv" style="display: none;">
<label class="padafter"> <div class="col-6">
Numbers: <label>
<select id="selNumbers"> Numbers:
<option value="native">Native</option> <select id="selNumbers">
<option value="rational">Rational</option> <option value="native">Native</option>
<option value="fixed" selected>Fixed</option> <option value="rational">Rational</option>
</select> <option value="fixed" selected>Fixed</option>
</label> </select>
<label> </label>
Decimal places (if Numbers = Fixed): <label>
<input type="number" id="txtDP" value="5" style="width: 3em;"> Decimal places (if Numbers = Fixed):
</label> <input type="number" id="txtDP" value="5" style="width: 3em;">
<br> </label>
<label> </div>
Quota: <label class="col-3">
<select id="selQuotaCriterion">
<option value="geq" selected>&gt;=</option>
<option value="gt">&gt;</option>
</select>
</label>
<label>
<select id="selQuota">
<option value="droop" selected>Droop</option>
<option value="droop_exact">Droop (exact)</option>
<option value="hare">Hare</option>
<option value="hare_exact">Hare (exact)</option>
</select>
</label>
<label class="padafter">
<select id="selQuotaMode">
<option value="static" selected>Static quota</option>
<option value="progressive">Progressive quota</option>
<option value="ers97">Static with ERS97 rules</option>
</select>
</label>
<label class="padafter">
<input type="checkbox" id="chkBulkElection" checked> <input type="checkbox" id="chkBulkElection" checked>
Bulk election Bulk election
</label> </label>
<label class="padafter"> <label class="col-3">
<input type="checkbox" id="chkBulkExclusion"> <input type="checkbox" id="chkBulkExclusion">
Bulk exclusion Bulk exclusion
</label> </label>
<label class="padafter"> <!-- Row -->
<div class="col-6">
<label>
Quota:
<select id="selQuotaCriterion">
<option value="geq" selected>&gt;=</option>
<option value="gt">&gt;</option>
</select>
</label>
<label>
<select id="selQuota">
<option value="droop" selected>Droop</option>
<option value="droop_exact">Droop (exact)</option>
<option value="hare">Hare</option>
<option value="hare_exact">Hare (exact)</option>
</select>
</label>
<label>
<select id="selQuotaMode">
<option value="static" selected>Static quota</option>
<option value="progressive">Progressive quota</option>
<option value="ers97">Static with ERS97 rules</option>
</select>
</label>
</div>
<label class="col-6">
<input type="checkbox" id="chkDeferSurpluses"> <input type="checkbox" id="chkDeferSurpluses">
Defer surpluses Defer surpluses
</label> </label>
<br> <!-- Row -->
<label> <div class="col-6">
<input type="checkbox" id="chkRoundQuota" checked> <label>
Round quota to Surplus order:
</label> <select id="selSurplus">
<label class="padafter"> <option value="size" selected>By size</option>
<input type="number" id="txtRoundQuota" value="0" min="0" style="width: 3em;"> <option value="order">By order</option>
d.p. </select>
</label> </label>
<label> <label>
<input type="checkbox" id="chkRoundVotes"> Method:
Round votes to <select id="selTransfers">
</label> <option value="wig" selected>Weighted inclusive Gregory</option>
<label class="padafter"> <option value="uig">Unweighted inclusive Gregory</option>
<input type="number" id="txtRoundVotes" value="0" min="0" style="width: 3em;"> <option value="eg">Exclusive Gregory (last bundle)</option>
d.p. <option value="wright">Wright STV</option>
</label> </select>
<label> </label>
<input type="checkbox" id="chkRoundTVs"> <label>
Round transfer values to <select id="selPapers">
</label> <option value="both" selected>Include non-transferable papers</option>
<label class="padafter"> <option value="transferable">Use transferable papers only</option>
<input type="number" id="txtRoundTVs" value="0" min="0" style="width: 3em;"> </select>
d.p. </label>
</label> </div>
<label> <div class="col-3">
<input type="checkbox" id="chkRoundWeights"> <label>
Round ballot weights to <input type="checkbox" id="chkRoundQuota" checked>
</label> Round quota to
<label> </label>
<input type="number" id="txtRoundWeights" value="0" min="0" style="width: 3em;"> <label>
d.p. <input type="number" id="txtRoundQuota" value="0" min="0" style="width: 3em;">
</label> d.p.
<br> </label>
<label class="padafter"> </div>
Surplus order: <div class="col-3">
<select id="selSurplus"> <label>
<option value="size" selected>By size</option> <input type="checkbox" id="chkRoundVotes">
<option value="order">By order</option> Round votes to
</select> </label>
</label> <label>
<label> <input type="number" id="txtRoundVotes" value="0" min="0" style="width: 3em;">
Method: d.p.
<select id="selTransfers"> </label>
<option value="wig" selected>Weighted inclusive Gregory</option> </div>
<option value="uig">Unweighted inclusive Gregory</option> <!-- Row -->
<option value="eg">Exclusive Gregory (last bundle)</option> <label class="col-6">
<option value="wright">Wright STV</option>
</select>
</label>
<label class="padafter">
<select id="selPapers">
<option value="both" selected>Include non-transferable papers</option>
<option value="transferable">Use transferable papers only</option>
</select>
</label>
<label>
Exclusion: Exclusion:
<select id="selExclusion"> <select id="selExclusion">
<option value="one_round" selected>Exclude in one round</option> <option value="one_round" selected>Exclude in one round</option>
@ -157,20 +151,42 @@
<option value="wright">Wright method (re-iterate)</option> <option value="wright">Wright method (re-iterate)</option>
</select> </select>
</label> </label>
<br> <div class="col-3">
<label class="padafter"> <label>
Ties: <input type="checkbox" id="chkRoundTVs">
<select id="selTies"> Round transfer values to
<option value="backwards_random" selected>Backwards then random</option> </label>
<option value="forwards_random">Forwards then random</option> <label>
<option value="random">Random</option> <input type="number" id="txtRoundTVs" value="0" min="0" style="width: 3em;">
<option value="prompt">Prompt</option> d.p.
</select> </label>
</label> </div>
<label> <div class="col-3">
Random seed: <label>
<input type="text" id="txtSeed" value=""> <input type="checkbox" id="chkRoundWeights">
</label> Round ballot weights to
</label>
<label>
<input type="number" id="txtRoundWeights" value="0" min="0" style="width: 3em;">
d.p.
</label>
</div>
<!-- Row -->
<div class="col-6">
<label>
Ties:
<select id="selTies">
<option value="backwards_random" selected>Backwards then random</option>
<option value="forwards_random">Forwards then random</option>
<option value="random">Random</option>
<option value="prompt">Prompt</option>
</select>
</label>
<label>
Random seed:
<input type="text" id="txtSeed" value="">
</label>
</div>
</div> </div>
<table id="result"></table> <table id="result"></table>

View File

@ -18,7 +18,7 @@
function clickAdvancedOptions() { function clickAdvancedOptions() {
if (document.getElementById('divAdvancedOptions').style.display === 'none') { if (document.getElementById('divAdvancedOptions').style.display === 'none') {
document.getElementById('divAdvancedOptions').style.display = 'block'; document.getElementById('divAdvancedOptions').style.display = 'grid';
document.getElementById('btnAdvancedOptions').innerHTML = 'Hide advanced options'; document.getElementById('btnAdvancedOptions').innerHTML = 'Hide advanced options';
} else { } else {
document.getElementById('divAdvancedOptions').style.display = 'none'; document.getElementById('divAdvancedOptions').style.display = 'none';

View File

@ -33,6 +33,14 @@ body {
padding-bottom: 0.5em; padding-bottom: 0.5em;
} }
#divAdvancedOptions {
display: grid;
grid-template-columns: repeat(12, 1fr);
}
.col-3 { grid-column-end: span 3; }
.col-6 { grid-column-end: span 6; }
/* Count table */ /* Count table */
table { table {
@ -145,6 +153,3 @@ select:focus, input:focus {
label { label {
white-space: nowrap; white-space: nowrap;
} }
label.padafter {
margin-right: 1.5em;
}