Module:Election results-STV: Difference between revisions

Content deleted Content added
Hmmm
+
 
(2 intermediate revisions by 2 users not shown)
Line 104:
has_party = true
end
--[[Do something like this to reduce code duplication below
local has_votes = {}
for j = 2, 13 do
if args['votes' .. i .. "_" .. j] then
has_votes[j] = true
end
end]]--
if args['votes' .. i .. '_2'] then
has_votes2 = true
Line 325 ⟶ 333:
row
:tag('th')
:wikitext(args.firstround or 'First count')
:attr('colspan', 2)
--[[consider using a smaller function which accepts a text to handle this
local function create_row(row, text)
row
:tag('th')
:wikitext(text)
:attr('colspan', 2)
return row
end
]]
if has_votes2 then
row
:tag('th')
:wikitext(args.secondround or 'Second count')
:attr('colspan', 2)
end
Line 336 ⟶ 354:
row
:tag('th')
:wikitext(args.thirdround or 'Third count')
:attr('colspan', 2)
end
Line 342 ⟶ 360:
row
:tag('th')
:wikitext(args.fourthround or 'Fourth count')
:attr('colspan', 2)
end
Line 348 ⟶ 366:
row
:tag('th')
:wikitext(args.fifthround or 'Fifth count')
:attr('colspan', 2)
end
Line 354 ⟶ 372:
row
:tag('th')
:wikitext(args.sixthround or 'Sixth count')
:attr('colspan', 2)
end
Line 699 ⟶ 717:
:tag('td')
:attr('colspan', 3)
:wikitext(args['row' .. v])
end
if args['row' .. v] and not has_party then
row
:css('background-color', rcolor)
:tag('td')
:wikitext(args['row' .. v])
end