Add signs to Votes display, change default to Votes (transposed)
This commit is contained in:
parent
a24ac3658a
commit
ccc3266d2c
|
@ -189,8 +189,8 @@
|
||||||
<label style="margin-right:1em;">
|
<label style="margin-right:1em;">
|
||||||
Report style:
|
Report style:
|
||||||
<select id="selReport">
|
<select id="selReport">
|
||||||
<option value="votes" selected>Votes only</option>
|
<option value="votes">Votes only</option>
|
||||||
<option value="votes_transposed">Votes (transposed)</option>
|
<option value="votes_transposed" selected>Votes (transposed)</option>
|
||||||
<option value="ballots_votes">Ballots and votes</option>
|
<option value="ballots_votes">Ballots and votes</option>
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
|
|
|
@ -423,15 +423,15 @@ fn update_results_table<N: Number>(stage_num: usize, state: &CountState<N>, opts
|
||||||
"votes" => {
|
"votes" => {
|
||||||
match count_card.state {
|
match count_card.state {
|
||||||
CandidateState::Hopeful | CandidateState::Guarded => {
|
CandidateState::Hopeful | CandidateState::Guarded => {
|
||||||
result.push(&format!(r#"<td class="{}count">{}</td>"#, classes_i, pp(&count_card.transfers, opts.pp_decimals)).into());
|
result.push(&format!(r#"<td class="{}count">{}</td>"#, classes_i, pps(&count_card.transfers, opts.pp_decimals)).into());
|
||||||
result.push(&format!(r#"<td class="{}count">{}</td>"#, classes_i, pp(&count_card.votes, opts.pp_decimals)).into());
|
result.push(&format!(r#"<td class="{}count">{}</td>"#, classes_i, pp(&count_card.votes, opts.pp_decimals)).into());
|
||||||
}
|
}
|
||||||
CandidateState::Elected => {
|
CandidateState::Elected => {
|
||||||
result.push(&format!(r#"<td class="{}count elected">{}</td>"#, classes_i, pp(&count_card.transfers, opts.pp_decimals)).into());
|
result.push(&format!(r#"<td class="{}count elected">{}</td>"#, classes_i, pps(&count_card.transfers, opts.pp_decimals)).into());
|
||||||
result.push(&format!(r#"<td class="{}count elected">{}</td>"#, classes_i, pp(&count_card.votes, opts.pp_decimals)).into());
|
result.push(&format!(r#"<td class="{}count elected">{}</td>"#, classes_i, pp(&count_card.votes, opts.pp_decimals)).into());
|
||||||
}
|
}
|
||||||
CandidateState::Doomed => {
|
CandidateState::Doomed => {
|
||||||
result.push(&format!(r#"<td class="{}count excluded">{}</td>"#, classes_i, pp(&count_card.transfers, opts.pp_decimals)).into());
|
result.push(&format!(r#"<td class="{}count excluded">{}</td>"#, classes_i, pps(&count_card.transfers, opts.pp_decimals)).into());
|
||||||
result.push(&format!(r#"<td class="{}count excluded">{}</td>"#, classes_i, pp(&count_card.votes, opts.pp_decimals)).into());
|
result.push(&format!(r#"<td class="{}count excluded">{}</td>"#, classes_i, pp(&count_card.votes, opts.pp_decimals)).into());
|
||||||
}
|
}
|
||||||
CandidateState::Withdrawn => {
|
CandidateState::Withdrawn => {
|
||||||
|
@ -439,7 +439,7 @@ fn update_results_table<N: Number>(stage_num: usize, state: &CountState<N>, opts
|
||||||
result.push(&format!(r#"<td class="{}count excluded">WD</td>"#, classes_i).into());
|
result.push(&format!(r#"<td class="{}count excluded">WD</td>"#, classes_i).into());
|
||||||
}
|
}
|
||||||
CandidateState::Excluded => {
|
CandidateState::Excluded => {
|
||||||
result.push(&format!(r#"<td class="{}count excluded">{}</td>"#, classes_i, pp(&count_card.transfers, opts.pp_decimals)).into());
|
result.push(&format!(r#"<td class="{}count excluded">{}</td>"#, classes_i, pps(&count_card.transfers, opts.pp_decimals)).into());
|
||||||
if count_card.votes.is_zero() && count_card.parcels.iter().all(|p| p.votes.is_empty()) {
|
if count_card.votes.is_zero() && count_card.parcels.iter().all(|p| p.votes.is_empty()) {
|
||||||
result.push(&format!(r#"<td class="{}count excluded">Ex</td>"#, classes_i).into());
|
result.push(&format!(r#"<td class="{}count excluded">Ex</td>"#, classes_i).into());
|
||||||
} else {
|
} else {
|
||||||
|
@ -498,15 +498,15 @@ fn update_results_table<N: Number>(stage_num: usize, state: &CountState<N>, opts
|
||||||
"ballots_votes" => {
|
"ballots_votes" => {
|
||||||
match count_card.state {
|
match count_card.state {
|
||||||
CandidateState::Hopeful | CandidateState::Guarded => {
|
CandidateState::Hopeful | CandidateState::Guarded => {
|
||||||
result.push(&format!(r#"<td class="{}count">{}</td><td class="count">{}</td>"#, classes_i, pp(&count_card.ballot_transfers, 0), pp(&count_card.transfers, opts.pp_decimals)).into());
|
result.push(&format!(r#"<td class="{}count">{}</td><td class="count">{}</td>"#, classes_i, pps(&count_card.ballot_transfers, 0), pps(&count_card.transfers, opts.pp_decimals)).into());
|
||||||
result.push(&format!(r#"<td class="{}count">{}</td><td class="count">{}</td>"#, classes_i, pp(&count_card.num_ballots(), 0), pp(&count_card.votes, opts.pp_decimals)).into());
|
result.push(&format!(r#"<td class="{}count">{}</td><td class="count">{}</td>"#, classes_i, pp(&count_card.num_ballots(), 0), pp(&count_card.votes, opts.pp_decimals)).into());
|
||||||
}
|
}
|
||||||
CandidateState::Elected => {
|
CandidateState::Elected => {
|
||||||
result.push(&format!(r#"<td class="{}count elected">{}</td><td class="count elected">{}</td>"#, classes_i, pp(&count_card.ballot_transfers, 0), pp(&count_card.transfers, opts.pp_decimals)).into());
|
result.push(&format!(r#"<td class="{}count elected">{}</td><td class="count elected">{}</td>"#, classes_i, pps(&count_card.ballot_transfers, 0), pps(&count_card.transfers, opts.pp_decimals)).into());
|
||||||
result.push(&format!(r#"<td class="{}count elected">{}</td><td class="count elected">{}</td>"#, classes_i, pp(&count_card.num_ballots(), 0), pp(&count_card.votes, opts.pp_decimals)).into());
|
result.push(&format!(r#"<td class="{}count elected">{}</td><td class="count elected">{}</td>"#, classes_i, pp(&count_card.num_ballots(), 0), pp(&count_card.votes, opts.pp_decimals)).into());
|
||||||
}
|
}
|
||||||
CandidateState::Doomed => {
|
CandidateState::Doomed => {
|
||||||
result.push(&format!(r#"<td class="{}count excluded">{}</td><td class="count excluded">{}</td>"#, classes_i, pp(&count_card.ballot_transfers, 0), pp(&count_card.transfers, opts.pp_decimals)).into());
|
result.push(&format!(r#"<td class="{}count excluded">{}</td><td class="count excluded">{}</td>"#, classes_i, pps(&count_card.ballot_transfers, 0), pps(&count_card.transfers, opts.pp_decimals)).into());
|
||||||
result.push(&format!(r#"<td class="{}count excluded">{}</td><td class="count excluded">{}</td>"#, classes_i, pp(&count_card.num_ballots(), 0), pp(&count_card.votes, opts.pp_decimals)).into());
|
result.push(&format!(r#"<td class="{}count excluded">{}</td><td class="count excluded">{}</td>"#, classes_i, pp(&count_card.num_ballots(), 0), pp(&count_card.votes, opts.pp_decimals)).into());
|
||||||
}
|
}
|
||||||
CandidateState::Withdrawn => {
|
CandidateState::Withdrawn => {
|
||||||
|
@ -514,7 +514,7 @@ fn update_results_table<N: Number>(stage_num: usize, state: &CountState<N>, opts
|
||||||
result.push(&format!(r#"<td class="{}count excluded"></td><td class="count excluded">WD</td>"#, classes_i).into());
|
result.push(&format!(r#"<td class="{}count excluded"></td><td class="count excluded">WD</td>"#, classes_i).into());
|
||||||
}
|
}
|
||||||
CandidateState::Excluded => {
|
CandidateState::Excluded => {
|
||||||
result.push(&format!(r#"<td class="{}count excluded">{}</td><td class="count excluded">{}</td>"#, classes_i, pp(&count_card.ballot_transfers, 0), pp(&count_card.transfers, opts.pp_decimals)).into());
|
result.push(&format!(r#"<td class="{}count excluded">{}</td><td class="count excluded">{}</td>"#, classes_i, pps(&count_card.ballot_transfers, 0), pps(&count_card.transfers, opts.pp_decimals)).into());
|
||||||
if count_card.votes.is_zero() && count_card.parcels.iter().all(|p| p.votes.is_empty()) {
|
if count_card.votes.is_zero() && count_card.parcels.iter().all(|p| p.votes.is_empty()) {
|
||||||
result.push(&format!(r#"<td class="{}count excluded"></td><td class="count excluded">Ex</td>"#, classes_i).into());
|
result.push(&format!(r#"<td class="{}count excluded"></td><td class="count excluded">Ex</td>"#, classes_i).into());
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue