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

Module:Infobox after talk

From Sekaipedia

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

local getArgs        = require('Module:Arguments').getArgs
local InfoboxBuilder = require('Module:InfoboxBuilder')
local DisplayFns     = require('Module:DisplayFunctions')
local ProcessingFns  = require('Module:ProcessingFunctions')

local p = {}

function p.main(frame)
	local args = frame:getParent().args
	local infobox = InfoboxBuilder.new()
	
	infobox:setName('Infobox after talk')
		:setParams {
			{ name = 'title', default = mw.title.getCurrentTitle().text },
			--{ name = 'image' },
			{ name = 'japanese' },
			{ name = 'romaji' },
			{ name = 'english' },
			{ name = 'duration', fn = ProcessingFns.stringToNumber },
			{ name = 'date' },
			{ name = 'feat' }
		}
		:setArgs(args)
		:processArgs()
	infobox
		:addHeader({ tag = 'argth', content = 'title' })
		--:addImage({
			--{ tag = 'argtd', content = 'image', fn = DisplayFns.image('220px') },
		--})
		:addRow(
			{
				{ tag = 'th', content = 'Japanese' },
				{ tag = 'argtd', content = 'japanese' }
			}
		)
		:addRow(
			{
				{ tag = 'th', content = 'Romaji' },
				{ tag = 'argtd', content = 'romaji' }
			}
		)
		:addRow(
			{
				{ tag = 'th', content = 'English' },
				{ tag = 'argtd', content = 'english' }
			},
			{ hideIfEmpty = { 'english' } }
		)
		:addHeader({ tag = 'th', content = 'Stream Information' }, { subheader = true })
		:addRow(
			{
				{
					tag = 'th',
					content = 'Stream duration'
				},
				{
					tag = 'argtd',
					content = 'duration',
					fn = DisplayFns.hoursAndMinutes
				}
			}
		)
		:addRow(
			{
				{ tag = 'th', content = 'Release date' },
				{ tag = 'argtd', content = 'date' }
			}
		)
		:addRow(
			{
				{ tag = 'th', content = 'Featuring' },
				{ tag = 'argtd', content = 'feat' }
			}
		)

	return infobox:tostring()
end

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