Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:PartyInfo

From Rothwell Wiki

Documentation for this module may be created at Module:PartyInfo/doc

-- Module:PartyInfo
local p = {}

function p.getPartyInfo(frame)
    local parties = {"party1", "party2", "party3"}
    local result = ""

    for i, party in ipairs(parties) do
        local partyValue = frame.args[party]
        local last_election = frame.args["last_election" .. i]
        local seats_before = frame.args["seats_before" .. i]
        local seats_change = frame.args["seats_change" .. i]
        local seats_after = frame.args["seats_after" .. i]
        local popular_vote = frame.args["popular_vote" .. i]
        local percentage = frame.args["percentage" .. i]

        if partyValue == "Conservative" or partyValue == "Labour" or partyValue == "Liberal" or partyValue == "Independent" then
            result = result .. '<data source="' .. party .. '" name="' .. partyValue .. '"><format><big>\'\'\'' .. partyValue .. '\'\'\'</big><br/>\'\'\'Last election\'\': ' .. last_election .. '<br/>\'\'\'Seats before\'\': ' .. seats_before .. '<br/>\'\'\'Seats change\'\': ' .. seats_change .. '<br/>\'\'\'Seats after\'\': ' .. seats_after .. '<br/>\'\'\'Popular vote\'\': ' .. popular_vote .. '<br/>\'\'\'Percentage\'\': ' .. percentage .. '</format></data>'
        end
    end

    return result
end

return p
Cookies help us deliver our services. By using our services, you agree to our use of cookies.