Display number of candidates/seats in JS report.

This commit is contained in:
RunasSudo 2021-01-11 03:01:51 +11:00
parent b6c9eb73ad
commit 7f30871296
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
2 changed files with 3 additions and 1 deletions

View File

@ -303,6 +303,7 @@ async function clickCount() {
elP.innerText = 'Count computed by pyRCV2 (revision ' + pyRCV2version + ').';
}
elP.innerText += ' Read ' + evt.data.total_ballots + ' ballots from ‘' + filePath + '’ for election ‘' + election.name + '’.';
elP.innerText += ' There are ' + election.candidates.length + ' candidates for ' + election.seats + ' vacancies.';
if (evt.data.options === '') {
elP.innerText += ' Counting using default options.';
} else {

View File

@ -68,7 +68,8 @@ onmessage = function(evt) {
'type': 'init',
'election': {
'name': election.py_name,
'candidates': election.candidates.map(c => c.py_name)
'candidates': election.candidates.map(c => c.py_name),
'seats': election.seats,
},
'total_ballots': total_ballots.pp(0),
'options': counter.describe_options(),