Module:Infobox Class

From Brighter Shores Wiki
Jump to navigation Jump to search

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

--------------------------
-- Module for [[Template:Infobox Class]]
------------------------
local p = {}

local infobox = require('Module:Infobox')
local onmain = require('Module:Mainonly').on_main

function p.main(frame)
	local args = frame:getParent().args
	local ret = infobox.new(args)

	ret:defineParams{
		{ name = 'name', func = 'name' },
		{ name = 'image', func = 'image' },

		{ name = 'episode', func = 'has_content' },
	}

	ret:create()
	ret:cleanParams()

	ret:defineName('Infobox Class')
	ret:addClass('infobox-class')

	ret:addRow{
		{ tag = 'argh', content = 'name', class='infobox-header', colspan = '20' }
	}
	:pad(20)
	:addRow{
		{ tag = 'argd', content = 'image', class = 'infobox-image infobox-full-width-content', colspan = '20' }
	}
	:pad(20)
	:addRow{
		{ tag = 'th', content = 'Episode', colspan = '7' },
		{ tag = 'argd', content = 'episode', colspan = '13' }
	}

	return ret:tostring()
end

return p