Content deleted Content added
+ |
|||
Line 9:
local winner, winner_votes = {0, 0, 0}, {0, 0, 0}
local valid = {0, 0, 0}
local invalid = {tonumber(args.invalid) or 0, tonumber(args.invalid2) or 0, tonumber(args.invalid3) or 0}
local blank = {tonumber(args.blank) or 0, tonumber(args.blank2) or 0, tonumber(args.blank3) or 0}
Line 76 ⟶ 75:
local stop_flag = false
local i = 0
local has_votes =
local has_votes2 =
local has_votes3 = args['votes' .. i .. '_3'] or args['ivotes' .. i .. '_3']
local has_seats2 = args['seats' .. i .. '_2'] or args['iseats' .. i .. '_2']
Line 142 ⟶ 141:
rounds = (rounds < 2) and 2 or rounds
end
if args['valid2
rounds = (rounds < 2) and 2 or rounds
end
Line 277 ⟶ 276:
:tag('th')
:css('text-align', 'center')
:css('color', 'black')
:css('background', '#F8F9FA')
:wikitext(args['image'])
Line 285:
:tag('td')
:css('text-align', 'center')
:css('color', 'black')
:css('background', '#F8F9FA')
end
Line 1,039 ⟶ 1,040:
end
-- separating line
if args['valid'] or args['valid2'] or args['valid3']
row = root
:tag('tr')
Line 1,045 ⟶ 1,046:
row
:tag('td')
:css('color', 'black')
:css('background', '#eaecf0')
:attr('colspan', cols)
end
-- valid votes
if
row = root
:tag('tr')
Line 1,061 ⟶ 1,063:
:css('text-align', 'left')
:css('font-weight', 'normal')
:css('color', 'inherit')
:css('background', 'inherit')
if
row
:tag('td')
:wikitext(fmt(ovalid[1]))
:tag('td')
:wikitext(pct(ovalid[1], ovalid
elseif not args['invalid
row
:tag('td')
Line 1,093 ⟶ 1,096:
:wikitext()
end
if
row
:tag('td')
:wikitext(fmt(ovalid[2]))
:tag('td')
:wikitext(pct(ovalid[2], ovalid
elseif
row
:tag('td')
Line 1,124 ⟶ 1,127:
:wikitext()
end
if
row
:tag('td')
:wikitext(fmt(ovalid[3]))
:tag('td')
:wikitext(pct(ovalid[3], ovalid
elseif
row
:tag('td')
Line 1,157 ⟶ 1,160:
:addClass('sortbottom')
:css('text-align', 'right')
row
:tag('th')
:wikitext('Invalid
:attr('scope', 'row')
:attr('colspan', cs)
:css('text-align', 'left')
:css('font-weight', 'normal')
:css('color', 'inherit')
:css('background', 'inherit')
else
row
:tag('th')
:wikitext('Invalid/blank votes')
:wikitext(args.invalidnote)
:attr('scope', 'row')
Line 1,176 ⟶ 1,179:
:css('text-align', 'left')
:css('font-weight', 'normal')
:css('color', 'inherit')
:css('background', 'inherit')
end
if args['
row
:tag('td')
Line 1,190 ⟶ 1,188:
:tag('td')
:wikitext(pct(invalid[1], ovalid[1] + invalid[1] + blank[1]))
elseif
row
:tag('td')
Line 1,215 ⟶ 1,213:
:wikitext()
end
if rounds > 1 and args['
row
:tag('td')
Line 1,227 ⟶ 1,219:
:tag('td')
:wikitext(pct(invalid[2], ovalid[2] + invalid[2] + blank[2]))
elseif rounds > 1 and not args['invalid2
row
:tag('td')
Line 1,252 ⟶ 1,244:
:wikitext()
end
if has_seats3 and args['
row
:tag('td')
Line 1,264 ⟶ 1,250:
:tag('td')
:wikitext(pct(invalid[3], ovalid[3] + invalid[3] + blank[3]))
elseif
row
:tag('td')
Line 1,299 ⟶ 1,285:
:css('text-align', 'left')
:css('font-weight', 'normal')
:css('color', 'inherit')
:css('background', 'inherit')
row
Line 1,384 ⟶ 1,371:
end
-- total
if
row = root:tag('tr')
:addClass('sortbottom')
Line 1,397 ⟶ 1,384:
:css('background', 'inherit')
:css('color', 'inherit')
if not args['totalvotes'] and args['invalid
row
:tag('td')
:wikitext(fmt(ovalid
:tag('td')
:wikitext(pct(1, 1))
Line 1,409 ⟶ 1,396:
:tag('td')
:wikitext('–')
elseif not args['invalid'] and not args['totalvotes']
row
:tag('td')
Line 1,434 ⟶ 1,421:
:wikitext()
end
if rounds > 1 and args['invalid2
row
:tag('td')
:wikitext(fmt(ovalid
:tag('td')
:wikitext(pct(1, 1))
Line 1,471 ⟶ 1,458:
:wikitext()
end
if has_seats3 and not args['totalvotes3'] and args['
row
:tag('td')
:wikitext(fmt(ovalid
:tag('td')
:wikitext(pct(1, 1))
Line 1,523 ⟶ 1,510:
:tag('td')
:wikitext(fmt(electorate[1]))
if
row
:tag('td')
:wikitext(args.turnout or pct(ovalid
elseif args['totalvotes'] and args['electorate'] then
row
Line 1,562 ⟶ 1,549:
:tag('td')
:wikitext(fmt(electorate[2]))
if args['invalid2
row
:tag('td')
:wikitext(args.turnout2 or pct(ovalid
elseif args['totalvotes2'] and args['electorate2'] then
row
Line 1,602 ⟶ 1,589:
:tag('td')
:wikitext(fmt(electorate[3]))
if args['invalid3
row
:tag('td')
:wikitext(args.turnout3 or pct(ovalid
elseif args['totalvotes3'] and args['electorate3'] then
row
Line 1,643 ⟶ 1,630:
row
:tag('td')
:css('color', 'black')
:css('background', '#eaecf0')
:attr('colspan', cols)
Line 1,657 ⟶ 1,645:
:css('text-align', 'left')
:css('font-weight', 'normal')
:css('color', 'inherit')
:css('background', 'inherit')
for k=1, rounds do
Line 1,715 ⟶ 1,704:
:css('text-align', 'left')
:css('font-weight', 'normal')
:css('color', 'inherit')
:css('background', 'inherit')
for k=1, rounds do
|