Avoid wrapping candidate names/statuses in HTML report

This commit is contained in:
RunasSudo 2022-03-14 22:27:58 +11:00
parent 67bf6f33d8
commit 9fcb643fe5
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
2 changed files with 22 additions and 20 deletions

View File

@ -1,20 +1,19 @@
/* /* OpenTally: Open-source election vote counting
pyRCV2: Preferential vote counting * Copyright © 20212022 Lee Yingtong Li (RunasSudo)
Copyright © 20202021 Lee Yingtong Li (RunasSudo) *
* This program is free software: you can redistribute it and/or modify
This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by
it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or
the Free Software Foundation, either version 3 of the License, or * (at your option) any later version.
(at your option) any later version. *
* This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details.
GNU Affero General Public License for more details. *
* You should have received a copy of the GNU Affero General Public License
You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>. */
*/
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600&display=swap');
@ -108,6 +107,9 @@ td.count sup {
tr.stage-no td, tr.stage-kind td, tr.stage-comment td, tr.hint-papers-votes td { tr.stage-no td, tr.stage-kind td, tr.stage-comment td, tr.hint-papers-votes td {
text-align: center; text-align: center;
} }
td.candidate-name, td.elected, td.excluded {
white-space: nowrap;
}
tr.stage-kind td { tr.stage-kind td {
font-size: 0.75em; font-size: 0.75em;
min-width: 5rem; min-width: 5rem;

View File

@ -1,5 +1,5 @@
/* OpenTally: Open-source election vote counting /* OpenTally: Open-source election vote counting
* Copyright © 2021 Lee Yingtong Li (RunasSudo) * Copyright © 20212022 Lee Yingtong Li (RunasSudo)
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by * it under the terms of the GNU Affero General Public License as published by
@ -348,9 +348,9 @@ pub fn init_results_table<N: Number>(election: &Election<N>, opts: &stv::STVOpti
for candidate in election.candidates.iter() { for candidate in election.candidates.iter() {
if report_style == "votes_transposed" { if report_style == "votes_transposed" {
result.push_str(&format!(r#"<tr class="candidate transfers"><td>{}</td></tr>"#, candidate.name)); result.push_str(&format!(r#"<tr class="candidate transfers"><td class="candidate-name">{}</td></tr>"#, candidate.name));
} else { } else {
result.push_str(&format!(r#"<tr class="candidate transfers"><td rowspan="2">{}</td></tr><tr class="candidate votes"></tr>"#, candidate.name)); result.push_str(&format!(r#"<tr class="candidate transfers"><td rowspan="2" class="candidate-name">{}</td></tr><tr class="candidate votes"></tr>"#, candidate.name));
} }
} }