From 7f3087129624413ddf2994c290596249bf194412 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Mon, 11 Jan 2021 03:01:51 +1100 Subject: [PATCH] Display number of candidates/seats in JS report. --- html/index.js | 1 + html/worker.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/html/index.js b/html/index.js index 80a8cbf..2b832e3 100644 --- a/html/index.js +++ b/html/index.js @@ -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 { diff --git a/html/worker.js b/html/worker.js index c2397ed..e382fbb 100644 --- a/html/worker.js +++ b/html/worker.js @@ -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(),