Display number of candidates/seats in JS report.
This commit is contained in:
parent
b6c9eb73ad
commit
7f30871296
@ -303,6 +303,7 @@ async function clickCount() {
|
|||||||
elP.innerText = 'Count computed by pyRCV2 (revision ' + pyRCV2version + ').';
|
elP.innerText = 'Count computed by pyRCV2 (revision ' + pyRCV2version + ').';
|
||||||
}
|
}
|
||||||
elP.innerText += ' Read ' + evt.data.total_ballots + ' ballots from ‘' + filePath + '’ for election ‘' + election.name + '’.';
|
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 === '') {
|
if (evt.data.options === '') {
|
||||||
elP.innerText += ' Counting using default options.';
|
elP.innerText += ' Counting using default options.';
|
||||||
} else {
|
} else {
|
||||||
|
@ -68,7 +68,8 @@ onmessage = function(evt) {
|
|||||||
'type': 'init',
|
'type': 'init',
|
||||||
'election': {
|
'election': {
|
||||||
'name': election.py_name,
|
'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),
|
'total_ballots': total_ballots.pp(0),
|
||||||
'options': counter.describe_options(),
|
'options': counter.describe_options(),
|
||||||
|
Reference in New Issue
Block a user