Module:vote timeline

Hello, you have come here looking for the meaning of the word Module:vote timeline. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:vote timeline, but we will also tell you about its etymology, its characteristics and you will know how to say Module:vote timeline in singular and plural. Everything you need to know about the word Module:vote timeline you have here. The definition of the word Module:vote timeline will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:vote timeline, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

This module needs documentation.
Please document this module by describing its purpose and usage on the documentation page.

local export = {}

function export.timeline (frame)

	local args = frame:getParent().args

	local result = ""

	for k, v in pairs (args) do
		if k == 1 then
			result = result .. '<div class="NavFrame">'
			result = result .. '<div class="NavHead">' .. v .. '</div>'
			result = result .. '<div class="NavContent">'

			result = result .. '<table class="wikitable" style="width: 100%">'

			result = result .. '<tr>'
			result = result .. '<th>Ended</th>'
			result = result .. '<th>Title</th>'
			result = result .. '<th>Result</th>'
			result = result .. '</tr>'
		else
			if k%3 == 2 then
				result = result .. '<tr>'
				result = result .. '<td style="text-align: center; width: 80px"><b>' .. v .. '</b></td>'
			end

			if k%3 == 0 then
				local offset = mw.ustring.find (v, "/", 1, true)
				offset = offset + 1
				local voteNameWithoutPrefix = mw.ustring.sub (v, offset, 100000)
				result = result .. '<td style="text-align: left">]</td>'
			end

			if k%3 == 1 then
				result = result .. '<td style="text-align: left; width: 250px"><b>' .. v .. '</b></td>'
				result = result .. '</tr>'
			end
		end
	end

	result = result .. '</table>'

	result = result .. '</div>'
	result = result .. '</div>'

	return result

end

return export