Toggle menu
Toggle preferences menu
Toggle personal menu
Nejste přihlášen(a)
Your IP address will be publicly visible if you make any edits.

Dokumentaci tohoto modulu lze vytvořit na stránce Modul:Infobox/Dokumentace

local p = {}

function p.main(frame)
	local args = frame:getParent().args
	local out = mw.html.create('div'):addClass('infobox')

	local title = args['název']
	if title and title ~= '' then
		out:tag('div'):addClass('infobox__title'):wikitext(title)
	end

	local image = args['obrázek']
	if image and image ~= '' then
		local imgWiki = '[[Soubor:' .. image .. '|300px]]'
		out:tag('div'):addClass('infobox__image'):wikitext(imgWiki)
	end

	local rows = out:tag('div'):addClass('infobox__rows')
	local i = 1
	while true do
		local label = args['popisek' .. i]
		local value = args['hodnota' .. i]
		if not label or not value or label == '' or value == '' then
			break
		end
		local row = rows:tag('div'):addClass('infobox__row')
		row:tag('div'):addClass('infobox__label'):wikitext(label)
		row:tag('div'):addClass('infobox__value'):wikitext(value)
		i = i + 1
	end

	return frame:extensionTag('templatestyles', '', { src = 'Šablona:Infobox/styl.css' })
		.. tostring(out)
end

return p